StlIterators.h
Go to the documentation of this file.
1 // This file is part of Eigen, a lightweight C++ template library
2 // for linear algebra.
3 //
4 // Copyright (C) 2018 Gael Guennebaud <gael.guennebaud@inria.fr>
5 //
6 // This Source Code Form is subject to the terms of the Mozilla
7 // Public License v. 2.0. If a copy of the MPL was not distributed
8 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 
10 #ifndef EIGEN_STLITERATORS_H
11 #define EIGEN_STLITERATORS_H
12 
13 // IWYU pragma: private
14 #include "./InternalHeaderCheck.h"
15 
16 namespace Eigen {
17 
18 namespace internal {
19 
20 template <typename IteratorType>
22 
23 template <typename Derived>
25  protected:
27  typedef typename traits::XprType XprType;
31  // NOTE: in C++03 we cannot declare friend classes through typedefs because we need to write friend class:
33  friend class indexed_based_stl_iterator_base<typename traits::non_const_iterator>;
34 
35  public:
37  typedef std::random_access_iterator_tag iterator_category;
38 
41 
43  m_index(other.m_index) {}
44 
46  mp_xpr = other.mp_xpr;
47  m_index = other.m_index;
48  return *this;
49  }
50 
51  Derived& operator++() {
52  ++m_index;
53  return derived();
54  }
55  Derived& operator--() {
56  --m_index;
57  return derived();
58  }
59 
60  Derived operator++(int) {
61  Derived prev(derived());
62  operator++();
63  return prev;
64  }
65  Derived operator--(int) {
66  Derived prev(derived());
67  operator--();
68  return prev;
69  }
70 
72  Derived ret(a.derived());
73  ret += b;
74  return ret;
75  }
77  Derived ret(a.derived());
78  ret -= b;
79  return ret;
80  }
82  Derived ret(b.derived());
83  ret += a;
84  return ret;
85  }
87  Derived ret(b.derived());
88  ret -= a;
89  return ret;
90  }
91 
92  Derived& operator+=(Index b) {
93  m_index += b;
94  return derived();
95  }
96  Derived& operator-=(Index b) {
97  m_index -= b;
98  return derived();
99  }
100 
102  eigen_assert(mp_xpr == other.mp_xpr);
103  return m_index - other.m_index;
104  }
105 
107  eigen_assert(mp_xpr == other.mp_xpr);
108  return m_index - other.m_index;
109  }
110 
111  bool operator==(const indexed_based_stl_iterator_base& other) const {
112  eigen_assert(mp_xpr == other.mp_xpr);
113  return m_index == other.m_index;
114  }
115  bool operator!=(const indexed_based_stl_iterator_base& other) const {
116  eigen_assert(mp_xpr == other.mp_xpr);
117  return m_index != other.m_index;
118  }
119  bool operator<(const indexed_based_stl_iterator_base& other) const {
120  eigen_assert(mp_xpr == other.mp_xpr);
121  return m_index < other.m_index;
122  }
123  bool operator<=(const indexed_based_stl_iterator_base& other) const {
124  eigen_assert(mp_xpr == other.mp_xpr);
125  return m_index <= other.m_index;
126  }
127  bool operator>(const indexed_based_stl_iterator_base& other) const {
128  eigen_assert(mp_xpr == other.mp_xpr);
129  return m_index > other.m_index;
130  }
131  bool operator>=(const indexed_based_stl_iterator_base& other) const {
132  eigen_assert(mp_xpr == other.mp_xpr);
133  return m_index >= other.m_index;
134  }
135 
136  bool operator==(const other_iterator& other) const {
137  eigen_assert(mp_xpr == other.mp_xpr);
138  return m_index == other.m_index;
139  }
140  bool operator!=(const other_iterator& other) const {
141  eigen_assert(mp_xpr == other.mp_xpr);
142  return m_index != other.m_index;
143  }
144  bool operator<(const other_iterator& other) const {
145  eigen_assert(mp_xpr == other.mp_xpr);
146  return m_index < other.m_index;
147  }
148  bool operator<=(const other_iterator& other) const {
149  eigen_assert(mp_xpr == other.mp_xpr);
150  return m_index <= other.m_index;
151  }
152  bool operator>(const other_iterator& other) const {
153  eigen_assert(mp_xpr == other.mp_xpr);
154  return m_index > other.m_index;
155  }
156  bool operator>=(const other_iterator& other) const {
157  eigen_assert(mp_xpr == other.mp_xpr);
158  return m_index >= other.m_index;
159  }
160 
161  protected:
162  Derived& derived() { return static_cast<Derived&>(*this); }
163  const Derived& derived() const { return static_cast<const Derived&>(*this); }
164 
167 };
168 
169 template <typename Derived>
171  protected:
173  typedef typename traits::XprType XprType;
177  // NOTE: in C++03 we cannot declare friend classes through typedefs because we need to write friend class:
179  friend class indexed_based_stl_reverse_iterator_base<typename traits::non_const_iterator>;
180 
181  public:
183  typedef std::random_access_iterator_tag iterator_category;
184 
187 
189  : mp_xpr(other.mp_xpr), m_index(other.m_index) {}
190 
192  mp_xpr = other.mp_xpr;
193  m_index = other.m_index;
194  return *this;
195  }
196 
197  Derived& operator++() {
198  --m_index;
199  return derived();
200  }
201  Derived& operator--() {
202  ++m_index;
203  return derived();
204  }
205 
206  Derived operator++(int) {
207  Derived prev(derived());
208  operator++();
209  return prev;
210  }
211  Derived operator--(int) {
212  Derived prev(derived());
213  operator--();
214  return prev;
215  }
216 
218  Derived ret(a.derived());
219  ret += b;
220  return ret;
221  }
223  Derived ret(a.derived());
224  ret -= b;
225  return ret;
226  }
228  Derived ret(b.derived());
229  ret += a;
230  return ret;
231  }
233  Derived ret(b.derived());
234  ret -= a;
235  return ret;
236  }
237 
238  Derived& operator+=(Index b) {
239  m_index -= b;
240  return derived();
241  }
242  Derived& operator-=(Index b) {
243  m_index += b;
244  return derived();
245  }
246 
248  eigen_assert(mp_xpr == other.mp_xpr);
249  return other.m_index - m_index;
250  }
251 
253  eigen_assert(mp_xpr == other.mp_xpr);
254  return other.m_index - m_index;
255  }
256 
258  eigen_assert(mp_xpr == other.mp_xpr);
259  return m_index == other.m_index;
260  }
262  eigen_assert(mp_xpr == other.mp_xpr);
263  return m_index != other.m_index;
264  }
266  eigen_assert(mp_xpr == other.mp_xpr);
267  return m_index > other.m_index;
268  }
270  eigen_assert(mp_xpr == other.mp_xpr);
271  return m_index >= other.m_index;
272  }
274  eigen_assert(mp_xpr == other.mp_xpr);
275  return m_index < other.m_index;
276  }
278  eigen_assert(mp_xpr == other.mp_xpr);
279  return m_index <= other.m_index;
280  }
281 
282  bool operator==(const other_iterator& other) const {
283  eigen_assert(mp_xpr == other.mp_xpr);
284  return m_index == other.m_index;
285  }
286  bool operator!=(const other_iterator& other) const {
287  eigen_assert(mp_xpr == other.mp_xpr);
288  return m_index != other.m_index;
289  }
290  bool operator<(const other_iterator& other) const {
291  eigen_assert(mp_xpr == other.mp_xpr);
292  return m_index > other.m_index;
293  }
294  bool operator<=(const other_iterator& other) const {
295  eigen_assert(mp_xpr == other.mp_xpr);
296  return m_index >= other.m_index;
297  }
298  bool operator>(const other_iterator& other) const {
299  eigen_assert(mp_xpr == other.mp_xpr);
300  return m_index < other.m_index;
301  }
302  bool operator>=(const other_iterator& other) const {
303  eigen_assert(mp_xpr == other.mp_xpr);
304  return m_index <= other.m_index;
305  }
306 
307  protected:
308  Derived& derived() { return static_cast<Derived&>(*this); }
309  const Derived& derived() const { return static_cast<const Derived&>(*this); }
310 
313 };
314 
315 template <typename XprType>
321  // NOTE: in C++03 we cannot declare friend classes through typedefs because we need to write friend class:
322  friend class pointer_based_stl_iterator<std::add_const_t<XprType>>;
323  friend class pointer_based_stl_iterator<std::remove_const_t<XprType>>;
324 
325  public:
327  typedef typename XprType::Scalar value_type;
328 #if EIGEN_CPLUSPLUS >= 202002L
329  typedef std::conditional_t<XprType::InnerStrideAtCompileTime == 1, std::contiguous_iterator_tag,
330  std::random_access_iterator_tag>
332 #else
333  typedef std::random_access_iterator_tag iterator_category;
334 #endif
335  typedef std::conditional_t<bool(is_lvalue), value_type*, const value_type*> pointer;
336  typedef std::conditional_t<bool(is_lvalue), value_type&, const value_type&> reference;
337 
339  pointer_based_stl_iterator(XprType& xpr, Index index) EIGEN_NO_THROW : m_incr(xpr.innerStride()) {
340  m_ptr = xpr.data() + index * m_incr.value();
341  }
342 
344  m_incr(other.m_incr) {}
345 
347  m_ptr = other.m_ptr;
348  m_incr.setValue(other.m_incr);
349  return *this;
350  }
351 
352  reference operator*() const { return *m_ptr; }
353  reference operator[](Index i) const { return *(m_ptr + i * m_incr.value()); }
354  pointer operator->() const { return m_ptr; }
355 
357  m_ptr += m_incr.value();
358  return *this;
359  }
361  m_ptr -= m_incr.value();
362  return *this;
363  }
364 
366  pointer_based_stl_iterator prev(*this);
367  operator++();
368  return prev;
369  }
371  pointer_based_stl_iterator prev(*this);
372  operator--();
373  return prev;
374  }
375 
378  ret += b;
379  return ret;
380  }
383  ret -= b;
384  return ret;
385  }
388  ret += a;
389  return ret;
390  }
393  ret -= a;
394  return ret;
395  }
396 
398  m_ptr += b * m_incr.value();
399  return *this;
400  }
402  m_ptr -= b * m_incr.value();
403  return *this;
404  }
405 
407  return (m_ptr - other.m_ptr) / m_incr.value();
408  }
409 
410  difference_type operator-(const other_iterator& other) const { return (m_ptr - other.m_ptr) / m_incr.value(); }
411 
412  bool operator==(const pointer_based_stl_iterator& other) const { return m_ptr == other.m_ptr; }
413  bool operator!=(const pointer_based_stl_iterator& other) const { return m_ptr != other.m_ptr; }
414  bool operator<(const pointer_based_stl_iterator& other) const { return m_ptr < other.m_ptr; }
415  bool operator<=(const pointer_based_stl_iterator& other) const { return m_ptr <= other.m_ptr; }
416  bool operator>(const pointer_based_stl_iterator& other) const { return m_ptr > other.m_ptr; }
417  bool operator>=(const pointer_based_stl_iterator& other) const { return m_ptr >= other.m_ptr; }
418 
419  bool operator==(const other_iterator& other) const { return m_ptr == other.m_ptr; }
420  bool operator!=(const other_iterator& other) const { return m_ptr != other.m_ptr; }
421  bool operator<(const other_iterator& other) const { return m_ptr < other.m_ptr; }
422  bool operator<=(const other_iterator& other) const { return m_ptr <= other.m_ptr; }
423  bool operator>(const other_iterator& other) const { return m_ptr > other.m_ptr; }
424  bool operator>=(const other_iterator& other) const { return m_ptr >= other.m_ptr; }
425 
426  protected:
429 };
430 
431 template <typename XprType_>
433  typedef XprType_ XprType;
436 };
437 
438 template <typename XprType>
440  : public indexed_based_stl_iterator_base<generic_randaccess_stl_iterator<XprType>> {
441  public:
442  typedef typename XprType::Scalar value_type;
443 
444  protected:
445  enum {
448  };
449 
451  using Base::m_index;
452  using Base::mp_xpr;
453 
454  // TODO currently const Transpose/Reshape expressions never returns const references,
455  // so lets return by value too.
456  // typedef std::conditional_t<bool(has_direct_access), const value_type&, const value_type> read_only_ref_t;
458 
459  public:
460  typedef std::conditional_t<bool(is_lvalue), value_type*, const value_type*> pointer;
461  typedef std::conditional_t<bool(is_lvalue), value_type&, read_only_ref_t> reference;
462 
464  generic_randaccess_stl_iterator(XprType& xpr, Index index) : Base(xpr, index) {}
466  using Base::operator=;
467 
468  reference operator*() const { return (*mp_xpr)(m_index); }
469  reference operator[](Index i) const { return (*mp_xpr)(m_index + i); }
470  pointer operator->() const { return &((*mp_xpr)(m_index)); }
471 };
472 
473 template <typename XprType_, DirectionType Direction>
475  typedef XprType_ XprType;
478 };
479 
480 template <typename XprType, DirectionType Direction>
481 class subvector_stl_iterator : public indexed_based_stl_iterator_base<subvector_stl_iterator<XprType, Direction>> {
482  protected:
484 
486  using Base::m_index;
487  using Base::mp_xpr;
488 
489  typedef std::conditional_t<Direction == Vertical, typename XprType::ColXpr, typename XprType::RowXpr> SubVectorType;
490  typedef std::conditional_t<Direction == Vertical, typename XprType::ConstColXpr, typename XprType::ConstRowXpr>
492 
493  public:
494  typedef std::conditional_t<bool(is_lvalue), SubVectorType, ConstSubVectorType> reference;
495  typedef typename reference::PlainObject value_type;
496 
497  private:
499  public:
500  subvector_stl_iterator_ptr(const reference& subvector) : m_subvector(subvector) {}
502 
503  private:
505  };
506 
507  public:
509 
511  subvector_stl_iterator(XprType& xpr, Index index) : Base(xpr, index) {}
512 
513  reference operator*() const { return (*mp_xpr).template subVector<Direction>(m_index); }
514  reference operator[](Index i) const { return (*mp_xpr).template subVector<Direction>(m_index + i); }
515  pointer operator->() const { return (*mp_xpr).template subVector<Direction>(m_index); }
516 };
517 
518 template <typename XprType_, DirectionType Direction>
520  typedef XprType_ XprType;
523 };
524 
525 template <typename XprType, DirectionType Direction>
527  : public indexed_based_stl_reverse_iterator_base<subvector_stl_reverse_iterator<XprType, Direction>> {
528  protected:
530 
532  using Base::m_index;
533  using Base::mp_xpr;
534 
535  typedef std::conditional_t<Direction == Vertical, typename XprType::ColXpr, typename XprType::RowXpr> SubVectorType;
536  typedef std::conditional_t<Direction == Vertical, typename XprType::ConstColXpr, typename XprType::ConstRowXpr>
538 
539  public:
540  typedef std::conditional_t<bool(is_lvalue), SubVectorType, ConstSubVectorType> reference;
541  typedef typename reference::PlainObject value_type;
542 
543  private:
545  public:
546  subvector_stl_reverse_iterator_ptr(const reference& subvector) : m_subvector(subvector) {}
548 
549  private:
551  };
552 
553  public:
555 
557  subvector_stl_reverse_iterator(XprType& xpr, Index index) : Base(xpr, index) {}
558 
559  reference operator*() const { return (*mp_xpr).template subVector<Direction>(m_index); }
560  reference operator[](Index i) const { return (*mp_xpr).template subVector<Direction>(m_index + i); }
561  pointer operator->() const { return (*mp_xpr).template subVector<Direction>(m_index); }
562 };
563 
564 } // namespace internal
565 
570 template <typename Derived>
573  return iterator(derived(), 0);
574 }
575 
577 template <typename Derived>
579  return cbegin();
580 }
581 
586 template <typename Derived>
589  return const_iterator(derived(), 0);
590 }
591 
596 template <typename Derived>
599  return iterator(derived(), size());
600 }
601 
603 template <typename Derived>
605  return cend();
606 }
607 
612 template <typename Derived>
615  return const_iterator(derived(), size());
616 }
617 
618 } // namespace Eigen
619 
620 #endif // EIGEN_STLITERATORS_H
int i
Definition: BiCGSTAB_step_by_step.cpp:9
Direction
An enum that indicates the direction in Cartesian coordinates.
Definition: GeneralDefine.h:56
#define eigen_assert(x)
Definition: Macros.h:910
#define EIGEN_NO_THROW
Definition: Macros.h:1269
#define EIGEN_STATIC_ASSERT_VECTOR_ONLY(TYPE)
Definition: StaticAssert.h:36
Scalar Scalar int size
Definition: benchVecAdd.cpp:17
Scalar * b
Definition: benchVecAdd.cpp:17
SCALAR Scalar
Definition: bench_gemm.cpp:45
Generic expression where a coefficient-wise binary operator is applied to two expressions.
Definition: CwiseBinaryOp.h:79
iterator begin()
Definition: StlIterators.h:571
std::conditional_t< IsVectorAtCompileTime, const_iterator_type, void > const_iterator
Definition: DenseBase.h:590
iterator end()
Definition: StlIterators.h:597
const_iterator cbegin() const
Definition: StlIterators.h:587
const_iterator cend() const
Definition: StlIterators.h:613
std::conditional_t< IsVectorAtCompileTime, iterator_type, void > iterator
Definition: DenseBase.h:588
generic_randaccess_stl_iterator(XprType &xpr, Index index)
Definition: StlIterators.h:464
Index m_index
Definition: StlIterators.h:166
XprType * mp_xpr
Definition: StlIterators.h:165
pointer operator->() const
Definition: StlIterators.h:470
generic_randaccess_stl_iterator(const typename Base::non_const_iterator &other)
Definition: StlIterators.h:465
indexed_based_stl_iterator_base< generic_randaccess_stl_iterator > Base
Definition: StlIterators.h:450
std::conditional_t< bool(is_lvalue), value_type *, const value_type * > pointer
Definition: StlIterators.h:460
reference operator*() const
Definition: StlIterators.h:468
std::conditional_t< bool(is_lvalue), value_type &, read_only_ref_t > reference
Definition: StlIterators.h:461
const value_type read_only_ref_t
Definition: StlIterators.h:457
XprType::Scalar value_type
Definition: StlIterators.h:442
reference operator[](Index i) const
Definition: StlIterators.h:469
generic_randaccess_stl_iterator()
Definition: StlIterators.h:463
Derived & operator++()
Definition: StlIterators.h:51
Index difference_type
Definition: StlIterators.h:36
Derived operator--(int)
Definition: StlIterators.h:65
Index m_index
Definition: StlIterators.h:166
indexed_based_stl_iterator_base & operator=(const non_const_iterator &other)
Definition: StlIterators.h:45
XprType * mp_xpr
Definition: StlIterators.h:165
indexed_based_stl_iterator_base< typename traits::const_iterator > const_iterator
Definition: StlIterators.h:29
friend Derived operator+(const indexed_based_stl_iterator_base &a, Index b)
Definition: StlIterators.h:71
indexed_based_stl_iterator_base< typename traits::non_const_iterator > non_const_iterator
Definition: StlIterators.h:28
Derived & operator+=(Index b)
Definition: StlIterators.h:92
bool operator<=(const other_iterator &other) const
Definition: StlIterators.h:148
bool operator==(const indexed_based_stl_iterator_base &other) const
Definition: StlIterators.h:111
bool operator!=(const indexed_based_stl_iterator_base &other) const
Definition: StlIterators.h:115
traits::XprType XprType
Definition: StlIterators.h:27
indexed_based_stl_iterator_traits< Derived > traits
Definition: StlIterators.h:26
bool operator!=(const other_iterator &other) const
Definition: StlIterators.h:140
Derived & derived()
Definition: StlIterators.h:162
bool operator>(const indexed_based_stl_iterator_base &other) const
Definition: StlIterators.h:127
bool operator<=(const indexed_based_stl_iterator_base &other) const
Definition: StlIterators.h:123
difference_type operator-(const indexed_based_stl_iterator_base &other) const
Definition: StlIterators.h:101
std::random_access_iterator_tag iterator_category
Definition: StlIterators.h:37
friend Derived operator+(Index a, const indexed_based_stl_iterator_base &b)
Definition: StlIterators.h:81
Derived operator++(int)
Definition: StlIterators.h:60
friend Derived operator-(const indexed_based_stl_iterator_base &a, Index b)
Definition: StlIterators.h:76
indexed_based_stl_iterator_base(const non_const_iterator &other) EIGEN_NO_THROW
Definition: StlIterators.h:42
bool operator==(const other_iterator &other) const
Definition: StlIterators.h:136
bool operator>(const other_iterator &other) const
Definition: StlIterators.h:152
Derived & operator--()
Definition: StlIterators.h:55
Derived & operator-=(Index b)
Definition: StlIterators.h:96
std::conditional_t< internal::is_const< XprType >::value, non_const_iterator, const_iterator > other_iterator
Definition: StlIterators.h:30
bool operator>=(const indexed_based_stl_iterator_base &other) const
Definition: StlIterators.h:131
friend Derived operator-(Index a, const indexed_based_stl_iterator_base &b)
Definition: StlIterators.h:86
bool operator>=(const other_iterator &other) const
Definition: StlIterators.h:156
indexed_based_stl_iterator_base(XprType &xpr, Index index) EIGEN_NO_THROW
Definition: StlIterators.h:40
bool operator<(const indexed_based_stl_iterator_base &other) const
Definition: StlIterators.h:119
bool operator<(const other_iterator &other) const
Definition: StlIterators.h:144
const Derived & derived() const
Definition: StlIterators.h:163
difference_type operator-(const other_iterator &other) const
Definition: StlIterators.h:106
bool operator<=(const other_iterator &other) const
Definition: StlIterators.h:294
bool operator>(const other_iterator &other) const
Definition: StlIterators.h:298
bool operator==(const other_iterator &other) const
Definition: StlIterators.h:282
bool operator<(const other_iterator &other) const
Definition: StlIterators.h:290
Derived & derived()
Definition: StlIterators.h:308
std::random_access_iterator_tag iterator_category
Definition: StlIterators.h:183
difference_type operator-(const indexed_based_stl_reverse_iterator_base &other) const
Definition: StlIterators.h:247
bool operator>=(const other_iterator &other) const
Definition: StlIterators.h:302
traits::XprType XprType
Definition: StlIterators.h:173
bool operator>(const indexed_based_stl_reverse_iterator_base &other) const
Definition: StlIterators.h:273
friend Derived operator+(const indexed_based_stl_reverse_iterator_base &a, Index b)
Definition: StlIterators.h:217
bool operator<=(const indexed_based_stl_reverse_iterator_base &other) const
Definition: StlIterators.h:269
indexed_based_stl_reverse_iterator_base(const non_const_iterator &other)
Definition: StlIterators.h:188
std::conditional_t< internal::is_const< XprType >::value, non_const_iterator, const_iterator > other_iterator
Definition: StlIterators.h:176
difference_type operator-(const other_iterator &other) const
Definition: StlIterators.h:252
bool operator==(const indexed_based_stl_reverse_iterator_base &other) const
Definition: StlIterators.h:257
Derived operator--(int)
Definition: StlIterators.h:211
friend Derived operator-(Index a, const indexed_based_stl_reverse_iterator_base &b)
Definition: StlIterators.h:232
bool operator!=(const indexed_based_stl_reverse_iterator_base &other) const
Definition: StlIterators.h:261
indexed_based_stl_iterator_traits< Derived > traits
Definition: StlIterators.h:172
const Derived & derived() const
Definition: StlIterators.h:309
bool operator>=(const indexed_based_stl_reverse_iterator_base &other) const
Definition: StlIterators.h:277
XprType * mp_xpr
Definition: StlIterators.h:311
indexed_based_stl_reverse_iterator_base< typename traits::const_iterator > const_iterator
Definition: StlIterators.h:175
Derived & operator--()
Definition: StlIterators.h:201
bool operator<(const indexed_based_stl_reverse_iterator_base &other) const
Definition: StlIterators.h:265
friend Derived operator+(Index a, const indexed_based_stl_reverse_iterator_base &b)
Definition: StlIterators.h:227
indexed_based_stl_reverse_iterator_base & operator=(const non_const_iterator &other)
Definition: StlIterators.h:191
friend Derived operator-(const indexed_based_stl_reverse_iterator_base &a, Index b)
Definition: StlIterators.h:222
bool operator!=(const other_iterator &other) const
Definition: StlIterators.h:286
indexed_based_stl_reverse_iterator_base< typename traits::non_const_iterator > non_const_iterator
Definition: StlIterators.h:174
Derived & operator++()
Definition: StlIterators.h:197
indexed_based_stl_reverse_iterator_base(XprType &xpr, Index index)
Definition: StlIterators.h:186
Derived & operator+=(Index b)
Definition: StlIterators.h:238
Derived operator++(int)
Definition: StlIterators.h:206
Derived & operator-=(Index b)
Definition: StlIterators.h:242
Index difference_type
Definition: StlIterators.h:182
Definition: StlIterators.h:316
bool operator<=(const pointer_based_stl_iterator &other) const
Definition: StlIterators.h:415
pointer_based_stl_iterator operator++(int)
Definition: StlIterators.h:365
bool operator>=(const pointer_based_stl_iterator &other) const
Definition: StlIterators.h:417
pointer m_ptr
Definition: StlIterators.h:427
bool operator==(const other_iterator &other) const
Definition: StlIterators.h:419
reference operator[](Index i) const
Definition: StlIterators.h:353
bool operator>(const other_iterator &other) const
Definition: StlIterators.h:423
std::random_access_iterator_tag iterator_category
Definition: StlIterators.h:333
Index difference_type
Definition: StlIterators.h:326
bool operator!=(const other_iterator &other) const
Definition: StlIterators.h:420
pointer_based_stl_iterator operator--(int)
Definition: StlIterators.h:370
XprType::Scalar value_type
Definition: StlIterators.h:327
bool operator>=(const other_iterator &other) const
Definition: StlIterators.h:424
std::conditional_t< bool(is_lvalue), value_type *, const value_type * > pointer
Definition: StlIterators.h:335
difference_type operator-(const pointer_based_stl_iterator &other) const
Definition: StlIterators.h:406
pointer_based_stl_iterator< std::add_const_t< XprType > > const_iterator
Definition: StlIterators.h:319
friend pointer_based_stl_iterator operator+(const pointer_based_stl_iterator &a, Index b)
Definition: StlIterators.h:376
pointer_based_stl_iterator & operator++()
Definition: StlIterators.h:356
friend pointer_based_stl_iterator operator-(const pointer_based_stl_iterator &a, Index b)
Definition: StlIterators.h:381
pointer_based_stl_iterator(const non_const_iterator &other) EIGEN_NO_THROW
Definition: StlIterators.h:343
bool operator!=(const pointer_based_stl_iterator &other) const
Definition: StlIterators.h:413
std::conditional_t< internal::is_const< XprType >::value, non_const_iterator, const_iterator > other_iterator
Definition: StlIterators.h:320
difference_type operator-(const other_iterator &other) const
Definition: StlIterators.h:410
pointer_based_stl_iterator & operator-=(Index b)
Definition: StlIterators.h:401
bool operator<(const other_iterator &other) const
Definition: StlIterators.h:421
pointer operator->() const
Definition: StlIterators.h:354
pointer_based_stl_iterator(XprType &xpr, Index index) EIGEN_NO_THROW
Definition: StlIterators.h:339
friend pointer_based_stl_iterator operator+(Index a, const pointer_based_stl_iterator &b)
Definition: StlIterators.h:386
pointer_based_stl_iterator & operator+=(Index b)
Definition: StlIterators.h:397
reference operator*() const
Definition: StlIterators.h:352
bool operator<=(const other_iterator &other) const
Definition: StlIterators.h:422
internal::variable_if_dynamic< Index, XprType::InnerStrideAtCompileTime > m_incr
Definition: StlIterators.h:428
pointer_based_stl_iterator & operator=(const non_const_iterator &other) EIGEN_NO_THROW
Definition: StlIterators.h:346
friend pointer_based_stl_iterator operator-(Index a, const pointer_based_stl_iterator &b)
Definition: StlIterators.h:391
bool operator==(const pointer_based_stl_iterator &other) const
Definition: StlIterators.h:412
pointer_based_stl_iterator & operator--()
Definition: StlIterators.h:360
bool operator>(const pointer_based_stl_iterator &other) const
Definition: StlIterators.h:416
bool operator<(const pointer_based_stl_iterator &other) const
Definition: StlIterators.h:414
std::conditional_t< bool(is_lvalue), value_type &, const value_type & > reference
Definition: StlIterators.h:336
pointer_based_stl_iterator< std::remove_const_t< XprType > > non_const_iterator
Definition: StlIterators.h:318
subvector_stl_iterator_ptr(const reference &subvector)
Definition: StlIterators.h:500
reference * operator->()
Definition: StlIterators.h:501
Definition: StlIterators.h:481
Index m_index
Definition: StlIterators.h:166
subvector_stl_iterator(XprType &xpr, Index index)
Definition: StlIterators.h:511
indexed_based_stl_iterator_base< subvector_stl_iterator > Base
Definition: StlIterators.h:485
std::conditional_t< Direction==Vertical, typename XprType::ConstColXpr, typename XprType::ConstRowXpr > ConstSubVectorType
Definition: StlIterators.h:491
subvector_stl_iterator_ptr pointer
Definition: StlIterators.h:508
reference operator[](Index i) const
Definition: StlIterators.h:514
std::conditional_t< Direction==Vertical, typename XprType::ColXpr, typename XprType::RowXpr > SubVectorType
Definition: StlIterators.h:489
pointer operator->() const
Definition: StlIterators.h:515
std::conditional_t< bool(is_lvalue), SubVectorType, ConstSubVectorType > reference
Definition: StlIterators.h:494
reference::PlainObject value_type
Definition: StlIterators.h:495
subvector_stl_iterator()
Definition: StlIterators.h:510
reference operator*() const
Definition: StlIterators.h:513
subvector_stl_reverse_iterator_ptr(const reference &subvector)
Definition: StlIterators.h:546
reference::PlainObject value_type
Definition: StlIterators.h:541
indexed_based_stl_reverse_iterator_base< subvector_stl_reverse_iterator > Base
Definition: StlIterators.h:531
std::conditional_t< Direction==Vertical, typename XprType::ColXpr, typename XprType::RowXpr > SubVectorType
Definition: StlIterators.h:535
subvector_stl_reverse_iterator()
Definition: StlIterators.h:556
reference operator*() const
Definition: StlIterators.h:559
std::conditional_t< Direction==Vertical, typename XprType::ConstColXpr, typename XprType::ConstRowXpr > ConstSubVectorType
Definition: StlIterators.h:537
reference operator[](Index i) const
Definition: StlIterators.h:560
subvector_stl_reverse_iterator(XprType &xpr, Index index)
Definition: StlIterators.h:557
pointer operator->() const
Definition: StlIterators.h:561
std::conditional_t< bool(is_lvalue), SubVectorType, ConstSubVectorType > reference
Definition: StlIterators.h:540
subvector_stl_reverse_iterator_ptr pointer
Definition: StlIterators.h:554
Index m_index
Definition: StlIterators.h:312
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void setValue(T v) const
Definition: XprHelper.h:163
static EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE EIGEN_CONSTEXPR T value()
Definition: XprHelper.h:161
const unsigned int DirectAccessBit
Definition: Constants.h:159
Eigen::DenseIndex ret
Definition: level1_cplx_impl.h:43
const Scalar * a
Definition: level2_cplx_impl.h:32
Namespace containing all symbols from the Eigen library.
Definition: bench_norm.cpp:70
squared absolute value
Definition: GlobalFunctions.h:87
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:83
Definition: Eigen_Colamd.h:49
CwiseBinaryOp< internal::scalar_sum_op< double, double >, const CpyMatrixXd, const CpyMatrixXd > XprType
Definition: nestbyvalue.cpp:15
Definition: ForwardDeclarations.h:31
generic_randaccess_stl_iterator< std::remove_const_t< XprType > > non_const_iterator
Definition: StlIterators.h:434
generic_randaccess_stl_iterator< std::add_const_t< XprType > > const_iterator
Definition: StlIterators.h:435
subvector_stl_iterator< std::add_const_t< XprType >, Direction > const_iterator
Definition: StlIterators.h:477
subvector_stl_iterator< std::remove_const_t< XprType >, Direction > non_const_iterator
Definition: StlIterators.h:476
subvector_stl_reverse_iterator< std::add_const_t< XprType >, Direction > const_iterator
Definition: StlIterators.h:522
subvector_stl_reverse_iterator< std::remove_const_t< XprType >, Direction > non_const_iterator
Definition: StlIterators.h:521
Definition: XprHelper.h:819
Definition: ForwardDeclarations.h:21