Table of Contents

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 int

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

length int

Length 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 of values, starting from index, 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 int

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

length int

Length 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 of values, starting from index, is less than Count (从 index 开始的 values 的长度小于 Count).

CreateRotate<T>(ReadOnlySpan<T>)

Rotate creates a new Vector<T> from a given span (从指定跨度旋转创建一个 Vector<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[])

Rotate creates a new Vector<T> from a given array (从给定数组旋转创建一个新的 Vector<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 (向量中的元素的类型).