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