Reference documentation for deal.II version 9.2.0
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
iterator_range.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 //
3 // Copyright (C) 2014 - 2019 by the deal.II authors
4 //
5 // This file is part of the deal.II library.
6 //
7 // The deal.II library is free software; you can use it, redistribute
8 // it, and/or modify it under the terms of the GNU Lesser General
9 // Public License as published by the Free Software Foundation; either
10 // version 2.1 of the License, or (at your option) any later version.
11 // The full text of the license can be found in the file LICENSE.md at
12 // the top level directory of deal.II.
13 //
14 // ---------------------------------------------------------------------
15 
16 #ifndef dealii_iterator_range_h
17 #define dealii_iterator_range_h
18 
19 
20 #include <deal.II/base/config.h>
21 
23 
24 #include <iterator>
25 
26 
28 
29 
30 // Forward declaration
31 #ifndef DOXYGEN
32 template <typename Iterator>
34 #endif
35 
36 
128 template <typename Iterator>
130 {
131 public:
136 
137 
142 
148  IteratorRange();
149 
157  IteratorRange(const iterator begin, const iterator end);
158 
163  begin();
164 
169  begin() const;
170 
176  end() const;
177 
183  end();
184 
185 private:
191 };
192 
193 
194 
199 template <typename Iterator>
201 {
202 public:
208 
216 
221  const BaseIterator &operator*() const;
222 
227  const BaseIterator *operator->() const;
228 
234  operator++();
235 
242  operator++(int);
243 
250  bool
251  operator!=(const IteratorOverIterators &i_o_i) const;
252 
266  operator const BaseIterator &() const;
267 
273  using iterator_category = std::forward_iterator_tag;
275  using difference_type = typename Iterator::difference_type;
276  using pointer = Iterator *;
277  using reference = Iterator &;
278 
279 private:
284 };
285 
286 
287 
294 template <typename BaseIterator>
297  const typename identity<BaseIterator>::type &end)
298 {
299  IteratorRange<BaseIterator> ir(begin, end);
300  return ir;
301 }
302 
303 
304 // ------------------- template member functions
305 
306 
307 template <typename Iterator>
309  const BaseIterator &iterator)
310  : element_of_iterator_collection(iterator)
311 {}
312 
313 
314 
315 template <typename Iterator>
316 inline const typename IteratorOverIterators<Iterator>::BaseIterator &
318 {
320 }
321 
322 
323 
324 template <typename Iterator>
325 inline const typename IteratorOverIterators<Iterator>::BaseIterator *
327 {
329 }
330 
331 
332 
333 template <typename Iterator>
336 {
338  return *this;
339 }
340 
341 
342 
343 template <typename Iterator>
346 {
347  const IteratorOverIterators old_value = *this;
349  return *old_value;
350 }
351 
352 
353 
354 template <typename Iterator>
355 inline bool
358 {
360 }
361 
362 
363 
364 template <typename Iterator>
366 {
368 }
369 
370 
371 
372 template <typename Iterator>
374  : it_begin()
375  , it_end()
376 {}
377 
378 
379 
380 template <typename Iterator>
382  const iterator e)
383  : it_begin(b)
384  , it_end(e)
385 {}
386 
387 
388 template <typename Iterator>
391 {
392  return it_begin;
393 }
394 
395 
396 template <typename Iterator>
399 {
400  return it_begin;
401 }
402 
403 
404 template <typename Iterator>
407 {
408  return it_end;
409 }
410 
411 
412 template <typename Iterator>
415 {
416  return it_end;
417 }
418 
419 
421 
422 #endif
IteratorRange< BaseIterator > make_iterator_range(const BaseIterator &begin, const typename identity< BaseIterator >::type &end)
std::forward_iterator_tag iterator_category
IteratorOverIterators begin()
const BaseIterator & operator*() const
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
bool operator!=(const AlignedVector< T > &lhs, const AlignedVector< T > &rhs)
const IteratorOverIterators it_begin
Iterator iterator
IteratorOverIterators & operator++()
const BaseIterator * operator->() const
typename Iterator::difference_type difference_type
bool operator!=(const IteratorOverIterators &i_o_i) const
#define DEAL_II_NAMESPACE_CLOSE
Definition: config.h:359
SynchronousIterators< Iterators > operator++(SynchronousIterators< Iterators > &a)
SymmetricTensor< 2, dim, Number > b(const Tensor< 2, dim, Number > &F)
IteratorOverIterators(const BaseIterator &iterator)
BaseIterator element_of_iterator_collection
MatrixTableIterators::Iterator< TransposeTable< T >, Constness, MatrixTableIterators::Storage::column_major > Iterator
Definition: table.h:1913
::IteratorOverIterators< Iterator > IteratorOverIterators
#define DEAL_II_NAMESPACE_OPEN
Definition: config.h:358
std::enable_if< std::is_floating_point< T >::value &&std::is_floating_point< U >::value, typename ProductType< std::complex< T >, std::complex< U > >::type >::type operator*(const std::complex< T > &left, const std::complex< U > &right)
const IteratorOverIterators it_end
IteratorOverIterators end() const