ArrayMath.SumIf(Double[], Func<Double, 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#
public static double SumIf(
	this double[] array,
	Func<double, bool> predicate
)

Parameters

array  Double[]
A Double array.
predicate  Func<Double, Boolean>
A delegate that represents a function of one variable that returns whether a value should be included in the sum.

Return Value

Double
The 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 Double[]. 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).

See Also