<valarray>

 

For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.

Defines the template class valarray and numerous supporting template classes and functions.

#include <valarray>  
  

These template classes and functions are permitted unusual latitude in the interest of improved performance. Specifically, any function returning 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.

Functions

absOperates on the elements of an input valarray, returning a valarray whose elements are equal to the absolute value of the elements of the input valarray.
acosOperates on the elements of an input valarray, returning a valarray whose elements are equal to the arccosine of the elements of the input valarray.
asinOperates on the elements of an input valarray, returning a valarray whose elements are equal to the arcsine of the elements of the input valarray.
atanOperates on the elements of an input valarray, returning a valarray whose elements are equal to the principal value of the arctangent of the elements of the input valarray.
atan2Returns a valarray whose elements are equal to the arctangent of the Cartesian components specified by a combination of constants and elements of valarrays.
cosOperates on the elements of an input valarray, returning a valarray whose elements are equal to the cosine of the elements of the input valarray.
coshOperates on the elements of an input valarray, returning a valarray whose elements are equal to the hyperbolic cosine of the elements of the input valarray.
expOperates on the elements of an input valarray, returning a valarray whose elements are equal to the natural exponential of the elements of the input valarray.
logOperates on the elements of an input valarray, returning a valarray whose elements are equal to the natural logarithm of the elements of the input valarray.
log10Operates on the elements of an input valarray, returning a valarray whose elements are equal to the base 10 or common logarithm of the elements of the input valarray.
powOperates on the elements of input valarrays and constants, returning a valarray whose elements are equal to a base specified either by the elements of an input valarray or a constant raised to an exponent specified either by the elements of an input valarray or a constant.
sinOperates on the elements of an input valarray, returning a valarray whose elements are equal to the sine of the elements of the input valarray.
sinhOperates on the elements of an input valarray, returning a valarray whose elements are equal to the hyperbolic sine of the elements of the input valarray.
sqrtOperates on the elements of an input valarray, returning a valarray whose elements are equal to the square root of the elements of the input valarray.
swap
tanOperates on the elements of an input valarray, returning a valarray whose elements are equal to the tangent of the elements of the input valarray.
tanhOperates on the elements of an input valarray, returning a valarray whose elements are equal to the hyperbolic tangent of the elements of the input valarray.

Operators

operator!=Tests whether the corresponding elements of two equally sized valarrays are unequal or whether all the elements of a valarray are unequal a specified value of the valarray's element type.
operator%Obtains the remainder of dividing the corresponding elements of two equally sized valarrays or of dividing a valarray by a specified value of the valarray's element type or of dividing a specified value by a valarray.
operator&Obtains the bitwise AND between corresponding elements of two equally sized valarrays or between a valarray and a specified value of the element type.
operator&&Obtains the logical AND between corresponding elements of two equally sized valarrays or between a valarray and a specified value of the valarray's element type.
operator>Tests whether the elements of one valarray are greater than the elements of an equally sized valarray or whether all the elements of a valarray are greater or less than a specified value of the valarray's element type.
operator>=Tests whether the elements of one valarray are greater than or equal to the elements of an equally sized valarray or whether all the elements of a valarray are greater than or equal to or less than or equal to a specified value.
operator>>Right-shifts the bits for each element of a valarray a specified number of positions or by an element-wise amount specified by a second valarray.
operator<Tests whether the elements of one valarray are less than the elements of an equally sized valarray or whether all the elements of a valarray are greater or less than a specified value.
operator<=Tests whether the elements of one valarray are less than or equal to the elements of an equally sized valarray or whether all the elements of a valarray are greater than or equal to or less than or equal to a specified value.
operator<<Left shifts the bits for each element of a valarray a specified number of positions or by an element-wise amount specified by a second valarray.
operator*Obtains the element-wise product between corresponding elements of two equally sized valarrays or of between a valarray a specified value of the valarray's element type.
operator+Obtains the element-wise sum between corresponding elements of two equally sized valarrays or of between a valarray a specified value of the valarray's element type.
operator-Obtains the element-wise difference between corresponding elements of two equally sized valarrays or of between a valarray a specified value of the valarray's element type.
operator/Obtains the element-wise quotient between corresponding elements of two equally sized valarrays or of between a valarray a specified value of the valarray's element type.
operator==Tests whether the corresponding elements of two equally sized valarrays are equal or whether all the elements of a valarray are equal a specified value of the valarray's element type.
operator^Obtains the bitwise exclusive OR between corresponding elements of two equally sized valarrays or between a valarray and a specified value of the element type.
operator|Obtains the bitwise OR between corresponding elements of two equally sized valarrays or between a valarray and a specified value of the element type.
operator||Obtains the logical OR between corresponding elements of two equally sized valarrays or between a valarray and a specified value of the valarray's element type.

Classes

gslice ClassA utility class to valarray that is used to define multi-dimensional slices of a valarray.
gslice_array ClassAn internal, auxiliary template class that supports general slice objects by providing operations between subset arrays defined by the general slice of a valarray.
indirect_array ClassAn internal, auxiliary template class that supports objects that are subsets of valarrays by providing operations between subset arrays defined by specifying a subset of indices of a parent valarray.
mask_array ClassAn internal, auxiliary template class that supports objects that are subsets of parent valarrays, specified with a Boolean expression, by providing operations between the subset arrays.
slice ClassA utility class to valarray that is used to define one-dimensional, vector-like subsets of a valarray.
slice_array ClassAn internal, auxiliary template class that supports slice objects by providing operations between subset arrays defined by the slice of a valarray.
valarray ClassThe template class describes an object that controls a sequence of elements of type Type that are stored as an array and designed for performing high-speed mathematical operations, optimized for computational performance.

Specializations

valarray<bool> ClassA specialized version of the template class valarray<Type> to elements of type bool.

Header Files Reference
Thread Safety in the C++ Standard Library

Show: