Tensor Layout.To Offset Method
Definition
Namespace: Numerics.NET.Tensors
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.1
Assembly: Numerics.NET.Tensors (in Numerics.NET.Tensors.dll) Version: 9.0.1
Overload List
ToOffset( | Converts a set of two integer indexes to a linear offset. |
ToOffset(Int32[]) | Converts a set of integer indexes to a linear offset. |
ToOffset( | Converts a set of integer indexes to a linear offset. |
ToOffset( | Converts a set of two integer indexes to a linear offset. |
ToOffset( | Converts a set of three integer indexes to a linear offset. |
ToOffset( | Converts a set of four integer indexes to a linear offset. |
ToOffset(Int32)
Converts a set of two integer indexes to a linear offset.
public int ToOffset(
int index1
)
Parameters
- index1 Int32
- The first index.
Return Value
Int32The linear index corresponding to index1.
Remarks
This method multiplies the index by the corresponding stride without any range checks.
ToOffset(Int32[])
Converts a set of integer indexes to a linear offset.
public int ToOffset(
int[] indexes
)
Parameters
- indexes Int32[]
- An array of indexes.
Return Value
Int32The linear index corresponding to indexes.
Remarks
This method multiplies the indexes by the corresponding strides and returns the sum without any range checks.
ToOffset(ReadOnlySpan<Int32>)
Converts a set of integer indexes to a linear offset.
public int ToOffset(
ReadOnlySpan<int> indexes
)
Parameters
- indexes ReadOnlySpan<Int32>
- An array of indexes.
Return Value
Int32The linear index corresponding to indexes.
Remarks
This method multiplies the indexes by the corresponding strides and returns the sum without any range checks.
ToOffset(Int32, Int32)
Converts a set of two integer indexes to a linear offset.
public int ToOffset(
int index1,
int index2
)
Parameters
Return Value
Int32The linear index corresponding to index1 and index2.
Remarks
This method multiplies the indexes by the corresponding strides and returns the sum without any range checks.
ToOffset(Int32, Int32, Int32)
Converts a set of three integer indexes to a linear offset.
public int ToOffset(
int index1,
int index2,
int index3
)
Parameters
Return Value
Int32The linear index corresponding to index1, index2, and index3.
Remarks
This method multiplies the indexes by the corresponding strides and returns the sum without any range checks.
ToOffset(Int32, Int32, Int32, Int32)
Converts a set of four integer indexes to a linear offset.
public int ToOffset(
int index1,
int index2,
int index3,
int index4
)
Parameters
- index1 Int32
- The first index.
- index2 Int32
- The second index.
- index3 Int32
- The third index.
- index4 Int32
- The fourth index.
Return Value
Int32The linear index corresponding to index1, index2, index2, and index4.
Remarks
This method multiplies the indexes by the corresponding strides and returns the sum without any range checks.