3#ifndef DUNE_PDELAB_BACKEND_ISTL_VECTORITERATOR_HH
4#define DUNE_PDELAB_BACKEND_ISTL_VECTORITERATOR_HH
20 template<
typename T,
bool is_const,
typename Tag,
typename... Iterators>
23 template<
typename T,
typename... Iterators>
27 typename tags::container<typename T::block_type>::type::base_tag,
28 Iterators..., typename T::const_iterator
32 template<
typename T,
typename... Iterators>
36 typename tags::container<typename T::block_type>::type::base_tag,
37 Iterators..., typename T::iterator
41 template<
typename T,
typename... Iterators>
44 typedef std::tuple<Iterators...,
typename T::const_iterator>
type;
47 template<
typename T,
typename... Iterators>
50 typedef std::tuple<Iterators...,
typename T::iterator>
type;
54 template<
typename T,
typename... Iterators>
57 typedef std::tuple<Iterators...,
typename T::const_iterator>
type;
60 template<
typename T,
typename... Iterators>
63 typedef std::tuple<Iterators...,
typename T::iterator>
type;
80 :
public std::iterator<std::forward_iterator_tag,
81 typename V::field_type,
82 typename std::ptrdiff_t,
83 typename V::field_type*,
84 typename V::field_type&
95 :
public std::iterator<std::forward_iterator_tag,
96 typename V::field_type,
97 typename std::ptrdiff_t,
98 const typename V::field_type*,
99 const typename V::field_type&
132 if (!start(vector_tag(),level<0>(),vector))
143 , _current(r._current)
144 , _iterators(r._iterators)
153 typename std::enable_if<
154 is_const && !std::is_same<vector,W>::value && std::is_same<vector,W>::value,
160 _current =r._current;
161 _iterators = r._iterators;
193 typename std::enable_if<
194 std::is_same<vector,typename vector_iterator<W>::vector>
::value,
203 return _current == r._current;
210 typename std::enable_if<
211 std::is_same<vector,typename vector_iterator<W>::vector>
::value,
221 template<std::
size_t l>
223 :
public std::integral_constant<std::size_t,l>
229 if (!advance(vector_tag(),level<0>()))
233 template<std::
size_t l,
typename Block>
234 bool start_leaf(level<l>, Block& block)
236 typedef typename std::tuple_element<l,Iterators>::type iterator;
237 iterator& it = std::get<l>(_iterators);
238 iterator& end = std::get<l>(_end);
251 template<std::
size_t l,
typename Block>
252 bool start(tags::field_vector_n, level<l>, Block& block)
254 return start_leaf(level<l>(),block);
257 template<std::
size_t l,
typename Block>
258 bool start(tags::dynamic_vector, level<l>, Block& block)
260 return start_leaf(level<l>(),block);
263 template<std::
size_t l,
typename Block>
264 bool start(tags::field_vector_1, level<l>, Block& block)
266 _current = &(block[0]);
271 template<std::
size_t l,
typename Block>
272 bool start(tags::block_vector, level<l>, Block& block)
274 typedef typename std::tuple_element<l,Iterators>::type iterator;
275 iterator& it = std::get<l>(_iterators);
276 iterator& end = std::get<l>(_end);
293 template<std::
size_t l>
294 bool advance_leaf(level<l>)
296 typedef typename std::tuple_element<l,Iterators>::type iterator;
297 iterator& it = std::get<l>(_iterators);
298 const iterator& end = std::get<l>(_end);
310 template<std::
size_t l>
311 bool advance(tags::field_vector_n, level<l>)
313 return advance_leaf(level<l>());
316 template<std::
size_t l>
317 bool advance(tags::dynamic_vector, level<l>)
319 return advance_leaf(level<l>());
322 template<std::
size_t l>
323 bool advance(tags::field_vector_1, level<l>)
329 template<std::
size_t l>
330 bool advance(tags::block_vector, level<l>)
332 typedef typename std::tuple_element<l,Iterators>::type iterator;
333 iterator& it = std::get<l>(_iterators);
334 iterator& end = std::get<l>(_end);
354 typename BaseT::pointer _current;
355 Iterators _iterators;
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
tags::container< T >::type container_tag(const T &)
Gets instance of container tag associated with T.
Definition: backend/istl/tags.hh:234
Extracts the container tag from T.
Definition: backend/istl/tags.hh:143
Definition: vectoriterator.hh:21
std::tuple< Iterators..., typename T::const_iterator > type
Definition: vectoriterator.hh:44
std::tuple< Iterators..., typename T::iterator > type
Definition: vectoriterator.hh:50
std::tuple< Iterators..., typename T::const_iterator > type
Definition: vectoriterator.hh:57
std::tuple< Iterators..., typename T::iterator > type
Definition: vectoriterator.hh:63
Definition: vectoriterator.hh:70
Definition: vectoriterator.hh:86
static const bool is_const
Definition: vectoriterator.hh:90
tags::container< V >::type::base_tag vector_tag
Definition: vectoriterator.hh:89
V & vector_reference
Definition: vectoriterator.hh:88
V vector
Definition: vectoriterator.hh:87
const V & vector_reference
Definition: vectoriterator.hh:103
V vector
Definition: vectoriterator.hh:102
tags::container< V >::type::base_tag vector_tag
Definition: vectoriterator.hh:104
Definition: vectoriterator.hh:113
std::enable_if< is_const &&!std::is_same< vector, W >::value &&std::is_same< vector, W >::value, vector_iterator & >::type operator=(const vector_iterator< W > &r)
Definition: vectoriterator.hh:157
vector_iterator & operator++()
Definition: vectoriterator.hh:179
vector_iterator operator++(int)
Definition: vectoriterator.hh:185
BaseT::reference operator*() const
Definition: vectoriterator.hh:173
BaseT::pointer operator->() const
Definition: vectoriterator.hh:167
vector_iterator(const vector_iterator< W > &r, typename std::enable_if< is_const &&!std::is_same< V, W >::value &&std::is_same< vector, W >::value, void * >::type=nullptr)
Definition: vectoriterator.hh:141
std::enable_if< std::is_same< vector, typenamevector_iterator< W >::vector >::value, bool >::type operator!=(const vector_iterator< W > &r) const
Definition: vectoriterator.hh:214
vector_iterator(vector_reference vector, bool at_end)
Definition: vectoriterator.hh:127
std::enable_if< std::is_same< vector, typenamevector_iterator< W >::vector >::value, bool >::type operator==(const vector_iterator< W > &r) const
Definition: vectoriterator.hh:197
static const unsigned int value
Definition: gridfunctionspace/tags.hh:139