32#ifndef _INDIRECT_ARRAY_H
33#define _INDIRECT_ARRAY_H 1
36#pragma GCC system_header
39namespace std _GLIBCXX_VISIBILITY(default)
41_GLIBCXX_BEGIN_NAMESPACE_VERSION
67 typedef _Tp value_type;
106 void operator=(
const _Expr<_Dom, _Tp>&)
const;
108 void operator*=(
const _Expr<_Dom, _Tp>&)
const;
110 void operator/=(
const _Expr<_Dom, _Tp>&)
const;
112 void operator%=(
const _Expr<_Dom, _Tp>&)
const;
114 void operator+=(
const _Expr<_Dom, _Tp>&)
const;
116 void operator-=(
const _Expr<_Dom, _Tp>&)
const;
118 void operator^=(
const _Expr<_Dom, _Tp>&)
const;
120 void operator&=(
const _Expr<_Dom, _Tp>&)
const;
122 void operator|=(
const _Expr<_Dom, _Tp>&)
const;
136 const _Array<size_t> _M_index;
137 const _Array<_Tp> _M_array;
143 template<
typename _Tp>
146 : _M_sz(__a._M_sz), _M_index(__a._M_index), _M_array(__a._M_array) {}
148 template<
typename _Tp>
152 : _M_sz(__s), _M_index(__i), _M_array(__a) {}
154 template<
typename _Tp>
155 inline indirect_array<_Tp>&
158 std::__valarray_copy(__a._M_array, _M_sz, __a._M_index, _M_array,
163 template<
typename _Tp>
166 { std::__valarray_fill(_M_array, _M_index, _M_sz, __t); }
168 template<
typename _Tp>
171 { std::__valarray_copy(_Array<_Tp>(__v), _M_sz, _M_array, _M_index); }
173 template<
typename _Tp>
177 { std::__valarray_copy(__e, _M_sz, _M_array, _M_index); }
180#undef _DEFINE_VALARRAY_OPERATOR
181#define _DEFINE_VALARRAY_OPERATOR(_Op, _Name) \
182 template<typename _Tp> \
184 indirect_array<_Tp>::operator _Op##=(const valarray<_Tp>& __v) const\
186 _Array_augmented_##_Name(_M_array, _M_index, _Array<_Tp>(__v), _M_sz); \
189 template<typename _Tp> \
190 template<class _Dom> \
192 indirect_array<_Tp>::operator _Op##=(const _Expr<_Dom,_Tp>& __e) const\
194 _Array_augmented_##_Name(_M_array, _M_index, __e, _M_sz); \
197_DEFINE_VALARRAY_OPERATOR(*, __multiplies)
198_DEFINE_VALARRAY_OPERATOR(/, __divides)
199_DEFINE_VALARRAY_OPERATOR(%, __modulus)
200_DEFINE_VALARRAY_OPERATOR(+, __plus)
201_DEFINE_VALARRAY_OPERATOR(-, __minus)
202_DEFINE_VALARRAY_OPERATOR(^, __bitwise_xor)
203_DEFINE_VALARRAY_OPERATOR(&, __bitwise_and)
204_DEFINE_VALARRAY_OPERATOR(|, __bitwise_or)
205_DEFINE_VALARRAY_OPERATOR(<<, __shift_left)
206_DEFINE_VALARRAY_OPERATOR(>>, __shift_right)
208#undef _DEFINE_VALARRAY_OPERATOR
213_GLIBCXX_END_NAMESPACE_VERSION
indirect_array & operator=(const indirect_array &)
Assignment operator. Assigns elements to corresponding elements of a.
indirect_array(const indirect_array &)
Copy constructor. Both slices refer to the same underlying array.
ISO C++ entities toplevel namespace is std.
Smart array designed to support numeric processing.
Reference to multi-dimensional subset of an array.
void operator/=(const valarray< _Tp > &) const
Divide slice elements by corresponding elements of v.
void operator^=(const valarray< _Tp > &) const
Logical xor slice elements with corresponding elements of v.
void operator|=(const valarray< _Tp > &) const
Logical or slice elements with corresponding elements of v.
void operator<<=(const valarray< _Tp > &) const
Left shift slice elements by corresponding elements of v.
void operator>>=(const valarray< _Tp > &) const
Right shift slice elements by corresponding elements of v.
void operator-=(const valarray< _Tp > &) const
Subtract corresponding elements of v from slice elements.
void operator*=(const valarray< _Tp > &) const
Multiply slice elements by corresponding elements of v.
void operator&=(const valarray< _Tp > &) const
Logical and slice elements with corresponding elements of v.
void operator+=(const valarray< _Tp > &) const
Add corresponding elements of v to slice elements.
void operator%=(const valarray< _Tp > &) const
Modulo slice elements by corresponding elements of v.