# valarray File Reference

`#include <bits/c++config.h>`
`#include <cstddef>`
`#include <cmath>`
`#include <cstdlib>`
`#include <numeric>`
`#include <functional>`
`#include <algorithm>`
`#include <bits/valarray_array.h>`
`#include <bits/valarray_meta.h>`
`#include <bits/slice.h>`
`#include <bits/slice_array.h>`
`#include <bits/gslice.h>`
`#include <bits/gslice_array.h>`
`#include <bits/mask_array.h>`
`#include <bits/indirect_array.h>`

Include dependency graph for valarray:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Namespaces

namespace | std

## Detailed Description

This is a Standard C++ Library header. You should `#include` this header in your programs, rather than any of the "st[dl]_*.h" implementation files.

Definition in file valarray.

## Define Documentation

#define _DEFINE_BINARY_OPERATOR | ( | _Op,
|  | _Name |  | ) |

Value:

    template<typename _Tp>                      \
      inline _Expr<_BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp>, _Tp>        \
      operator _Op (const valarray<_Tp> &__v, const valarray<_Tp> &__w) \
      {                                 \
          typedef _BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp> _Closure;     \
          return _Expr<_Closure, _Tp> (_Closure (__v, __w));        \
      }                                 \
                                        \
      template<typename _Tp>                        \
      inline _Expr<_BinClos<_Name,_ValArray,_Constant,_Tp,_Tp>,_Tp>         \
      operator _Op (const valarray<_Tp> &__v, const _Tp &__t)       \
      {                                 \
          typedef _BinClos<_Name,_ValArray,_Constant,_Tp,_Tp> _Closure; \
          return _Expr<_Closure, _Tp> (_Closure (__v, __t));            \
      }                                 \
                                        \
      template<typename _Tp>                        \
      inline _Expr<_BinClos<_Name,_Constant,_ValArray,_Tp,_Tp>,_Tp>         \
      operator _Op (const _Tp &__t, const valarray<_Tp> &__v)       \
      {                                 \
          typedef _BinClos<_Name,_Constant,_ValArray,_Tp,_Tp> _Closure;     \
          return _Expr<_Closure, _Tp> (_Closure (__t, __v));            \
      }

Definition at line 663 of file valarray.

#define _DEFINE_LOGICAL_OPERATOR | ( | _Op,
|  | _Name |  | ) |

Value:

    template<typename _Tp>                      \
      inline _Expr<_BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp>,bool>        \
      operator _Op (const valarray<_Tp> &__v, const valarray<_Tp> &__w) \
      {                                 \
          typedef _BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp> _Closure;     \
          return _Expr<_Closure, bool> (_Closure (__v, __w));               \
      }                                 \
                                        \
      template<class _Tp>                           \
      inline _Expr<_BinClos<_Name,_ValArray,_Constant,_Tp,_Tp>,bool>        \
      operator _Op (const valarray<_Tp> &__v, const _Tp &__t)       \
      {                                 \
          typedef _BinClos<_Name,_ValArray,_Constant,_Tp,_Tp> _Closure;     \
          return _Expr<_Closure, bool> (_Closure (__v, __t));           \
      }                                 \
                                        \
      template<class _Tp>                           \
      inline _Expr<_BinClos<_Name,_Constant,_ValArray,_Tp,_Tp>,bool>        \
      operator _Op (const _Tp &__t, const valarray<_Tp> &__v)       \
      {                                 \
          typedef _BinClos<_Name,_Constant,_ValArray,_Tp,_Tp> _Closure;     \
          return _Expr<_Closure, bool> (_Closure (__t, __v));           \
      }

Definition at line 701 of file valarray.

#define _DEFINE_VALARRAY_AUGMENTED_ASSIGNMENT | ( | _Op,
|  | _Name |  | ) |

Value:

    template<class _Tp>                         \
      inline valarray<_Tp> &                        \
      valarray<_Tp>::operator _Op##= (const _Tp &__t)           \
      {                                 \
          _Array_augmented_##_Name (_Array<_Tp>(_M_data), _M_size, __t);    \
          return *this;                         \
      }                                 \
                                        \
      template<class _Tp>                           \
      inline valarray<_Tp> &                        \
      valarray<_Tp>::operator _Op##= (const valarray<_Tp> &__v)     \
      {                                 \
          _Array_augmented_##_Name (_Array<_Tp>(_M_data), _M_size,      \
                                   _Array<_Tp>(__v._M_data));       \
          return *this;                         \
      }

Definition at line 602 of file valarray.

#define _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT | ( | _Op,
|  | _Name |  | ) |

Value:

    template<class _Tp> template<class _Dom>                \
      inline valarray<_Tp> &                        \
      valarray<_Tp>::operator _Op##= (const _Expr<_Dom,_Tp> &__e)       \
      {                                 \
          _Array_augmented_##_Name (_Array<_Tp>(_M_data), __e, _M_size);    \
          return *this;                         \
      }

Definition at line 640 of file valarray.

#define _DEFINE_VALARRAY_UNARY_OPERATOR | ( | _Op,
|  | _Name |  | ) |

Value:

    template<typename _Tp>                      \
      inline _Expr<_UnClos<_Name,_ValArray,_Tp>, _Tp>                   \
      valarray<_Tp>::operator _Op() const                   \
      {                                 \
          typedef _UnClos<_Name,_ValArray,_Tp> _Closure;                    \
          return _Expr<_Closure, _Tp> (_Closure (*this));           \
      }

Definition at line 579 of file valarray.