# Vector<T> Struktura

## Definice

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

``````generic <typename T>
where T : value classpublic value class Vector : IEquatable<System::Numerics::Vector<T>>, IFormattable``````
``public struct Vector<T> : IEquatable<System.Numerics.Vector<T>>, IFormattable where T : struct``
``````type Vector<'T (requires 'T : struct)> = struct
interface IFormattable``````
``````Public Structure Vector(Of T)
Implements IEquatable(Of Vector(Of T)), IFormattable``````

#### Parametry typu

T

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

Dědičnost
Vector<T>
Implementuje

## Poznámky

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

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

The term 'primitive numeric data type' in this document refers to numeric data types that are directly supported by the CPU and have instructions that can manipulate those data types.The term 'primitive numeric data type' in this document refers to numeric data types that are directly supported by the CPU and have instructions that can manipulate those data types. The following table shows which primitive numeric data type and operation combination uses intrinsic instructions for faster executions:The following table shows which primitive numeric data type and operation combination uses intrinsic instructions for faster executions:

Primitive typePrimitive type `+` `-` `*` `/`
`sbyte` AnoYes AnoYes NeNo NeNo
`byte` AnoYes AnoYes NeNo NeNo
`short` AnoYes AnoYes AnoYes NeNo
`ushort` AnoYes AnoYes NeNo NeNo
`int` AnoYes AnoYes AnoYes NeNo
`uint` AnoYes AnoYes NeNo NeNo
`long` AnoYes AnoYes NeNo NeNo
`ulong` AnoYes AnoYes NeNo NeNo
`float` AnoYes AnoYes AnoYes AnoYes
`double` AnoYes AnoYes AnoYes AnoYes

## Konstruktory

 Constructs a vector from the given read-only span of bytes.Constructs a vector from the given read-only span of bytes. Constructs a vector from the given ReadOnlySpan.Constructs a vector from the given ReadOnlySpan. Constructs a vector from the given Span.Constructs a vector from the given Span. Creates a vector whose components are of a specified type.Creates a vector whose components are of a specified type. Creates a vector from a specified array.Creates a vector from a specified array. Creates a vector from a specified array starting at a specified index position.Creates a vector from a specified array starting at a specified index position.

## Vlastnosti

 Returns the number of elements stored in the vector.Returns the number of elements stored in the vector. Gets the element at a specified index.Gets the element at a specified index. Returns a vector containing all ones.Returns a vector containing all ones. Returns a vector containing all zeroes.Returns a vector containing all zeroes.

## Metody

 Copies the vector to the given Span.Copies the vector to the given Span. Copies the vector to the given span.Copies the vector to the given span. .. Copies the vector instance to a specified destination array.Copies the vector instance to a specified destination array. Copies the vector instance to a specified destination array starting at a specified index position.Copies the vector instance to a specified destination array starting at a specified index position. Vrací hodnotu, která určuje, zda je tato instance rovna zadanému objektu.Returns a value that indicates whether this instance is equal to a specified object. Returns a value that indicates whether this instance is equal to a specified vector.Returns a value that indicates whether this instance is equal to a specified vector. Vrátí kód hash této instance.Returns the hash code for this instance. Returns the string representation of this vector using default formatting.Returns the string representation of this vector using default formatting. Returns the string representation of this vector using the specified format string to format individual elements.Returns the string representation of this vector using the specified format string to format individual elements. 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.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. Attempts to copy the vector to the given byte span.Attempts to copy the vector to the given byte span. Attempts to copy the vector to the given Span.Attempts to copy the vector to the given Span.

## Operátory

 Adds two vectors together.Adds two vectors together. Returns a new vector by performing a bitwise `And` operation on each of the elements in two vectors.Returns a new vector by performing a bitwise `And` operation on each of the elements in two vectors. Returns a new vector by performing a bitwise `Or` operation on each of the elements in two vectors.Returns a new vector by performing a bitwise `Or` operation on each of the elements in two vectors. Divides the first vector by the second.Divides the first vector by the second. Returns a value that indicates whether each pair of elements in two specified vectors are equal.Returns a value that indicates whether each pair of elements in two specified vectors are equal. Returns a new vector by performing a bitwise `XOr` operation on each of the elements in two vectors.Returns a new vector by performing a bitwise `XOr` operation on each of the elements in two vectors. Reinterprets the bits of the specified vector into a vector of type Byte.Reinterprets the bits of the specified vector into a vector of type Byte. Reinterprets the bits of the specified vector into a vector of type Double.Reinterprets the bits of the specified vector into a vector of type Double. Reinterprets the bits of the specified vector into a vector of type Int16.Reinterprets the bits of the specified vector into a vector of type Int16. Reinterprets the bits of the specified vector into a vector of type Int32.Reinterprets the bits of the specified vector into a vector of type Int32. Reinterprets the bits of the specified vector into a vector of type Int64.Reinterprets the bits of the specified vector into a vector of type Int64. Reinterprets the bits of the specified vector into a vector of type SByte.Reinterprets the bits of the specified vector into a vector of type SByte. Reinterprets the bits of the specified vector into a vector of type Single.Reinterprets the bits of the specified vector into a vector of type Single. Reinterprets the bits of the specified vector into a vector of type UInt16.Reinterprets the bits of the specified vector into a vector of type UInt16. Reinterprets the bits of the specified vector into a vector of type UInt32.Reinterprets the bits of the specified vector into a vector of type UInt32. Reinterprets the bits of the specified vector into a vector of type UInt64.Reinterprets the bits of the specified vector into a vector of type UInt64. Returns a value that indicates whether any single pair of elements in the specified vectors is equal.Returns a value that indicates whether any single pair of elements in the specified vectors is equal. Multiplies a vector by a specified scalar value.Multiplies a vector by a specified scalar value. Multiplies a vector by a specified scalar value.Multiplies a vector by a specified scalar value. Returns a new vector whose values are the product of each pair of elements in two specified vectors.Returns a new vector whose values are the product of each pair of elements in two specified vectors. Returns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements.Returns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements. Subtracts the second vector from the first.Subtracts the second vector from the first. Negates a given vector.Negates a given vector.