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


Library:  Numerics

Does not inherit

Local Index



A numeric array class used to represent elements selected from a valarray


#include <valarray>

namespace std {
  template <class T>
  class indirect_array;


indirect_array creates a selective view into a valarray. An indirect_array is produced by applying the indirect subscript operator to a valarray. The indirect array produced by this subscript contains only the elements of the valarray whose indices appear as values in the argument. The elements in an indirect_array are references to selected elements in the valarray. For this reason, changing an element in the indirect_array really changes the corresponding element in the valarray. An indirect_array does not itself hold any distinct elements. The template cannot be instantiated directly since all its constructors are private. However, you can copy an indirect_array to a valarray using either the valarray copy constructor or the assignment operator. Reference semantics are lost at that point.



indirect_array(const indirect_array&);

Assignment Operators

void operator=(const valarray<T>& x) const;
operator=(const indirect-_array<T>& x);
void operator=(const 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;


See Also

slice, slice_array, valarray, gslice, gslice_array, mask_array

Standards Conformance

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

Previous fileTop of DocumentContentsIndex pageNext file