Vector<T> Structure

Represents a single vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms.

Namespace:  System.Numerics
Assembly:  System.Numerics.Vectors (in System.Numerics.Vectors.dll)

public struct Vector<T> : IEquatable<Vector<T>>, 
	IFormattable 
where T : struct

Type Parameters

T

The vector type. T can be any primitive numeric type.

The Vector<T> type exposes the following members.

  NameDescription
Public methodVector<T>(T)Creates a vector whose components are of a specified type.
Public methodVector<T>(T[])Creates a vector from a specified array.
Public methodVector<T>(T[], Int32)Creates a vector from a specified array starting at a specified index position.
Top

  NameDescription
Public propertyStatic memberCountReturns the number of elements stored in the vector.
Public propertyItemGets the element at a specified index.
Public propertyStatic memberOneReturns a vector containing all ones.
Public propertyStatic memberZeroReturns a vector containing all zeroes.
Top

  NameDescription
Public methodCopyTo(T[])Copies the vector instance to a specified destination array.
Public methodCopyTo(T[], Int32)Copies the vector instance to a specified destination array starting at a specified index position.
Public methodEquals(Object)Returns a value that indicates whether this instance is equal to a specified object. (Overrides ValueType.Equals(Object).)
Public methodEquals(Vector<T>)Returns a value that indicates whether this instance is equal to a specified vector.
Public methodGetHashCodeReturns the hash code for this instance. (Overrides ValueType.GetHashCode().)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodToString()Returns the string representation of this vector using default formatting. (Overrides ValueType.ToString().)
Public methodToString(String)Returns the string representation of this vector using the specified format string to format individual elements.
Public methodToString(String, IFormatProvider)Returns the string representation of this vector using the specified format string to format individual elements and the specified format provider to define culture-specific formatting.
Top

  NameDescription
Public operatorStatic memberAdditionAdds two vectors together.
Public operatorStatic memberBitwiseAndReturns a new vector by performing a bitwise And operation on each of the elements in two vectors.
Public operatorStatic memberBitwiseOrReturns a new vector by performing a bitwise Or operation on each of the elements in two vectors.
Public operatorStatic memberDivisionDivides the first vector by the second.
Public operatorStatic memberEqualityReturns a value that indicates whether each pair of elements in two specified vectors are equal.
Public operatorStatic memberExclusiveOrReturns a new vector by performing a bitwise XOr operation on each of the elements in two vectors.
Public operatorStatic memberExplicit(Vector<T> to Vector<Double>)Reinterprets the bits of the specified vector into a vector of type Double.
Public operatorStatic memberExplicit(Vector<T> to Vector<SByte>)Reinterprets the bits of the specified vector into a vector of type SByte.
Public operatorStatic memberExplicit(Vector<T> to Vector<Single>)Reinterprets the bits of the specified vector into a vector of type Single.
Public operatorStatic memberExplicit(Vector<T> to Vector<Int16>)Reinterprets the bits of the specified vector into a vector of type Int16.
Public operatorStatic memberExplicit(Vector<T> to Vector<UInt16>)Reinterprets the bits of the specified vector into a vector of type UInt16.
Public operatorStatic memberExplicit(Vector<T> to Vector<Byte>)Reinterprets the bits of the specified vector into a vector of type Byte.
Public operatorStatic memberExplicit(Vector<T> to Vector<UInt32>)Reinterprets the bits of the specified vector into a vector of type UInt32.
Public operatorStatic memberExplicit(Vector<T> to Vector<Int64>)Reinterprets the bits of the specified vector into a vector of type Int64.
Public operatorStatic memberExplicit(Vector<T> to Vector<UInt64>)Reinterprets the bits of the specified vector into a vector of type UInt64.
Public operatorStatic memberExplicit(Vector<T> to Vector<Int32>)Reinterprets the bits of the specified vector into a vector of type Int32.
Public operatorStatic memberInequalityReturns a value that indicates whether any single pair of elements in the specified vectors is equal.
Public operatorStatic memberMultiply(T, Vector<T>)Multiplies a vector by the given scalar.
Public operatorStatic memberMultiply(Vector<T>, Vector<T>)Multiplies two vectors together.
Public operatorStatic memberMultiply(Vector<T>, T)Multiplies a vector by a specified scalar value.
Public operatorStatic memberOnesComplementReturns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements.
Public operatorStatic memberSubtractionSubtracts the second vector from the first.
Public operatorStatic memberUnaryNegationNegates a given vector.
Top

Vector<T> is an immutable structure that represents a single vector of a specified numeric type. The count of a Vector<T> instance is fixed, but its upper limit is CPU-register dependent. It is intended to be used as a building block for vectorizing large algorithms.

The Vector<T> structure provides support for hardware acceleration.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show: