Creates a new array by applying a logical function to the elements of an array. Elements in the original array that return true are set to the given true value in the new array; elements that return false are set to the given false value.

Namespace:  CenterSpace.NMath.Stats
Assembly:  NMathStats (in NMathStats.dll) Version: 3.4.0.0

Syntax

C#
public static int[] If(
	int[] data,
	StatsFunctions..::.LogicalIntFunction function,
	int ifTrue,
	int ifFalse
)
Visual Basic (Declaration)
Public Shared Function If ( _
	data As Integer(), _
	function As StatsFunctions..::.LogicalIntFunction, _
	ifTrue As Integer, _
	ifFalse As Integer _
) As Integer()
Visual C++
public:
static array<int>^ If(
	array<int>^ data, 
	StatsFunctions..::.LogicalIntFunction^ function, 
	int ifTrue, 
	int ifFalse
)

Parameters

data
Type: array< System..::.Int32 >[]()[]
An array of integers.
function
Type: CenterSpace.NMath.Stats..::.StatsFunctions..::.LogicalIntFunction
A function that takes an integer and returns a boolean.
ifTrue
Type: System..::.Int32
Value in case of true.
ifFalse
Type: System..::.Int32
Value in case of false.

Return Value

A new array.

See Also