ILNumerics Ultimate VS

ExtensionMethodsitemT1 Method (BaseArrayT1, Int64)

ILNumerics Ultimate VS Documentation
ILNumerics - Technical Application Development
[numpy API] Returns a single element from this array according to the provided dimension indices.

[ILNumerics numpy Module]

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

public static T1 item<T1>(
	this BaseArray<T1> A,
	params long[] dims
)

Parameters

A
Type: ILNumericsBaseArrayT1
The ILNumerics n-dim array.
dims
Type: SystemInt64
Indices into the dimensions of A, values can be negative.

Type Parameters

T1
Element type.

Return Value

Type: T1
Copy of the element as located by the indices given by dims.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type BaseArrayT1. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions

ExceptionCondition
IndexOutOfRangeException if an index exceeds the allowed range of the corresponding dimension.
Remarks

An index for dimension i can be negative and must evaluate to an element position in the range 0...A.S[i]-1, where negative indices count backwards, starting from the last element index in dimension i.

This function does not support the merging of trailing, unspecified dimensions as known from [!:ILNumerics.ExtensionMethods.GetValue(BaseArray<bool>, long, long, long, long, long, long, long)] or from itemT1(BaseArrayT1, Int64).

Unspecified dimension indices are assumed to be 0. Optional indices for virtual dimensions must be 0.

Consequently, providing dims as null or as empty array returns the first element of A or the only element for a scalar array A. However, if A is empty an IndexOutOfRangeException will be thrown.

If dims has exactly one element, this element is considered as the sequential/ linear index into the flattened array.

[ILNumerics numpy Module]

See Also

Reference

[!:ILNumerics.ExtensionMethods.GetValue(BaseArray<bool>, long, long, long, long, long, long, long)]