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.
valarray::valarray
valarray();
explicit valarray(size_t n);
valarray(const T& val, size_t n));
valarray(const T *p, size_t n);
valarray(const slice_array<T>& sa);
valarray(const gslice_array<T>& ga);
valarray(const mask_array<T>& ma);
valarray(const indirect_array<T>& ia);
The first (default) constructor initializes the object to an empty array. Each of the next three constructors initializes the object to an array of n elements as follows:
- For
explicit ``valarray``(size_t n), each element is initialized with the default constructor. - For
valarray``(const T& val, size_t n)), each element is initialized withval. - For
valarray``(const T *p, size_t n), the element at positionIis initialized withp[I].
Each of the remaining constructors initializes the object to a valarray<T> object determined by the argument.