Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Defines the class template valarray<Type> and several supporting class templates and functions.
Requirements
Header: <valarray>
Namespace: std
Note
The <valarray> library uses the #include <initializer_list> statement.
Remarks
These class templates and functions are permitted unusual latitude in the interest of improved performance. Specifically, any function that returns type valarray<T1> may return an object of some other type T2. In that case, any function that accepts one or more arguments of type valarray<T2> must have overloads that accept arbitrary combinations of those arguments, each replaced with an argument of type T2.
Members
Functions
| Name | Description | 
|---|---|
| abs | Operates on the elements of an input valarray, returning avalarraywhose elements are equal to the absolute value of the elements of the inputvalarray. | 
| acos | Operates on the elements of an input valarray, returning avalarraywhose elements are equal to the arccosine of the elements of the inputvalarray. | 
| asin | Operates on the elements of an input valarray, returning avalarraywhose elements are equal to the arcsine of the elements of the inputvalarray. | 
| atan | Operates on the elements of an input valarray, returning avalarraywhose elements are equal to the principal value of the arctangent of the elements of the inputvalarray. | 
| atan2 | Returns a valarraywhose elements are equal to the arctangent of the Cartesian components specified by a combination of constants and elements ofvalarrayinputs. | 
| begin | |
| cos | Operates on the elements of an input valarray, returning avalarraywhose elements are equal to the cosine of the elements of the inputvalarray. | 
| cosh | Operates on the elements of an input valarray, returning avalarraywhose elements are equal to the hyperbolic cosine of the elements of the inputvalarray. | 
| end | |
| exp | Operates on the elements of an input valarray, returning avalarraywhose elements are equal to the natural exponential of the elements of the inputvalarray. | 
| log | Operates on the elements of an input valarray, returning avalarraywhose elements are equal to the natural logarithm of the elements of the inputvalarray. | 
| log10 | Operates on the elements of an input valarray, returning avalarraywhose elements are equal to the base 10 or common logarithm of the elements of the inputvalarray. | 
| pow | Operates on the elements of any input valarrayand constants, returning avalarraywhose elements are equal to a base specified either by the elements of an inputvalarrayor a constant raised to an exponent specified either by the elements of an inputvalarrayor a constant. | 
| sin | Operates on the elements of an input valarray, returning avalarraywhose elements are equal to the sine of the elements of the inputvalarray. | 
| sinh | Operates on the elements of an input valarray, returning avalarraywhose elements are equal to the hyperbolic sine of the elements of the inputvalarray. | 
| sqrt | Operates on the elements of an input valarray, returning avalarraywhose elements are equal to the square root of the elements of the inputvalarray. | 
| swap | |
| tan | Operates on the elements of an input valarray, returning avalarraywhose elements are equal to the tangent of the elements of the inputvalarray. | 
| tanh | Operates on the elements of an input valarray, returning avalarraywhose elements are equal to the hyperbolic tangent of the elements of the inputvalarray. | 
Operators
| Name | Description | 
|---|---|
| operator!= | Tests whether the corresponding elements of two equally sized valarrayobjects are unequal or whether all the elements of avalarrayare unequal to a specified value of thevalarrayobject's element type. | 
| operator% | Obtains the remainder of dividing the corresponding elements of two equally sized valarrayobjects or of dividing avalarrayby a specified value of thevalarrayobject's element type or of dividing a specified value by avalarray. | 
| operator& | Obtains the bitwise AND between corresponding elements of two equally sized valarrayobjects or between avalarrayand a specified value of the element type. | 
| operator&& | Obtains the logical AND between corresponding elements of two equally sized valarrayobjects or between avalarrayand a specified value of thevalarrayobject's element type. | 
| operator> | Tests whether the elements of one valarrayare greater than the elements of an equally sizedvalarrayor whether all the elements of avalarrayare greater or less than a specified value of thevalarrayobject's element type. | 
| operator>= | Tests whether the elements of one valarrayare greater than or equal to the elements of an equally sizedvalarrayor whether all the elements of avalarrayare greater than or equal to or less than or equal to a specified value. | 
| operator>> | Right-shifts the bits for each element of a valarraya specified number of positions or by an element-wise amount specified by a secondvalarray. | 
| operator< | Tests whether the elements of one valarrayare less than the elements of an equally sizedvalarrayor whether all the elements of avalarrayare greater or less than a specified value. | 
| operator<= | Tests whether the elements of one valarrayare less than or equal to the elements of an equally sizedvalarrayor whether all the elements of avalarrayare greater than or equal to or less than or equal to a specified value. | 
| operator<< | Left shifts the bits for each element of a valarraya specified number of positions or by an element-wise amount specified by a secondvalarray. | 
| operator* | Obtains the element-wise product between corresponding elements of two equally sized valarrayobjects or of between avalarraya specified value of thevalarrayobject's element type. | 
| operator+ | Obtains the element-wise sum between corresponding elements of two equally sized valarrayobjects or of between avalarraya specified value of thevalarrayobject's element type. | 
| operator- | Obtains the element-wise difference between corresponding elements of two equally sized valarrayobjects or of between avalarraya specified value of thevalarrayobject's element type. | 
| operator/ | Obtains the element-wise quotient between corresponding elements of two equally sized valarrayobjects or of between avalarraya specified value of thevalarrayobject's element type. | 
| operator== | Tests whether the corresponding elements of two equally sized valarrayobjects are equal or whether all the elements of avalarrayare equal a specified value of thevalarrayobject's element type. | 
| operator^ | Obtains the bitwise exclusive OR between corresponding elements of two equally sized valarrayobjects or between avalarrayand a specified value of the element type. | 
| operator| | Obtains the bitwise OR between corresponding elements of two equally sized valarrayobjects or between avalarrayand a specified value of the element type. | 
| operator|| | Obtains the logical OR between corresponding elements of two equally sized valarrayobjects or between avalarrayand a specified value of thevalarrayobject's element type. | 
Classes
| Name | Description | 
|---|---|
| gsliceclass | A utility class to valarraythat is used to define multi-dimensional slices of avalarray. | 
| gslice_arrayclass | An internal, auxiliary class template that supports general slice objects by providing operations between subset arrays defined by the general slice of a valarray. | 
| indirect_arrayclass | An internal, auxiliary class template that supports objects that are subsets of valarrayobjects by providing operations between subset arrays defined by specifying a subset of indices of a parentvalarray. | 
| mask_arrayclass | An internal, auxiliary class template that supports objects that are subsets of parent valarrayobjects, specified with a Boolean expression, by providing operations between the subset arrays. | 
| sliceclass | A utility class to valarraythat is used to define one-dimensional, vector-like subsets of avalarray. | 
| slice_arrayclass | An internal, auxiliary class template that supports sliceobjects by providing operations between subset arrays defined by the slice of avalarray. | 
| valarray<Type>class | The class template describes an object that controls a sequence of elements of type Typethat are stored as an array and designed for high-speed mathematical operations, optimized for computational performance. | 
Specializations
| Name | Description | 
|---|---|
| valarray<bool>class | A specialized version of the class template valarray<Type>for elements of typebool. | 
See also
Header files reference
Thread safety in the C++ Standard Library