Computes the sum of the elements in an array that satisfy the specified predicate.
Namespace:
Extreme.Mathematics
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static double SumIf(
this double[] array,
Func<double, int, bool> predicate
)
<ExtensionAttribute>
Public Shared Function SumIf (
array As Double(),
predicate As Func(Of Double, Integer, Boolean)
) As Double
public:
[ExtensionAttribute]
static double SumIf(
array<double>^ array,
Func<double, int, bool>^ predicate
)
[<ExtensionAttribute>]
static member SumIf :
array : float[] *
predicate : Func<float, int, bool> -> float
Parameters
- array
- Type: SystemDouble
A Double array. - predicate
- Type: SystemFuncDouble, Int32, Boolean
A delegate that represents a function of one variable that returns whether a value at a specified
index should be included in the sum.
Return Value
Type:
DoubleThe sum of the specified elements in
array.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
Reference