Method CreatePadding
- Namespace
- Zyl.VectorTraits
- Assembly
- VectorTraits.dll
CreatePadding<T>(T[], int, int)
Padding creates a new Vector512<T> from a given span starting at a specified index position (于指定索引位置开始,从指定跨度补齐创建一个 Vector512<T>). The element after values is initialized to 0(values 之后的元素会初始化为0).
public static Vector512<T> CreatePadding<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
- Vector512<T>
A new Vector512<T> with its elements set to the first Count elements from
values
(一个新Vector512<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).
CreatePadding<T>(ReadOnlySpan<T>, int, int)
Padding creates a new Vector512<T> from a given span starting at a specified index position (于指定索引位置开始,从指定跨度补齐创建一个 Vector512<T>). The element after values is initialized to 0(values 之后的元素会初始化为0).
public static Vector512<T> CreatePadding<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
- Vector512<T>
A new Vector512<T> with its elements set to the first Count elements from
values
(一个新Vector512<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).
CreatePadding<T>(ReadOnlySpan<T>)
Padding creates a new Vector512<T> from a given span (从指定跨度补齐创建一个 Vector512<T>). The element after values is initialized to 0(values 之后的元素会初始化为0).
public static Vector512<T> CreatePadding<T>(ReadOnlySpan<T> values) where T : struct
Parameters
values
ReadOnlySpan<T>The span from which the vector is created (用于创建向量的跨度).
Returns
- Vector512<T>
A new Vector512<T> with its elements set to the first Count elements from
values
(一个新Vector512<T>,其元素设置为来自values
首批满足长度的元素).
Type Parameters
T
The vector element type (向量中的元素的类型).
CreatePadding<T>(params T[])
Padding creates a new Vector512<T> from a given array (从给定数组补齐创建一个新的 Vector512<T> ). The element after values is initialized to 0(values 之后的元素会初始化为0).
public static Vector512<T> CreatePadding<T>(params T[] values) where T : struct
Parameters
values
T[]The array from which the vector is created (用于创建向量的数组).
Returns
- Vector512<T>
A new Vector512<T> with its elements set to the first Count elements from
values
(一个新Vector512<T>,其元素设置为来自values
首批满足长度的元素).
Type Parameters
T
The vector element type (向量中的元素的类型).