Calculates the sum of elements in one array based on evaluating a logical function on
corresponding elements in another data.
Namespace:
CenterSpace.NMath.StatsAssembly: NMathStats (in NMathStats.dll) Version: 3.4.0.0
Syntax
| C# |
|---|
public static int SumIf( int[] data, StatsFunctions..::.LogicalIntFunction function, int[] sum ) |
| Visual Basic (Declaration) |
|---|
Public Shared Function SumIf ( _ data As Integer(), _ function As StatsFunctions..::.LogicalIntFunction, _ sum As Integer() _ ) As Integer |
| Visual C++ |
|---|
public: static int SumIf( array<int>^ data, StatsFunctions..::.LogicalIntFunction^ function, array<int>^ sum ) |
Parameters
- data
- Type: array<
System..::.Int32
>[]()[]
Evaluation data.
- function
- Type: CenterSpace.NMath.Stats..::.StatsFunctions..::.LogicalIntFunction
A function that takes an integer and returns a boolean.
- sum
- Type: array<
System..::.Int32
>[]()[]
Sum data.
Return Value
A sum.
Exceptions
| Exception | Condition |
|---|---|
| CenterSpace.NMath.Core..::.MismatchedSizeException | Thrown if data and sum do not have the same length; |