◐ Shell
clean mode source ↗

std::valarray — cppreference.com

De cppreference.com

<metanoindex/>

<tbody> </tbody>

Déclaré dans l'en-tête

<valarray>

template< class T > class valarray;

std::valarray est la classe qui représente et permet de manipuler des tableaux de valeurs. Il prend en charge des opérations mathématiques et diverses formes d'opérateurs utilisables sur l'ensemble du tableau, sur une tranche (slice) et en accès indirect .

Original:

std::valarray is the class for representing and manipulating arrays of values. It supports element-wise mathematical operations and various forms of generalized subscript operators, slicing and indirect access.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Notes

Les classes std::valarray et aide sont définis pour être à l'abri de certaines formes de l'aliasing, ce qui permet des opérations sur ces classes d'optimiser semblable à l'effet du mot-clé restrict dans le langage de programmation C. En outre, les fonctions et les opérateurs qui prennent des arguments valarray sont autorisés à retourner des objets proxy pour permettre au compilateur d'optimiser une expression telle que v1 = a*v2 + v3; comme une simple boucle qui exécute v1[i] = a*v2[i] + v3[i]; éviter toute temporaires ou des passes multiples. Toutefois, modèles d'expression faire la même technique d'optimisation disponibles pour chaque conteneur C + +, et la majorité des bibliothèques numériques préfère modèles d'expression de valarrays de flexibilité. Certaines implémentations C + + bibliothèque standard utilisent des modèles d'expression pour mettre en œuvre des opérations efficaces sur std::valarray (par exemple libstdc + + GNU libc et LLVM + +), et rarement valarrays sont optimisés plus loin, par exemple, dans Intel Parallel Studio .

Original:

std::valarray and helper classes are defined to be free of certain forms of aliasing, thus allowing operations on these classes to be optimized similar to the effect of the keyword restrict in the C programming language. In addition, functions and operators that take valarray arguments are allowed to return proxy objects to make it possible for the compiler to optimize an expression such as v1 = a*v2 + v3; as a single loop that executes v1[i] = a*v2[i] + v3[i]; avoiding any temporaries or multiple passes. However, modèles d'expression make the same optimization technique available for any C++ container, and the majority of numeric libraries prefer expression templates to valarrays for flexibility. Some C++ standard library implementations use expression templates to implement efficient operations on std::valarray (e.g. GNU libstdc++ and LLVM libc++), and only rarely valarrays are optimized any further, e.g. in Intel Parallel Studio.

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Types de membres

Type du membre Définition
value_type T

Fonctions membres

construit une nouvelle matrice numérique

Original:

constructs new numeric array

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

Détruit le tableau numérique

Original:

destructs the numeric array

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

affecte le contenu

Original:

assigns the contents

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

get / set élément valarray, tranche, ou un masque

Original:

get/set valarray element, slice, or mask

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

applique un opérateur arithmétique unaire pour chaque élément de la valarray

Original:

applies a unary arithmetic operator to each element of the valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

s'applique opérateur d'affectation composé à chaque élément de la valarray

Original:

applies compound assignment operator to each element of the valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

swaps avec une autre valarray

Original:

swaps with another valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

renvoie la taille du valarray

Original:

returns the size of valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

modifie la taille du valarray

Original:

changes the size of valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

calcule la somme de tous les éléments

Original:

calculates the sum of all elements

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

retourne le plus petit élément

Original:

returns the smallest element

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

retourne le plus grand élément

Original:

returns the largest element

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

zéro de remplissage déplacer les éléments de la valarray

Original:

zero-filling shift the elements of the valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]

décalage circulaire des éléments de la valarray

Original:

circular shift of the elements of the valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction membre publique) [edit]
applies a function to every element of a valarray
(fonction membre publique) [edit]

Fonctions annexes

l'algorithme spécialisé std::swap()

Original:

specializes the std::swap() algorithm

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

std::begin spécialisée

Original:

specializes std::begin

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

std::end spécialisée

Original:

specializes std::end

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

des opérateurs binaires s'applique à chaque élément de valarrays deux, ou un valarray et une valeur

Original:

applies binary operators to each element of two valarrays, or a valarray and a value

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

compare deux valarrays ou un valarray avec une valeur

Original:

compares two valarrays or a valarray with a value

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

applique la fonction std::abs à chaque élément de valarray

Original:

applies the function std::abs to each element of valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

Les fonctions exponentielles

Original:

Exponential functions

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

applique la fonction std::exp à chaque élément de valarray

Original:

applies the function std::exp to each element of valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

applique la fonction std::log à chaque élément de valarray

Original:

applies the function std::log to each element of valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

applique la fonction std::log10 à chaque élément de valarray

Original:

applies the function std::log10 to each element of valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

Les fonctions de puissance

Original:

Power functions

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

applique la fonction à deux std::pow valarrays ou un valarray et une valeur

Original:

applies the function std::pow to two valarrays or a valarray and a value

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

applique la fonction std::sqrt à chaque élément de valarray

Original:

applies the function std::sqrt to each element of valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

Les fonctions trigonométriques

Original:

Trigonometric functions

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

applique la fonction std::sin à chaque élément de valarray

Original:

applies the function std::sin to each element of valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

applique la fonction std::cos à chaque élément de valarray

Original:

applies the function std::cos to each element of valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

applique la fonction std::tan à chaque élément de valarray

Original:

applies the function std::tan to each element of valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

applique la fonction std::asin à chaque élément de valarray

Original:

applies the function std::asin to each element of valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

applique la fonction std::acos à chaque élément de valarray

Original:

applies the function std::acos to each element of valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

applique la fonction std::atan à chaque élément de valarray

Original:

applies the function std::atan to each element of valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

applique la fonction de std::atan2 un valarray et une valeur

Original:

applies the function std::atan2 to a valarray and a value

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

Fonctions hyperboliques

Original:

Hyperbolic functions

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

applique la fonction std::sinh à chaque élément de valarray

Original:

applies the function std::sinh to each element of valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

applique la fonction std::cosh à chaque élément de valarray

Original:

applies the function std::cosh to each element of valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

applique la fonction std::tanh à chaque élément de valarray

Original:

applies the function std::tanh to each element of valarray

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(fonction générique) [edit]

Classes d'aide

BLAS-like tranche d'un valarray: indice de départ, la longueur de foulée

Original:

BLAS-like slice of a valarray: starting index, length, stride

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(classe) [edit]

procuration d'un sous-ensemble d'un valarray après l'application d'une tranche

Original:

proxy to a subset of a valarray after applying a slice

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(classe générique) [edit]

tranche généralisée d'une valarray: indice de départ, un ensemble de longueurs, jeu de progrès

Original:

generalized slice of a valarray: starting index, set of lengths, set of strides

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(classe) [edit]

procuration d'un sous-ensemble d'un valarray après l'application d'une GSlice

Original:

proxy to a subset of a valarray after applying a gslice

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(classe générique) [edit]

procuration d'un sous-ensemble d'un valarray après l'application d'un opérateur booléen masque []

Original:

proxy to a subset of a valarray after applying a boolean mask operator[]

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(classe générique) [edit]

procuration d'un sous-ensemble d'un valarray après l'application de l'opérateur indirect []

Original:

proxy to a subset of a valarray after applying indirect operator[]

The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.


(classe générique) [edit]