Table of Contents

Method CreatePadding

Namespace
Zyl.VectorTraits
Assembly
VectorTraits.dll

CreatePadding<T>(T[], int, int)

Padding creates a new Vector256<T> from a given span starting at a specified index position (于指定索引位置开始,从指定跨度补齐创建一个 Vector256<T>). The element after values is initialized to 0(values 之后的元素会初始化为0).

public static Vector256<T> CreatePadding<T>(T[] values, int index, int length) where T : struct

Parameters

values T[]

The array from which the vector is created (用于创建向量的数组).

index int

Starting index position of valid data in values (values 中有效数据的起始索引位置).

length int

Length of valid data in values (values 中有效数据的长度).

Returns

Vector256<T>

A new Vector256<T> with its elements set to the first Count elements from values (一个新Vector256<T>,其元素设置为来自values首批满足长度的元素).

Type Parameters

T

The vector element type (向量中的元素的类型).

Exceptions

IndexOutOfRangeException

The index is less than zero (index 小于零). The length of values, starting from index, is less than Count (从 index 开始的 values 的长度小于 Count).

CreatePadding<T>(ReadOnlySpan<T>, int, int)

Padding creates a new Vector256<T> from a given span starting at a specified index position (于指定索引位置开始,从指定跨度补齐创建一个 Vector256<T>). The element after values is initialized to 0(values 之后的元素会初始化为0).

public static Vector256<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 int

Starting index position of valid data in values (values 中有效数据的起始索引位置).

length int

Length of valid data in values (values 中有效数据的长度).

Returns

Vector256<T>

A new Vector256<T> with its elements set to the first Count elements from values (一个新Vector256<T>,其元素设置为来自values首批满足长度的元素).

Type Parameters

T

The vector element type (向量中的元素的类型).

Exceptions

IndexOutOfRangeException

The index is less than zero (index 小于零). The length of values, starting from index, is less than Count (从 index 开始的 values 的长度小于 Count).

CreatePadding<T>(ReadOnlySpan<T>)

Padding creates a new Vector256<T> from a given span (从指定跨度补齐创建一个 Vector256<T>). The element after values is initialized to 0(values 之后的元素会初始化为0).

public static Vector256<T> CreatePadding<T>(ReadOnlySpan<T> values) where T : struct

Parameters

values ReadOnlySpan<T>

The span from which the vector is created (用于创建向量的跨度).

Returns

Vector256<T>

A new Vector256<T> with its elements set to the first Count elements from values (一个新Vector256<T>,其元素设置为来自values首批满足长度的元素).

Type Parameters

T

The vector element type (向量中的元素的类型).

CreatePadding<T>(params T[])

Padding creates a new Vector256<T> from a given array (从给定数组补齐创建一个新的 Vector256<T> ). The element after values is initialized to 0(values 之后的元素会初始化为0).

public static Vector256<T> CreatePadding<T>(params T[] values) where T : struct

Parameters

values T[]

The array from which the vector is created (用于创建向量的数组).

Returns

Vector256<T>

A new Vector256<T> with its elements set to the first Count elements from values (一个新Vector256<T>,其元素设置为来自values首批满足长度的元素).

Type Parameters

T

The vector element type (向量中的元素的类型).