| NMathFunctionsIf(DoubleVector, FuncDouble, Boolean, Double, Double) Method |
Creates a new vector by applying a logical function to the elements of a
vector. Elements in the original vector that return true are set to the given true value
in the new vector; elements that return false are set to the given false value.
Namespace: CenterSpace.NMath.CoreAssembly: NMath (in NMath.dll) Version: 7.4
Syntax public static DoubleVector If(
DoubleVector data,
Func<double, bool> function,
double ifTrue,
double ifFalse
)
Public Shared Function If (
data As DoubleVector,
function As Func(Of Double, Boolean),
ifTrue As Double,
ifFalse As Double
) As DoubleVector
public:
static DoubleVector^ If(
DoubleVector^ data,
Func<double, bool>^ function,
double ifTrue,
double ifFalse
)
static member If :
data : DoubleVector *
function : Func<float, bool> *
ifTrue : float *
ifFalse : float -> DoubleVector
Parameters
- data DoubleVector
- A vector.
- function FuncDouble, Boolean
- A function that takes a double and returns a boolean.
- ifTrue Double
- Value in case of true.
- ifFalse Double
- Value in case of false.
Return Value
DoubleVectorA new vector.
See Also