10 #ifndef EIGEN_STLITERATORS_H
11 #define EIGEN_STLITERATORS_H
20 template <
typename IteratorType>
23 template <
typename Derived>
72 Derived
ret(
a.derived());
77 Derived
ret(
a.derived());
82 Derived
ret(
b.derived());
87 Derived
ret(
b.derived());
108 return m_index - other.m_index;
138 return m_index == other.m_index;
142 return m_index != other.m_index;
146 return m_index < other.m_index;
150 return m_index <= other.m_index;
154 return m_index > other.m_index;
158 return m_index >= other.m_index;
162 Derived&
derived() {
return static_cast<Derived&
>(*this); }
163 const Derived&
derived()
const {
return static_cast<const Derived&
>(*this); }
169 template <
typename Derived>
218 Derived
ret(
a.derived());
223 Derived
ret(
a.derived());
228 Derived
ret(
b.derived());
233 Derived
ret(
b.derived());
254 return other.m_index -
m_index;
284 return m_index == other.m_index;
288 return m_index != other.m_index;
292 return m_index > other.m_index;
296 return m_index >= other.m_index;
300 return m_index < other.m_index;
304 return m_index <= other.m_index;
308 Derived&
derived() {
return static_cast<Derived&
>(*this); }
309 const Derived&
derived()
const {
return static_cast<const Derived&
>(*this); }
315 template <
typename XprType>
328 #if EIGEN_CPLUSPLUS >= 202002L
329 typedef std::conditional_t<XprType::InnerStrideAtCompileTime == 1, std::contiguous_iterator_tag,
330 std::random_access_iterator_tag>
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;
431 template <
typename XprType_>
438 template <
typename XprType>
466 using Base::operator=;
473 template <
typename XprType_, DirectionType Direction>
480 template <
typename XprType, DirectionType Direction>
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>
518 template <
typename XprType_, DirectionType Direction>
525 template <
typename XprType, DirectionType Direction>
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>
570 template <
typename Derived>
577 template <
typename Derived>
586 template <
typename Derived>
596 template <
typename Derived>
603 template <
typename Derived>
612 template <
typename Derived>
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
Definition: StlIterators.h:440
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
Definition: StlIterators.h:24
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
Definition: StlIterators.h:170
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
Index m_index
Definition: StlIterators.h:312
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
Definition: StlIterators.h:498
subvector_stl_iterator_ptr(const reference &subvector)
Definition: StlIterators.h:500
reference * operator->()
Definition: StlIterators.h:501
reference m_subvector
Definition: StlIterators.h:504
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
Definition: StlIterators.h:544
reference * operator->()
Definition: StlIterators.h:547
reference m_subvector
Definition: StlIterators.h:550
subvector_stl_reverse_iterator_ptr(const reference &subvector)
Definition: StlIterators.h:546
Definition: StlIterators.h:527
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
XprType_ XprType
Definition: StlIterators.h:433
subvector_stl_iterator< std::add_const_t< XprType >, Direction > const_iterator
Definition: StlIterators.h:477
XprType_ XprType
Definition: StlIterators.h:475
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
XprType_ XprType
Definition: StlIterators.h:520
Definition: StlIterators.h:21
Definition: XprHelper.h:819
Definition: ForwardDeclarations.h:21