std::valarray
De cppreference.com
[] |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody>| Dclar dans l'en-tte <valarray>
|
||
template< class T > class valarray; |
||
std::valarray est la classe qui reprsente et permet de manipuler des tableaux de valeurs. Il prend en charge des oprations mathmatiques et diverses formes d'oprateurs utilisables sur l'ensemble du tableau, sur une tranche (slice) et en accs 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.
You can help to correct and verify the translation. Click here for instructions.
Notes
Les classes std::valarray et aide sont dfinis pour tre l'abri de certaines formes de l'aliasing, ce qui permet des oprations sur ces classes d'optimiser semblable l'effet du mot-cl
restrict dans le langage de programmation C. En outre, les fonctions et les oprateurs qui prennent des arguments valarray sont autoriss retourner des objets proxy pour permettre au compilateur d'optimiser une expression telle que v1 = a*v2 + v3; comme une simple boucle qui excute v1[i] = a*v2[i] + v3[i]; viter toute temporaires ou des passes multiples. Toutefois, modles d'expression faire la mme technique d'optimisation disponibles pour chaque conteneur C + +, et la majorit des bibliothques numriques prfre modles d'expression de valarrays de flexibilit. Certaines implmentations C + + bibliothque standard utilisent des modles d'expression pour mettre en uvre des oprations efficaces sur std::valarray (par exemple libstdc + + GNU libc et LLVM + +), et rarement valarrays sont optimiss 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, modles 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.
You can help to correct and verify the translation. Click here for instructions.
Types de membres
| Type du membre | Dfinition |
value_type
|
T
|
Fonctions membres
construit une nouvelle matrice numrique 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) | |
Dtruit le tableau numrique 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) | |
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) | |
get / set lment 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) | |
applique un oprateur arithmtique unaire pour chaque lment 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) | |
s'applique oprateur d'affectation compos chaque lment 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) | |
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) | |
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) | |
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) | |
calcule la somme de tous les lments 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) | |
retourne le plus petit lment 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) | |
retourne le plus grand lment 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) | |
zro de remplissage dplacer les lments 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) | |
dcalage circulaire des lments 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) | |
| applies a function to every element of a valarray (fonction membre publique) | |
Fonctions annexes
(C++11) |
l'algorithme spcialis std::swap()Original: specializes the std::swap() algorithmThe text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction gnrique) |
(C++11) |
std::begin spcialise 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 gnrique) |
(C++11) |
std::end spcialise 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 gnrique) |
des oprateurs binaires s'applique chaque lment 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 gnrique) | |
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 gnrique) | |
applique la fonction std::abs chaque lment 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 gnrique) | |
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 lment 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 gnrique) | |
applique la fonction std::log chaque lment 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 gnrique) | |
applique la fonction std::log10 chaque lment 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 gnrique) | |
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 gnrique) | |
applique la fonction std::sqrt chaque lment 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 gnrique) | |
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 lment 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 gnrique) | |
applique la fonction std::cos chaque lment 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 gnrique) | |
applique la fonction std::tan chaque lment 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 gnrique) | |
applique la fonction std::asin chaque lment 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 gnrique) | |
applique la fonction std::acos chaque lment 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 gnrique) | |
applique la fonction std::atan chaque lment 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 gnrique) | |
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 gnrique) | |
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 lment 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 gnrique) | |
applique la fonction std::cosh chaque lment 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 gnrique) | |
applique la fonction std::tanh chaque lment 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 gnrique) | |
Classes d'aide
BLAS-like tranche d'un valarray: indice de dpart, la longueur de foule 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) | |
procuration d'un sous-ensemble d'un valarray aprs 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 gnrique) | |
tranche gnralise d'une valarray: indice de dpart, un ensemble de longueurs, jeu de progrs 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) | |
procuration d'un sous-ensemble d'un valarray aprs 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 gnrique) | |
procuration d'un sous-ensemble d'un valarray aprs l'application d'un oprateur boolen 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 gnrique) | |
procuration d'un sous-ensemble d'un valarray aprs l'application de l'oprateur 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 gnrique) | |