Vector.Create Method

Definition

Overloads

Create<T>(T)

Creates a new Vector<T> instance with all elements initialized to the specified value.

Create<T>(ReadOnlySpan<T>)

Creates a new Vector<T> from a given readonly span.

Create<T>(T)

Creates a new Vector<T> instance with all elements initialized to the specified value.

C#
public static System.Numerics.Vector<T> Create<T>(T value);

Type Parameters

T

The type of the elements in the vector.

Parameters

value
T

The value that all elements will be initialized to.

Returns

A new Vector<T> with all elements initialized to value.

Exceptions

The type of value (T) is not supported.

Applies to

.NET 9
Product Versions
.NET 9

Create<T>(ReadOnlySpan<T>)

Creates a new Vector<T> from a given readonly span.

C#
public static System.Numerics.Vector<T> Create<T>(ReadOnlySpan<T> values);

Type Parameters

T

The type of the elements in the vector.

Parameters

values
ReadOnlySpan<T>

The readonly span from which the vector is created.

Returns

A new Vector<T> with its elements set to the first Count elements from values.

Exceptions

The length of values is less than Count.

The type of values (T) is not supported.

Applies to

.NET 9
Product Versions
.NET 9