<PackageReference Include="System.Numerics.Vectors" Version="4.4.0-preview2-25405-01" />

System.Numerics.Vector

public static class Vector
Contains various methods useful for creating, manipulating, combining, and converting generic vectors with one another.
public static bool IsHardwareAccelerated { get; }

Returns whether or not vector operations are subject to hardware acceleration through JIT intrinsic support.

public static Vector<T> Abs<T>(Vector<T> value) where T : struct

Returns a new vector whose elements are the absolute values of the given vector's elements.

public static Vector<T> Add<T>(Vector<T> left, Vector<T> right) where T : struct

Creates a new vector whose values are the sum of each pair of elements from the two given vectors.

public static Vector<T> AndNot<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a new vector by performing a bitwise-and-not operation on each of the elements in the given vectors.

public static Vector<byte> AsVectorByte<T>(Vector<T> value) where T : struct

Reinterprets the bits of the given vector into those of a vector of unsigned bytes.

public static Vector<double> AsVectorDouble<T>(Vector<T> value) where T : struct

Reinterprets the bits of the given vector into those of a vector of 64-bit floating point numbers.

public static Vector<short> AsVectorInt16<T>(Vector<T> value) where T : struct

Reinterprets the bits of the given vector into those of a vector of signed 16-bit integers.

public static Vector<int> AsVectorInt32<T>(Vector<T> value) where T : struct

Reinterprets the bits of the given vector into those of a vector of signed 32-bit integers.

public static Vector<long> AsVectorInt64<T>(Vector<T> value) where T : struct

Reinterprets the bits of the given vector into those of a vector of signed 64-bit integers.

public static Vector<sbyte> AsVectorSByte<T>(Vector<T> value) where T : struct

Reinterprets the bits of the given vector into those of a vector of signed bytes.

public static Vector<float> AsVectorSingle<T>(Vector<T> value) where T : struct

Reinterprets the bits of the given vector into those of a vector of 32-bit floating point numbers.

public static Vector<ushort> AsVectorUInt16<T>(Vector<T> value) where T : struct

Reinterprets the bits of the given vector into those of a vector of 16-bit integers.

public static Vector<uint> AsVectorUInt32<T>(Vector<T> value) where T : struct

Reinterprets the bits of the given vector into those of a vector of unsigned 32-bit integers.

public static Vector<ulong> AsVectorUInt64<T>(Vector<T> value) where T : struct

Reinterprets the bits of the given vector into those of a vector of unsigned 64-bit integers.

public static Vector<T> BitwiseAnd<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a new vector by performing a bitwise-and operation on each of the elements in the given vectors.

public static Vector<T> BitwiseOr<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a new vector by performing a bitwise-or operation on each of the elements in the given vectors.

public static Vector<float> ConditionalSelect(Vector<int> condition, Vector<float> left, Vector<float> right)

Creates a new vector with elements selected between the two given source vectors, and based on a mask vector.

public static Vector<double> ConditionalSelect(Vector<long> condition, Vector<double> left, Vector<double> right)

Creates a new vector with elements selected between the two given source vectors, and based on a mask vector.

public static Vector<T> ConditionalSelect<T>(Vector<T> condition, Vector<T> left, Vector<T> right) where T : struct

Creates a new vector with elements selected between the two given source vectors, and based on a mask vector.

public static Vector<double> ConvertToDouble(Vector<long> value)

Converts a Vector{Int64} to a Vector{Double}.

public static Vector<double> ConvertToDouble(Vector<ulong> value)

Converts a Vector{UInt64} to a Vector{Double}.

public static Vector<int> ConvertToInt32(Vector<float> value)

Converts a Vector{Single} to a Vector{Int32}.

public static Vector<long> ConvertToInt64(Vector<double> value)

Converts a Vector{Double} to a Vector{Int64}.

public static Vector<float> ConvertToSingle(Vector<int> value)

Converts a Vector{Int32} to a Vector{Single}.

