Vector<T> Structure
Définition
Représente un vecteur unique d'un type numérique spécifié qui convient à l'optimisation de bas niveau des algorithmes parallèles.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
Paramètres de type
- T
Type de vecteur.The vector type. T
peut être n’importe quel type numérique primitif.T
can be any primitive numeric type.
- Héritage
- Implémente
Remarques
Vector<T> est une structure immuable qui représente un vecteur unique d’un type numérique spécifié.Vector<T> is an immutable structure that represents a single vector of a specified numeric type. Le nombre d’une instance Vector<T> est fixe, mais sa limite supérieure est dépendante du registre de l’UC.The count of a Vector<T> instance is fixed, but its upper limit is CPU-register dependent. Il est destiné à être utilisé comme un bloc de construction pour vectoriser des algorithmes volumineux.It is intended to be used as a building block for vectorizing large algorithms.
La structure Vector<T> assure la prise en charge de l’accélération matérielle.The Vector<T> structure provides support for hardware acceleration.
Le tableau suivant montre le type de données numérique primitif et la combinaison d’opérations qui utilisent des instructions intrinsèques pour accélérer les exécutions :The following table shows which primitive numeric data type and operation combination uses intrinsic instructions for faster executions:
Type primitifPrimitive type | + |
- |
* |
/ |
---|---|---|---|---|
sbyte |
OuiYes | OuiYes | NonNo | NonNo |
byte |
OuiYes | OuiYes | NonNo | NonNo |
short |
OuiYes | OuiYes | OuiYes | NonNo |
ushort |
OuiYes | OuiYes | NonNo | NonNo |
int |
OuiYes | OuiYes | OuiYes | NonNo |
uint |
OuiYes | OuiYes | NonNo | NonNo |
long |
OuiYes | OuiYes | NonNo | NonNo |
ulong |
OuiYes | OuiYes | NonNo | NonNo |
float |
OuiYes | OuiYes | OuiYes | OuiYes |
double |
OuiYes | OuiYes | OuiYes | OuiYes |
Constructeurs
Vector<T>(ReadOnlySpan<Byte>) |
Construit un vecteur à partir de la plage d’octets en lecture seule donnée.Constructs a vector from the given read-only span of bytes. |
Vector<T>(ReadOnlySpan<T>) |
Construit un vecteur à partir de la ReadOnlySpan<T> donnée.Constructs a vector from the given ReadOnlySpan<T>. |
Vector<T>(Span<T>) |
Construit un vecteur à partir de la Span<T> donnée.Constructs a vector from the given Span<T>. |
Vector<T>(T) |
Crée un vecteur dont les composants sont d'un type spécifié.Creates a vector whose components are of a specified type. |
Vector<T>(T[]) |
Crée un vecteur à partir d'un tableau spécifié.Creates a vector from a specified array. |
Vector<T>(T[], Int32) |
Crée un vecteur à partir d'un tableau spécifié en commençant à la position d'index spécifiée.Creates a vector from a specified array starting at a specified index position. |
Propriétés
Count |
Retourne le nombre d'éléments stockés dans le vecteur.Returns the number of elements stored in the vector. |
Item[Int32] |
Obtient l'élément au niveau d'un index spécifié.Gets the element at a specified index. |
One |
Retourne un vecteur contenant uniquement des 1.Returns a vector containing all ones. |
Zero |
Retourne un vecteur contenant uniquement des 0.Returns a vector containing all zeroes. |
Méthodes
CopyTo(Span<Byte>) |
Copie le vecteur dans la Span<T> donnée.Copies the vector to the given Span<T>. |
CopyTo(Span<T>) |
Copie le vecteur dans la plage donnée.Copies the vector to the given span. .. |
CopyTo(T[]) |
Copie l'instance de vecteur dans un tableau de destination spécifié.Copies the vector instance to a specified destination array. |
CopyTo(T[], Int32) |
Copie l'instance de vecteur dans un tableau de destination spécifié, en commençant à une position d'index spécifiée.Copies the vector instance to a specified destination array starting at a specified index position. |
Equals(Object) |
Retourne une valeur qui indique si cette instance est égale à un objet spécifié.Returns a value that indicates whether this instance is equal to a specified object. |
Equals(Vector<T>) |
Retourne une valeur qui indique si cette instance est égale à un vecteur spécifié.Returns a value that indicates whether this instance is equal to a specified vector. |
GetHashCode() |
Retourne le code de hachage de cette instance.Returns the hash code for this instance. |
ToString() |
Retourne la représentation sous forme de chaîne de ce vecteur en utilisant la mise en forme par défaut.Returns the string representation of this vector using default formatting. |
ToString(String) |
Retourne la représentation sous forme de chaîne de ce vecteur en utilisant la chaîne de format spécifiée pour mettre en forme les éléments individuels.Returns the string representation of this vector using the specified format string to format individual elements. |
ToString(String, IFormatProvider) |
Retourne la représentation sous forme de chaîne de ce vecteur en utilisant la chaîne de format spécifiée pour mettre en forme les éléments individuels et le fournisseur de format spécifié pour définir la mise en forme spécifique à la culture.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. |
TryCopyTo(Span<Byte>) |
Tente de copier le vecteur vers la plage d’octets donnée.Attempts to copy the vector to the given byte span. |
TryCopyTo(Span<T>) |
Tente de copier le vecteur vers la Span<T> donnée.Attempts to copy the vector to the given Span<T>. |
Opérateurs
Addition(Vector<T>, Vector<T>) |
Additionne deux vecteurs.Adds two vectors together. |
BitwiseAnd(Vector<T>, Vector<T>) |
Retourne un nouveau vecteur en effectuant une opération |
BitwiseOr(Vector<T>, Vector<T>) |
Retourne un nouveau vecteur en effectuant une opération |
Division(Vector<T>, Vector<T>) |
Divise le premier vecteur par le deuxième.Divides the first vector by the second. |
Equality(Vector<T>, Vector<T>) |
Retourne une valeur qui indique si chacune des paires d'éléments dans deux vecteurs spécifiés sont égales.Returns a value that indicates whether each pair of elements in two specified vectors are equal. |
ExclusiveOr(Vector<T>, Vector<T>) |
Retourne un nouveau vecteur en effectuant une opération |
Explicit(Vector<T> to Vector<Byte>) |
Réinterprète les bits du vecteur spécifié dans un vecteur de type Byte.Reinterprets the bits of the specified vector into a vector of type Byte. |
Explicit(Vector<T> to Vector<Double>) |
Réinterprète les bits du vecteur spécifié dans un vecteur de type Double.Reinterprets the bits of the specified vector into a vector of type Double. |
Explicit(Vector<T> to Vector<Int16>) |
Réinterprète les bits du vecteur spécifié dans un vecteur de type Int16.Reinterprets the bits of the specified vector into a vector of type Int16. |
Explicit(Vector<T> to Vector<Int32>) |
Réinterprète les bits du vecteur spécifié dans un vecteur de type Int32.Reinterprets the bits of the specified vector into a vector of type Int32. |
Explicit(Vector<T> to Vector<Int64>) |
Réinterprète les bits du vecteur spécifié dans un vecteur de type Int64.Reinterprets the bits of the specified vector into a vector of type Int64. |
Explicit(Vector<T> to Vector<SByte>) |
Réinterprète les bits du vecteur spécifié dans un vecteur de type SByte.Reinterprets the bits of the specified vector into a vector of type SByte. |
Explicit(Vector<T> to Vector<Single>) |
Réinterprète les bits du vecteur spécifié dans un vecteur de type Single.Reinterprets the bits of the specified vector into a vector of type Single. |
Explicit(Vector<T> to Vector<UInt16>) |
Réinterprète les bits du vecteur spécifié dans un vecteur de type UInt16.Reinterprets the bits of the specified vector into a vector of type UInt16. |
Explicit(Vector<T> to Vector<UInt32>) |
Réinterprète les bits du vecteur spécifié dans un vecteur de type UInt32.Reinterprets the bits of the specified vector into a vector of type UInt32. |
Explicit(Vector<T> to Vector<UInt64>) |
Réinterprète les bits du vecteur spécifié dans un vecteur de type UInt64.Reinterprets the bits of the specified vector into a vector of type UInt64. |
Inequality(Vector<T>, Vector<T>) |
Retourne une valeur qui indique si au moins deux paires d'éléments dans les vecteurs spécifiés sont égales.Returns a value that indicates whether any single pair of elements in the specified vectors is equal. |
Multiply(T, Vector<T>) |
Multiplie un vecteur par une valeur scalaire spécifiée.Multiplies a vector by a specified scalar value. |
Multiply(Vector<T>, T) |
Multiplie un vecteur par une valeur scalaire spécifiée.Multiplies a vector by a specified scalar value. |
Multiply(Vector<T>, Vector<T>) |
Retourne un nouveau vecteur dont les valeurs sont le produit de chaque paire d'éléments dans deux vecteurs spécifiés.Returns a new vector whose values are the product of each pair of elements in two specified vectors. |
OnesComplement(Vector<T>) |
Retourne un nouveau vecteur dont les éléments sont obtenus en prenant le complément des éléments d'un vecteur spécifié.Returns a new vector whose elements are obtained by taking the one's complement of a specified vector's elements. |
Subtraction(Vector<T>, Vector<T>) |
Soustrait le deuxième vecteur du premier.Subtracts the second vector from the first. |
UnaryNegation(Vector<T>) |
Inverse un vecteur donné.Negates a given vector. |