ILNumerics Ultimate VS

ILMathonesT Method (Int64)

ILNumerics Ultimate VS Documentation
ILNumerics - Technical Application Development
Creates a new array of ones '1' with a size determined by size.

[ILNumerics Computing Engine]

Namespace:  ILNumerics
Assembly:  ILNumerics.Computing (in ILNumerics.Computing.dll) Version: 5.5.0.0 (5.5.7503.3146)
Syntax

public static RetArray<T> ones<T>(
	params long[] size
)
where T : struct, new()

Parameters

size
Type: SystemInt64
Variable length Array or comma separated list with lengths of the dimensions of the new array.

Type Parameters

T
Element type for the new array. This must be a value type.

Return Value

Type: RetArrayT
New array of the specified size and ColumnMajor storage order, initialized with '1'.
Exceptions

ExceptionCondition
ArgumentExceptionif T is not supported. Use one of the predefined, scalar value types (Double, float, int, ...), complex or fcomplex.
ArgumentExceptionif size is null, has more elements than MaxNumberOfDimensions or contains negative values.
Remarks

Supported element types are all predefined, scalar numeric value types.

size must be not null. Its lengths determines the number of dimensions of the new array. Negative element values are not allowed.

Arrays returned from this overload are in ColumnMajor storage order. Use ones``1(InArrayInt64, StorageOrders) for determining the storage order explicitly.

Since the variable length parameter list and the 'params' keyword (C#) implicitly allocates new storage under the control of the GC consider using one of the vector``1(UMP) overloads and ones``1(InArrayInt64, StorageOrders) instead to provide the dimension lengths. This is recommended when high-performance is important.

[ILNumerics Computing Engine]

See Also

Reference

MathInternal.zeros``1(Int64, Int64, StorageOrders)
MathInternal.array``1(UMP, Int64, StorageOrders)
MathInternal.vector``1(UMP, UMP, UMP, UMP, UMP, UMP, UMP, UMP, UMP, UMP)
MathInternal.ones``1(Int64, Int64, StorageOrders)
MathInternal.empty``1(Int64, Int64, StorageOrders)

Other Resources