Vector512.WithElement<T>(Vector512<T>, Int32, T) Method

Definition

Creates a new Vector512<T> with the element at the specified index set to the specified value and the remaining elements set to the same value as that in the given vector.

public static System.Runtime.Intrinsics.Vector512<T> WithElement<T> (this System.Runtime.Intrinsics.Vector512<T> vector, int index, T value);

Type Parameters

T

The type of the input vector.

Parameters

vector
Vector512<T>

The vector to get the remaining elements from.

index
Int32

The index of the element to set.

value
T

The value to set the element to.

Returns

A Vector512<T> with the value of the element at index set to value and the remaining elements set to the same value as that in vector.

Exceptions

index was less than zero or greater than the number of elements.

The type of vector (T) is not supported.

Applies to

Product Versions
.NET 8, 9