Array Math.Sum If(Double[], Func<Double, Int 32, Boolean>) Method
Computes the sum of the elements in an array that satisfy the specified predicate.
Definition
Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
The sum of the specified elements in array.
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
public static double SumIf(
this double[] array,
Func<double, int, bool> predicate
)
Parameters
- array Double[]
- A Double array.
- predicate Func<Double, 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
DoubleThe sum of the specified elements in array.