Vector.CreateFromFunction<T> Method

Note: This API is now obsolete.
Constructs a new dense vector with elements initialized by a function.

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.9.0
C#
[ObsoleteAttribute("Use Vector.FromFunction(length, initializer, mutability, checkMissingValues) instead.")]
public static DenseVector<T> CreateFromFunction<T>(
	int length,
	Func<int, T> initializer,
	ArrayMutability mutability = ArrayMutability.MutableValues,
	bool checkMissingValues = false
)

Parameters

length  Int32
The number of elements.
initializer  Func<Int32, T>
A function that returns the value of each element.
mutability  ArrayMutability  (Optional)
Specifies how the resulting object's values may be changed.
checkMissingValues  Boolean  (Optional)
Specifies whether operations involving the vector should check for the presence of missing values.

Type Parameters

T

Return Value

DenseVector<T>
A DenseVector<T> whose elements are initialized using initializer.

Exceptions

ArgumentNullException

initializer is null.

ArgumentOutOfRangeException

length is less than zero.

See Also