public static Vector<float> ConvertToSingle(Vector<uint> value)

Converts a Vector{UInt32} to a Vector{Single}.

public static Vector<uint> ConvertToUInt32(Vector<float> value)

Converts a Vector{Single} to a Vector{UInt32}.

public static Vector<ulong> ConvertToUInt64(Vector<double> value)

Converts a Vector{Double} to a Vector{UInt64}.

public static Vector<T> Divide<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a new vector whose values are the result of dividing the first vector's elements by the corresponding elements in the second vector.

public static T Dot<T>(Vector<T> left, Vector<T> right) where T : struct

Returns the dot product of two vectors.

public static Vector<T> Equals<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a new vector whose elements signal whether the elements in left and right were equal.

public static Vector<int> Equals(Vector<float> left, Vector<float> right)

Returns an integral vector whose elements signal whether elements in the left and right floating point vectors were equal.

public static Vector<int> Equals(Vector<int> left, Vector<int> right)

Returns a new vector whose elements signal whether the elements in left and right were equal.

public static Vector<long> Equals(Vector<double> left, Vector<double> right)

Returns an integral vector whose elements signal whether elements in the left and right floating point vectors were equal.

public static Vector<long> Equals(Vector<long> left, Vector<long> right)

Returns a new vector whose elements signal whether the elements in left and right were equal.

public static bool EqualsAll<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a boolean indicating whether each pair of elements in the given vectors are equal.

public static bool EqualsAny<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a boolean indicating whether any single pair of elements in the given vectors are equal.

public static Vector<T> GreaterThan<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a new vector whose elements signal whether the elements in left were greater than their corresponding elements in right.

public static Vector<int> GreaterThan(Vector<float> left, Vector<float> right)

Returns an integral vector whose elements signal whether the elements in left were greater than their corresponding elements in right.

public static Vector<int> GreaterThan(Vector<int> left, Vector<int> right)

Returns a new vector whose elements signal whether the elements in left were greater than their corresponding elements in right.

public static Vector<long> GreaterThan(Vector<double> left, Vector<double> right)

Returns an integral vector whose elements signal whether the elements in left were greater than their corresponding elements in right.

public static Vector<long> GreaterThan(Vector<long> left, Vector<long> right)

Returns a new vector whose elements signal whether the elements in left were greater than their corresponding elements in right.

public static bool GreaterThanAll<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a boolean indicating whether all elements in left are greater than the corresponding elements in right. elements in right.

public static bool GreaterThanAny<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a boolean indicating whether any element in left is greater than its corresponding element in right.

public static Vector<T> GreaterThanOrEqual<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a new vector whose elements signal whether the elements in left were greater than or equal to their corresponding elements in right.

public static Vector<int> GreaterThanOrEqual(Vector<float> left, Vector<float> right)

Returns an integral vector whose elements signal whether the elements in left were greater than or equal to their corresponding elements in right.

public static Vector<int> GreaterThanOrEqual(Vector<int> left, Vector<int> right)

Returns a new vector whose elements signal whether the elements in left were greater than or equal to their corresponding elements in right.

public static Vector<long> GreaterThanOrEqual(Vector<long> left, Vector<long> right)

Returns a new vector whose elements signal whether the elements in left were greater than or equal to their corresponding elements in right.

public static Vector<long> GreaterThanOrEqual(Vector<double> left, Vector<double> right)

Returns an integral vector whose elements signal whether the elements in left were greater than or equal to their corresponding elements in right.

public static bool GreaterThanOrEqualAll<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a boolean indicating whether all of the elements in left are greater than or equal to their corresponding elements in right.

public static bool GreaterThanOrEqualAny<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a boolean indicating whether any element in left is greater than or equal to its corresponding element in right.

public static Vector<T> LessThan<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a new vector whose elements signal whether the elements in left were less than their corresponding elements in right.

public static Vector<int> LessThan(Vector<float> left, Vector<float> right)

Returns an integral vector whose elements signal whether the elements in left were less than their corresponding elements in right.

