Previous fileTop of DocumentContentsIndex pageNext file
Apache C++ Standard Library Reference Guide


Library:  Numerics

Does not inherit

Local Index



A numeric array class that gives a masked view of a valarray


#include <valarray>

namespace std {
  template <class T>
  class mask_array;


mask_array gives a masked view into a valarray. A mask_array can only be produced by applying the mask subscript operator to a valarray. This subscript operator takes a valarray<bool> argument and produces a mask_array. Only the elements in the valarray whose corresponding elements in the valarray<bool> argument were true are selected by the mask_array. The elements in a mask_array are references to selected elements in the valarray (so changing an element in the mask_array really changes the corresponding element in the valarray). A mask_array does not itself hold any distinct elements. The template cannot be instantiated directly since all its constructors are private. However, you can copy a mask_array to a valarray using either the valarray copy constructor or the assignment operator. Reference semantics are lost at that point.



mask_array(const mask_array&);

Assignment Operators

void operator=(const valarray<T>& x) const;
operator=(const mask_array<T>& x);

Computed Assignment Operators

void operator*=(const valarray<T>& val) const;
void operator/=(const valarray<T>& val) const;
void operator%=(const valarray<T>& val) const;
void operator+=(const valarray<T>& val) const;
void operator-=(const valarray<T>& val) const;
void operator^=(const valarray<T>& val) const;
void operator&=(const valarray<T>& val) const;
void operator|=(const valarray<T>& val) const;
void operator<<=(const valarray<T>& val) const;
void operator>>=(const valarray<T>& val) const;

Member Function

void operator=(const T& x) const;


See Also

slice, slice_array, valarray, gslice, gslice_array, indirect_array

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems -- Programming Language C++, Section 26.3.8

Previous fileTop of DocumentContentsIndex pageNext file