35 #pragma GCC system_header
37 namespace std _GLIBCXX_VISIBILITY(default)
39 _GLIBCXX_BEGIN_NAMESPACE_VERSION
80 gslice(
size_t __o,
const valarray<size_t>& __l,
81 const valarray<size_t>& __s);
100 valarray<size_t>
size()
const;
103 valarray<size_t>
stride()
const;
110 valarray<size_t> _M_size;
111 valarray<size_t> _M_stride;
112 valarray<size_t> _M_index;
115 : _M_count(1), _M_start(0), _M_size(), _M_stride(), _M_index() {}
117 _Indexer(
size_t,
const valarray<size_t>&,
118 const valarray<size_t>&);
126 {
return --_M_count; }
131 template<
typename _Tp>
friend class valarray;
136 {
return _M_index ? _M_index->_M_start : 0; }
138 inline valarray<size_t>
140 {
return _M_index ? _M_index->_M_size : valarray<size_t>(); }
142 inline valarray<size_t>
144 {
return _M_index ? _M_index->_M_stride : valarray<size_t>(); }
150 : _M_index(new
gslice::_Indexer()) {}
154 const valarray<size_t>& __s)
155 : _M_index(new
gslice::_Indexer(__o, __l, __s)) {}
159 : _M_index(__g._M_index)
160 {
if (_M_index) _M_index->_M_increment_use(); }
165 if (_M_index && _M_index->_M_decrement_use() == 0)
173 __g._M_index->_M_increment_use();
174 if (_M_index && _M_index->_M_decrement_use() == 0)
176 _M_index = __g._M_index;
182 _GLIBCXX_END_NAMESPACE_VERSION
valarray< size_t > size() const
Return array of sizes of slice dimensions.
gslice & operator=(const gslice &)
Assignment operator.
size_t start() const
Return array offset of first slice element.
ISO C++ entities toplevel namespace is std.
Class defining multi-dimensional subset of an array.
valarray< size_t > stride() const
Return array of array strides for each dimension.
gslice()
Construct an empty slice.