RowMajorIterator< M, IsConst > Class Template Reference
|
CPP API
|
iterate over elements of eigen matrix expressions in row major order. More...
#include <eigen_util.h>
Classes | |
| struct | Proxy |
Public Types | |
| using | difference_type = Eigen::Index |
| using | iterator_category = std::random_access_iterator_tag |
| using | MatrixPtr = std::conditional_t< IsConst, const M *, M * > |
| using | MatrixRef = std::conditional_t< IsConst, const M &, M & > |
| using | pointer = std::conditional_t< details::IsElementReference< MatrixRef >, std::conditional_t< IsConst, const value_type *, value_type * >, Proxy > |
| using | reference = std::conditional_t< IsConst, const value_type &, value_type & > |
| using | value_type = typename M::Scalar |
Public Member Functions | |
| bool | operator!= (const RowMajorIterator &other) const |
| inequality comparison operator. More... | |
| decltype(auto) | operator* () const |
| dereference this to get the element pointed to. More... | |
| RowMajorIterator | operator+ (difference_type n) const |
| random access, add n to index of this. More... | |
| RowMajorIterator & | operator++ () |
| pre increment operator. More... | |
| RowMajorIterator | operator++ (int) |
| post increment operator. More... | |
| RowMajorIterator & | operator+= (difference_type n) |
| add n to index of this. More... | |
| RowMajorIterator | operator- (difference_type n) const |
| take n from the index of this. More... | |
| difference_type | operator- (RowMajorIterator r) const |
| calculate the distance between this and r. More... | |
| RowMajorIterator & | operator-- () |
| pre decrement operator. More... | |
| RowMajorIterator | operator-- (int) |
| post decrement operator. More... | |
| RowMajorIterator & | operator-= (difference_type n) |
| take n from the index of this. More... | |
| bool | operator< (const RowMajorIterator &other) const |
| lesser comparison operator. More... | |
| bool | operator<= (const RowMajorIterator &other) const |
| lesser equal comparison operator. More... | |
| bool | operator== (const RowMajorIterator &other) const |
| equality comparison operator. More... | |
| bool | operator> (const RowMajorIterator &other) const |
| greater than comparison operator. More... | |
| bool | operator>= (const RowMajorIterator &other) const |
| greater equal comparison operator. More... | |
| RowMajorIterator () | |
| RowMajorIterator (MatrixRef m, Eigen::Index i) | |
| Create an iterator that points to a specific element. More... | |
| pointer | operator-> () const requires details |
| get a pointer to the element this iterator points to. More... | |
Private Attributes | |
| Eigen::Index | m_i |
| MatrixPtr | m_matrix |
Friends | |
| RowMajorIterator | operator+ (difference_type n, const RowMajorIterator &iter) |
| random access, add n to index of iterator. More... | |
Detailed Description
template<class M, bool IsConst = false>
class mio::RowMajorIterator< M, IsConst >
iterate over elements of eigen matrix expressions in row major order.
- Template Parameters
-
M an eigen matrix expression type, can be in memory or lazy. IsConst true if the elements of the matrix are not modifiable.
Member Typedef Documentation
◆ difference_type
| using mio::RowMajorIterator< M, IsConst >::difference_type = Eigen::Index |
◆ iterator_category
| using mio::RowMajorIterator< M, IsConst >::iterator_category = std::random_access_iterator_tag |
◆ MatrixPtr
| using mio::RowMajorIterator< M, IsConst >::MatrixPtr = std::conditional_t<IsConst, const M*, M*> |
◆ MatrixRef
| using mio::RowMajorIterator< M, IsConst >::MatrixRef = std::conditional_t<IsConst, const M&, M&> |
◆ pointer
| using mio::RowMajorIterator< M, IsConst >::pointer = std::conditional_t<details::IsElementReference<MatrixRef>, std::conditional_t<IsConst, const value_type*, value_type*>, Proxy> |
◆ reference
| using mio::RowMajorIterator< M, IsConst >::reference = std::conditional_t<IsConst, const value_type&, value_type&> |
◆ value_type
| using mio::RowMajorIterator< M, IsConst >::value_type = typename M::Scalar |
Constructor & Destructor Documentation
◆ RowMajorIterator() [1/2]
|
inline |
Create an iterator that points to a specific element.
Indexing is done by flat indices i = r * nc + c where r is the row index, c is the column index and nc is the number of columns.
- Parameters
-
m reference of a matrix expression. Only a reference is stored, mind the lifetime of the object. i flat index of the element pointed to.
◆ RowMajorIterator() [2/2]
|
inlineexplicit |
Member Function Documentation
◆ operator!=()
|
inline |
inequality comparison operator.
◆ operator*()
|
inline |
dereference this to get the element pointed to.
may return a temporary value instead of a reference to the element if the matrix is not evaluated in memory, e.g. in the case of Eigen::MatrixXd::Constant(r, c, v).
◆ operator+()
|
inline |
random access, add n to index of this.
◆ operator++() [1/2]
|
inline |
pre increment operator.
◆ operator++() [2/2]
|
inline |
post increment operator.
◆ operator+=()
|
inline |
add n to index of this.
◆ operator-() [1/2]
|
inline |
take n from the index of this.
◆ operator-() [2/2]
|
inline |
calculate the distance between this and r.
◆ operator--() [1/2]
|
inline |
pre decrement operator.
◆ operator--() [2/2]
|
inline |
post decrement operator.
◆ operator-=()
|
inline |
take n from the index of this.
◆ operator->()
|
inline |
get a pointer to the element this iterator points to.
may return a proxy instead of a reference to the element if the matrix is not evaluated in memory, e.g. in the case of Eigen::MatrixXd::Constant(r, c, v). The proxy stores a copy of the element and forwards the address of this copy.
◆ operator<()
|
inline |
lesser comparison operator.
◆ operator<=()
|
inline |
lesser equal comparison operator.
◆ operator==()
|
inline |
equality comparison operator.
◆ operator>()
|
inline |
greater than comparison operator.
◆ operator>=()
|
inline |
greater equal comparison operator.
Friends And Related Function Documentation
◆ operator+
|
friend |
random access, add n to index of iterator.
Member Data Documentation
◆ m_i
|
private |
◆ m_matrix
|
private |
Generated by