Tensor<T>.GetValue Method

Definition

Namespace: Numerics.NET.Tensors
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.0

Overload List

GetValue(Index) Gets the value at the specified position in a 1D tensor.
GetValue(Index[]) Gets the element at the specified position.
GetValue(Int32) Gets the value at the specified index in a 1D tensor.
GetValue(Int32[]) Gets the element at the specified position.
GetValue(ReadOnlySpan<Index>) Gets the element at the specified position.
GetValue(ReadOnlySpan<Int32>) Gets the element at the specified position.
GetValue(Index, Index) Gets the value at the specified position in a 2D tensor.
GetValue(Int32, Int32) Gets the value at the specified position in a 2D tensor.
GetValue(Index, Index, Index) Gets the value at the specified position in a 3D tensor.
GetValue(Int32, Int32, Int32) Gets the value at the specified position in a 2D tensor.
GetValue(Index, Index, Index, Index) Gets the value at the specified position in a 4D tensor.
GetValue(Int32, Int32, Int32, Int32) Gets the value at the specified position in a 4D tensor.

GetValue(Index)

Gets the value at the specified position in a 1D tensor.
C#
public virtual T GetValue(
	Index index
)

Parameters

index  Index
The position of the element.

Return Value

T
The element with index index.

GetValue(Index[])

Gets the element at the specified position.
C#
public T GetValue(
	params Index[] indexes
)

Parameters

indexes  Index[]
An array of Index values of the element.

Return Value

T
The element in the position specified by indexes.

Remarks

This method does not perform bounds checking. It is provided for optimized access in situations where the argument is known to be within bounds. If the argument is outside its valid range, the result is unspecified.

Exceptions

DimensionMismatchException

The length of indexes is not equal to the rank of the tensor.

GetValue(Int32)

Gets the value at the specified index in a 1D tensor.
C#
public virtual T GetValue(
	int index
)

Parameters

index  Int32
The position of the element.

Return Value

T
The element at position index.

GetValue(Int32[])

Gets the element at the specified position.
C#
public T GetValue(
	params int[] indexes
)

Parameters

indexes  Int32[]
An array of zero-based indexes of the element.

Return Value

T
The element in the position specified by indexes.

Remarks

This method does not perform bounds checking. It is provided for optimized access in situations where the argument is known to be within bounds. If the argument is outside its valid range, the result is unspecified.

Exceptions

DimensionMismatchException

The length of indexes is not equal to the rank of the tensor.

GetValue(ReadOnlySpan<Index>)

Gets the element at the specified position.
C#
public virtual T GetValue(
	ReadOnlySpan<Index> indexes
)

Parameters

indexes  ReadOnlySpan<Index>
A read-only span of Index values of the element.

Return Value

T
The element in the position specified by indexes.

Remarks

This method does not perform bounds checking. It is provided for optimized access in situations where the argument is known to be within bounds. If the argument is outside its valid range, the result is unspecified.

Exceptions

DimensionMismatchException

The length of indexes is not equal to the rank of the tensor.

GetValue(ReadOnlySpan<Int32>)

Gets the element at the specified position.
C#
public abstract T GetValue(
	ReadOnlySpan<int> indexes
)

Parameters

indexes  ReadOnlySpan<Int32>
A read-only span of zero-based indexes of the element.

Return Value

T
The element in the position specified by indexes.

Remarks

This method does not perform bounds checking. It is provided for optimized access in situations where the argument is known to be within bounds. If the argument is outside its valid range, the result is unspecified.

Exceptions

DimensionMismatchException

The length of indexes is not equal to the rank of the tensor.

GetValue(Index, Index)

Gets the value at the specified position in a 2D tensor.
C#
public virtual T GetValue(
	Index index1,
	Index index2
)

Parameters

index1  Index
The position of the element in the first dimension.
index2  Index
The position of the element in the second dimension.

Return Value

T
The element with indices index1 and index2.

GetValue(Int32, Int32)

Gets the value at the specified position in a 2D tensor.
C#
public virtual T GetValue(
	int index1,
	int index2
)

Parameters

index1  Int32
The position of the element in the first dimension.
index2  Int32
The position of the element in the second dimension.

Return Value

T
The element with indices index1 and index2.

GetValue(Index, Index, Index)

Gets the value at the specified position in a 3D tensor.
C#
public virtual T GetValue(
	Index index1,
	Index index2,
	Index index3
)

Parameters

index1  Index
The position of the element in the first dimension.
index2  Index
The position of the element in the second dimension.
index3  Index
The position of the element in the third dimension.

Return Value

T
The element with indices index1, index2, and index3.

GetValue(Int32, Int32, Int32)

Gets the value at the specified position in a 2D tensor.
C#
public virtual T GetValue(
	int index1,
	int index2,
	int index3
)

Parameters

index1  Int32
The position of the element in the first dimension.
index2  Int32
The position of the element in the second dimension.
index3  Int32
The position of the element in the third dimension.

Return Value

T
The element with indices index1, index2, and index3.

GetValue(Index, Index, Index, Index)

Gets the value at the specified position in a 4D tensor.
C#
public virtual T GetValue(
	Index index1,
	Index index2,
	Index index3,
	Index index4
)

Parameters

index1  Index
The position of the element in the first dimension.
index2  Index
The position of the element in the second dimension.
index3  Index
The position of the element in the third dimension.
index4  Index
The position of the element in the fourth dimension.

Return Value

T
The element with indices index1, index2, index3, and index4.

GetValue(Int32, Int32, Int32, Int32)

Gets the value at the specified position in a 4D tensor.
C#
public virtual T GetValue(
	int index1,
	int index2,
	int index3,
	int index4
)

Parameters

index1  Int32
The position of the element in the first dimension.
index2  Int32
The position of the element in the second dimension.
index3  Int32
The position of the element in the third dimension.
index4  Int32
The position of the element in the fourth dimension.

Return Value

T
The element with indices index1, index2, index3, and index4.

See Also