public static Vector<int> LessThan(Vector<int> left, Vector<int> right)

Returns a new vector whose elements signal whether the elements in left were less than their corresponding elements in right.

public static Vector<long> LessThan(Vector<double> left, Vector<double> right)

Returns an integral vector whose elements signal whether the elements in left were less than their corresponding elements in right.

public static Vector<long> LessThan(Vector<long> left, Vector<long> right)

Returns a new vector whose elements signal whether the elements in left were less than their corresponding elements in right.

public static bool LessThanAll<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a boolean indicating whether all of the elements in left are less than their corresponding elements in right.

public static bool LessThanAny<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a boolean indicating whether any element in left is less than its corresponding element in right.

public static Vector<T> LessThanOrEqual<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a new vector whose elements signal whether the elements in left were less than or equal to their corresponding elements in right.

public static Vector<int> LessThanOrEqual(Vector<float> left, Vector<float> right)

Returns an integral vector whose elements signal whether the elements in left were less than or equal to their corresponding elements in right.

public static Vector<int> LessThanOrEqual(Vector<int> left, Vector<int> right)

Returns a new vector whose elements signal whether the elements in left were less than or equal to their corresponding elements in right.

public static Vector<long> LessThanOrEqual(Vector<long> left, Vector<long> right)

Returns a new vector whose elements signal whether the elements in left were less than or equal to their corresponding elements in right.

public static Vector<long> LessThanOrEqual(Vector<double> left, Vector<double> right)

Returns an integral vector whose elements signal whether the elements in left were less than or equal to their corresponding elements in right.

public static bool LessThanOrEqualAll<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a boolean indicating whether all elements in left are less than or equal to their corresponding elements in right.

public static bool LessThanOrEqualAny<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a boolean indicating whether any element in left is less than or equal to its corresponding element in right.

public static Vector<T> Max<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a new vector whose elements are the maximum of each pair of elements in the two given vectors.

public static Vector<T> Min<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a new vector whose elements are the minimum of each pair of elements in the two given vectors.

public static Vector<T> Multiply<T>(Vector<T> left, Vector<T> right) where T : struct

Creates a new vector whose values are the product of each pair of elements from the two given vectors.

public static Vector<T> Multiply<T>(Vector<T> left, T right) where T : struct

Returns a new vector whose values are the values of the given vector each multiplied by a scalar value.

public static Vector<T> Multiply<T>(T left, Vector<T> right) where T : struct

Returns a new vector whose values are the values of the given vector each multiplied by a scalar value.

public static Vector<byte> Narrow(Vector<ushort> low, Vector<ushort> high)

Narrows two Vector{UInt16}'s into one Vector{Byte}. The first source vector, whose elements become the lower-index elements of the return value.The second source vector, whose elements become the higher-index elements of the return value.A Vector{Byte} containing elements narrowed from the source vectors.

public static Vector<ushort> Narrow(Vector<uint> low, Vector<uint> high)

Narrows two Vector{UInt32}'s into one Vector{UInt16}. The first source vector, whose elements become the lower-index elements of the return value.The second source vector, whose elements become the higher-index elements of the return value.A Vector{UInt16} containing elements narrowed from the source vectors.

public static Vector<uint> Narrow(Vector<ulong> low, Vector<ulong> high)

Narrows two Vector{UInt64}'s into one Vector{UInt32}. The first source vector, whose elements become the lower-index elements of the return value.The second source vector, whose elements become the higher-index elements of the return value.A Vector{UInt32} containing elements narrowed from the source vectors.

public static Vector<sbyte> Narrow(Vector<short> low, Vector<short> high)

Narrows two Vector{Int16}'s into one Vector{SByte}. The first source vector, whose elements become the lower-index elements of the return value.The second source vector, whose elements become the higher-index elements of the return value.A Vector{SByte} containing elements narrowed from the source vectors.

public static Vector<short> Narrow(Vector<int> low, Vector<int> high)

Narrows two Vector{Int32}'s into one Vector{Int16}. The first source vector, whose elements become the lower-index elements of the return value.The second source vector, whose elements become the higher-index elements of the return value.A Vector{Int16} containing elements narrowed from the source vectors.

public static Vector<int> Narrow(Vector<long> low, Vector<long> high)

Narrows two Vector{Int64}'s into one Vector{Int32}. The first source vector, whose elements become the lower-index elements of the return value.The second source vector, whose elements become the higher-index elements of the return value.A Vector{Int32} containing elements narrowed from the source vectors.

public static Vector<float> Narrow(Vector<double> low, Vector<double> high)

Narrows two Vector{Double}'s into one Vector{Single}. The first source vector, whose elements become the lower-index elements of the return value.The second source vector, whose elements become the higher-index elements of the return value.A Vector{Single} containing elements narrowed from the source vectors.

public static Vector<T> Negate<T>(Vector<T> value) where T : struct

Returns a new vector whose elements are the given vector's elements negated.

public static Vector<T> OnesComplement<T>(Vector<T> value) where T : struct

Returns a new vector whose elements are obtained by taking the one's complement of the given vector's elements.

public static Vector<T> SquareRoot<T>(Vector<T> value) where T : struct

Returns a new vector whose elements are the square roots of the given vector's elements.

public static Vector<T> Subtract<T>(Vector<T> left, Vector<T> right) where T : struct

Creates a new vector whose values are the difference between each pairs of elements in the given vectors.

public static void Widen(Vector<byte> source, out Vector low, out Vector high)

Widens a Vector{Byte} into two Vector{UInt16}'s. The source vector whose elements are widened into the outputs.The first output vector, whose elements will contain the widened elements from lower indices in the source vector.The second output vector, whose elements will contain the widened elements from higher indices in the source vector.

public static void Widen(Vector<ushort> source, out Vector low, out Vector high)

Widens a Vector{UInt16} into two Vector{UInt32}'s. The source vector whose elements are widened into the outputs.The first output vector, whose elements will contain the widened elements from lower indices in the source vector.The second output vector, whose elements will contain the widened elements from higher indices in the source vector.

public static void Widen(Vector<uint> source, out Vector low, out Vector high)

Widens a Vector{UInt32} into two Vector{UInt64}'s. The source vector whose elements are widened into the outputs.The first output vector, whose elements will contain the widened elements from lower indices in the source vector.The second output vector, whose elements will contain the widened elements from higher indices in the source vector.

public static void Widen(Vector<sbyte> source, out Vector low, out Vector high)

Widens a Vector{SByte} into two Vector{Int16}'s. The source vector whose elements are widened into the outputs.The first output vector, whose elements will contain the widened elements from lower indices in the source vector.The second output vector, whose elements will contain the widened elements from higher indices in the source vector.

public static void Widen(Vector<short> source, out Vector low, out Vector high)

Widens a Vector{Int16} into two Vector{Int32}'s. The source vector whose elements are widened into the outputs.The first output vector, whose elements will contain the widened elements from lower indices in the source vector.The second output vector, whose elements will contain the widened elements from higher indices in the source vector.

public static void Widen(Vector<int> source, out Vector low, out Vector high)

Widens a Vector{Int32} into two Vector{Int64}'s. The source vector whose elements are widened into the outputs.The first output vector, whose elements will contain the widened elements from lower indices in the source vector.The second output vector, whose elements will contain the widened elements from higher indices in the source vector.

public static void Widen(Vector<float> source, out Vector low, out Vector high)

Widens a Vector{Single} into two Vector{Double}'s. The source vector whose elements are widened into the outputs.The first output vector, whose elements will contain the widened elements from lower indices in the source vector.The second output vector, whose elements will contain the widened elements from higher indices in the source vector.

public static Vector<T> Xor<T>(Vector<T> left, Vector<T> right) where T : struct

Returns a new vector by performing a bitwise-exclusive-or operation on each of the elements in the given vectors.