| NMathFunctionsSumIf(Int32, FuncInt32, Boolean) Method |
Calculates the sum of the elements in an array that return true when a given
logical function is applied.
Namespace: CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 7.4
Syntax public static int SumIf(
int[] data,
Func<int, bool> function
)
Public Shared Function SumIf (
data As Integer(),
function As Func(Of Integer, Boolean)
) As Integer
public:
static int SumIf(
array<int>^ data,
Func<int, bool>^ function
)
static member SumIf :
data : int[] *
function : Func<int, bool> -> int
Parameters
- data Int32
- An array of integers.
- function FuncInt32, Boolean
- A function that takes an integer and returns a boolean.
Return Value
Int32The sum of the elements where
function returns
true.
See Also