Standard C++ Library Reference ISO/IEC (VERSION3)
valarray::size
size_t size() const;
The member function returns the number of elements in the array.
valarray::sum
Ty sum() const;
The member function returns the sum of all elements of *this, which must have nonzero length. If the
length is greater than one, it adds values to the sum by applying operator+= between pairs of elements of
class Ty.
valarray::valarray
valarray();
explicit valarray(size_t count);
valarray(const Ty& val, size_t count));
valarray(const Ty *ptr, size_t count);
valarray(const slice_array<Ty>& slicearr);
valarray(const gslice_array<Ty>& gslicearr);
valarray(const mask_array<Ty>& maskarr);
valarray(const indirect_array<Ty>& indarr);
The first (default) constructor initializes the object to an empty array. The next three constructors each
initialize the object to an array of count elements as follows:
For explicit valarray(size_t count), each element is initialized with the default
constructor.
●
For valarray(const Ty& val, size_t count)), each element is initialized with val.●
For valarray(const Ty *ptr, size_t count), the element at position I is initialized
with p[I].
●
Each of the remaining constructors initializes the object to a valarray<Ty> object determined by the
argument.
valarray::value_type
typedef Ty value_type;
The type is a synonym for the template parameter Ty.
valarray<bool>
class valarray<bool>
The type is a specialization of template class valarray, for elements of type bool.
See also the Table of Contents and the Index.
Copyright © 1994-2001 by P.J. Plauger. All rights reserved.