Files
2025-10-25 03:02:53 +03:00

11 KiB

[valarray.syn]

29 Numerics library [numerics]

29.6 Numeric arrays [numarray]

29.6.1 Header synopsis [valarray.syn]

🔗

#include <initializer_list> // see [initializer.list.syn]namespace std {template class valarray; // An array of type Tclass slice; // a BLAS-like slice out of an arraytemplate class slice_array; class gslice; // a generalized slice out of an arraytemplate class gslice_array; template class mask_array; // a masked arraytemplate class indirect_array; // an indirected arraytemplate void swap(valarray&, valarray&) noexcept; template valarray operator* (const valarray&, const valarray&); template valarray operator* (const valarray&, const typename valarray::value_type&); template valarray operator* (const typename valarray::value_type&, const valarray&); template valarray operator/ (const valarray&, const valarray&); template valarray operator/ (const valarray&, const typename valarray::value_type&); template valarray operator/ (const typename valarray::value_type&, const valarray&); template valarray operator% (const valarray&, const valarray&); template valarray operator% (const valarray&, const typename valarray::value_type&); template valarray operator% (const typename valarray::value_type&, const valarray&); template valarray operator+ (const valarray&, const valarray&); template valarray operator+ (const valarray&, const typename valarray::value_type&); template valarray operator+ (const typename valarray::value_type&, const valarray&); template valarray operator- (const valarray&, const valarray&); template valarray operator- (const valarray&, const typename valarray::value_type&); template valarray operator- (const typename valarray::value_type&, const valarray&); template valarray operator^ (const valarray&, const valarray&); template valarray operator^ (const valarray&, const typename valarray::value_type&); template valarray operator^ (const typename valarray::value_type&, const valarray&); template valarray operator& (const valarray&, const valarray&); template valarray operator& (const valarray&, const typename valarray::value_type&); template valarray operator& (const typename valarray::value_type&, const valarray&); template valarray operator| (const valarray&, const valarray&); template valarray operator| (const valarray&, const typename valarray::value_type&); template valarray operator| (const typename valarray::value_type&, const valarray&); template valarray operator<<(const valarray&, const valarray&); template valarray operator<<(const valarray&, const typename valarray::value_type&); template valarray operator<<(const typename valarray::value_type&, const valarray&); template valarray operator>>(const valarray&, const valarray&); template valarray operator>>(const valarray&, const typename valarray::value_type&); template valarray operator>>(const typename valarray::value_type&, const valarray&); template valarray operator&&(const valarray&, const valarray&); template valarray operator&&(const valarray&, const typename valarray::value_type&); template valarray operator&&(const typename valarray::value_type&, const valarray&); template valarray operator||(const valarray&, const valarray&); template valarray operator||(const valarray&, const typename valarray::value_type&); template valarray operator||(const typename valarray::value_type&, const valarray&); template valarray operator==(const valarray&, const valarray&); template valarray operator==(const valarray&, const typename valarray::value_type&); template valarray operator==(const typename valarray::value_type&, const valarray&); template valarray operator!=(const valarray&, const valarray&); template valarray operator!=(const valarray&, const typename valarray::value_type&); template valarray operator!=(const typename valarray::value_type&, const valarray&); template valarray operator< (const valarray&, const valarray&); template valarray operator< (const valarray&, const typename valarray::value_type&); template valarray operator< (const typename valarray::value_type&, const valarray&); template valarray operator> (const valarray&, const valarray&); template valarray operator> (const valarray&, const typename valarray::value_type&); template valarray operator> (const typename valarray::value_type&, const valarray&); template valarray operator<=(const valarray&, const valarray&); template valarray operator<=(const valarray&, const typename valarray::value_type&); template valarray operator<=(const typename valarray::value_type&, const valarray&); template valarray operator>=(const valarray&, const valarray&); template valarray operator>=(const valarray&, const typename valarray::value_type&); template valarray operator>=(const typename valarray::value_type&, const valarray&); template valarray abs (const valarray&); template valarray acos (const valarray&); template valarray asin (const valarray&); template valarray atan (const valarray&); template valarray atan2(const valarray&, const valarray&); template valarray atan2(const valarray&, const typename valarray::value_type&); template valarray atan2(const typename valarray::value_type&, const valarray&); template valarray cos (const valarray&); template valarray cosh (const valarray&); template valarray exp (const valarray&); template valarray log (const valarray&); template valarray log10(const valarray&); template valarray pow(const valarray&, const valarray&); template valarray pow(const valarray&, const typename valarray::value_type&); template valarray pow(const typename valarray::value_type&, const valarray&); template valarray sin (const valarray&); template valarray sinh (const valarray&); template valarray sqrt (const valarray&); template valarray tan (const valarray&); template valarray tanh (const valarray&); template unspecified1 begin(valarray& v); template unspecified2 begin(const valarray& v); template unspecified1 end(valarray& v); template unspecified2 end(const valarray& v);}

1

#

The header defines five class templates (valarray,slice_array,gslice_array,mask_array, andindirect_array), two classes (slice andgslice), and a series of related function templates for representing and manipulating arrays of values.

2

#

Thevalarray array classes are defined to be free of certain forms of aliasing, thus allowing operations on these classes to be optimized.

3

#

Any function returning avalarray is permitted to return an object of another type, provided all the const member functions ofvalarray are also applicable to this type.

This return type shall not add more than two levels of template nesting over the most deeply nested argument type.247

4

#

Implementations introducing such replacement types shall provide additional functions and operators as follows:

for every function taking aconst valarray& other thanbegin andend, identical functions taking the replacement types shall be added;

for every function taking twoconst valarray& arguments, identical functions taking every combination ofconst valarray& and replacement types shall be added.

5

#

In particular, an implementation shall allow avalarray to be constructed from such replacement types and shall allow assignments and compound assignments of such types tovalarray,slice_array,gslice_array,mask_array andindirect_array objects.

6

#

These library functions are permitted to throw abad_alloc exception if there are not sufficient resources available to carry out the operation.

Note that the exception is not mandated.

247)247)

[implimits] recommends a minimum number of recursively nested template instantiations.

This requirement thus indirectly suggests a minimum allowable complexity for valarray expressions.