<PackageReference Include="System.Numerics.Vectors" Version="4.3.0" />

System.Numerics.Vector<T>

public struct Vector<T> : IEquatable<Vector<T>>, IFormattable where T : struct
A structure that represents a single Vector. The count of this Vector is fixed but CPU register dependent. This struct only supports numerical types. This type is intended to be used as a building block for vectorizing large algorithms. This type is immutable, individual elements cannot be modified.
public static int Count { get; }

Returns the number of elements stored in the vector. This value is hardware dependent.

public static Vector<T> One { get; }

Returns a vector containing all ones.

public static Vector<T> Zero { get; }

Returns a vector containing all zeroes.

public T this[int index] { get; }

Returns the element at the given index.

public Vector(T value)

Constructs a vector whose components are all value

public Vector(T[] values)

Constructs a vector from the given array. The size of the given array must be at least Vector'T.Count.

public Vector(T[] values, int index)

Constructs a vector from the given array, starting from the given index. The array must contain at least Vector'T.Count from the given index.

public static Vector<T> op_Addition(Vector<T> left, Vector<T> right)

Adds two vectors together.

public static Vector<T> op_BitwiseAnd(Vector<T> left, Vector<T> right)

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

public static Vector<T> op_BitwiseOr(Vector<T> left, Vector<T> right)

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

public static Vector<T> op_Division(Vector<T> left, Vector<T> right)

Divides the first vector by the second.

public static bool op_Equality(Vector<T> left, Vector<T> right)

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

public static Vector<T> op_ExclusiveOr(Vector<T> left, Vector<T> right)

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

public static Vector<byte> op_Explicit(Vector<T> value)

Reinterprets the bits of the given vector into those of another type.

public static Vector<sbyte> op_Explicit(Vector<T> value)

Reinterprets the bits of the given vector into those of another type.

public static Vector<ushort> op_Explicit(Vector<T> value)

Reinterprets the bits of the given vector into those of another type.

public static Vector<short> op_Explicit(Vector<T> value)

Reinterprets the bits of the given vector into those of another type.

public static Vector<uint> op_Explicit(Vector<T> value)

Reinterprets the bits of the given vector into those of another type.

public static Vector<int> op_Explicit(Vector<T> value)

Reinterprets the bits of the given vector into those of another type.

public static Vector<ulong> op_Explicit(Vector<T> value)

Reinterprets the bits of the given vector into those of another type.

public static Vector<long> op_Explicit(Vector<T> value)

Reinterprets the bits of the given vector into those of another type.

public static Vector<float> op_Explicit(Vector<T> value)

Reinterprets the bits of the given vector into those of another type.

public static Vector<double> op_Explicit(Vector<T> value)

Reinterprets the bits of the given vector into those of another type.

public static bool op_Inequality(Vector<T> left, Vector<T> right)

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

public static Vector<T> op_Multiply(Vector<T> left, Vector<T> right)

Multiplies two vectors together.

public static Vector<T> op_Multiply(Vector<T> value, T factor)

Multiplies a vector by the given scalar.

public static Vector<T> op_Multiply(T factor, Vector<T> value)

Multiplies a vector by the given scalar.

public static Vector<T> op_OnesComplement(Vector<T> value)

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

public static Vector<T> op_Subtraction(Vector<T> left, Vector<T> right)

Subtracts the second vector from the first.

public static Vector<T> op_UnaryNegation(Vector<T> value)

Negates a given vector.

public void CopyTo(T[] destination)

Copies the vector to the given destination array. The destination array must be at least size Vector'T.Count.

public void CopyTo(T[] destination, int startIndex)

Copies the vector to the given destination array. The destination array must be at least size Vector'T.Count.

public bool Equals(Vector<T> other)

Returns a boolean indicating whether the given vector is equal to this vector instance.

public string ToString(string format)

Returns a String representing this vector, using the specified format string to format individual elements.

public string ToString(string format, IFormatProvider formatProvider)

Returns a String representing this vector, using the specified format string to format individual elements and the given IFormatProvider.