Method CreateRotate
- Namespace
- Zyl.VectorTraits
- Assembly
- VectorTraits.dll
CreateRotate<T>(T[], int, int)
Rotate creates a new Vector<T> from a given span starting at a specified index position (于指定索引位置开始,从指定跨度旋转创建一个 Vector<T>).
public static Vector<T> CreateRotate<T>(T[] values, int index, int length) where T : struct
Parameters
values
T[]The array from which the vector is created (用于创建向量的数组).
index
intStarting index position of valid data in
values
(values
中有效数据的起始索引位置).length
intLength of valid data in
values
(values
中有效数据的长度).
Returns
- Vector<T>
A new Vector<T> with its elements set to the first Count elements from
values
(一个新Vector<T>,其元素设置为来自values
首批满足长度的元素).
Type Parameters
T
The vector element type (向量中的元素的类型).
Exceptions
- IndexOutOfRangeException
The
index
is less than zero (index
小于零). The length ofvalues
, starting fromindex
, is less than Count (从index
开始的values
的长度小于 Count).
CreateRotate<T>(ReadOnlySpan<T>, int, int)
Rotate creates a new Vector<T> from a given span starting at a specified index position (于指定索引位置开始,从指定跨度旋转创建一个 Vector<T>).
public static Vector<T> CreateRotate<T>(ReadOnlySpan<T> values, int index, int length) where T : struct
Parameters
values
ReadOnlySpan<T>The span from which the vector is created (用于创建向量的跨度).
index
intStarting index position of valid data in
values
(values
中有效数据的起始索引位置).length
intLength of valid data in
values
(values
中有效数据的长度).
Returns
- Vector<T>
A new Vector<T> with its elements set to the first Count elements from
values
(一个新Vector<T>,其元素设置为来自values
首批满足长度的元素).
Type Parameters
T
The vector element type (向量中的元素的类型).
Exceptions
- IndexOutOfRangeException
The
index
is less than zero (index
小于零). The length ofvalues
, starting fromindex
, is less than Count (从index
开始的values
的长度小于 Count).
CreateRotate<T>(ReadOnlySpan<T>)
public static Vector<T> CreateRotate<T>(ReadOnlySpan<T> values) where T : struct
Parameters
values
ReadOnlySpan<T>The span from which the vector is created (用于创建向量的跨度).
Returns
- Vector<T>
A new Vector<T> with its elements set to the first Count elements from
values
(一个新Vector<T>,其元素设置为来自values
首批满足长度的元素).
Type Parameters
T
The vector element type (向量中的元素的类型).
CreateRotate<T>(params T[])
public static Vector<T> CreateRotate<T>(params T[] values) where T : struct
Parameters
values
T[]The array from which the vector is created (用于创建向量的数组).
Returns
- Vector<T>
A new Vector<T> with its elements set to the first Count elements from
values
(一个新Vector<T>,其元素设置为来自values
首批满足长度的元素).
Type Parameters
T
The vector element type (向量中的元素的类型).