#include <ShapeRange.h>
Definition at line 28 of file ShapeRange.h.
◆ operator!=()
bool mir::ShapeIter::operator!= |
( |
const ShapeIter & |
iter | ) |
const |
|
inline |
Definition at line 60 of file ShapeRange.h.
61 {
62 assert(iter._index.rank() == _index.
rank());
63 assert(iter._shape == _shape);
64 return _pos != iter._pos;
65 }
References mir::Index::rank().
◆ operator*()
const Index & mir::ShapeIter::operator* |
( |
| ) |
const |
|
inline |
◆ operator++() [1/2]
Definition at line 32 of file ShapeRange.h.
33 {
34 if (_shape.
rank() > 0)
35 {
36 auto *pidx = &_index.
at(0);
37 auto *pshape = &_shape.
dim(0);
38 int32_t rank = _shape.
rank();
39 int32_t c = rank - 1;
40 pidx[c]++;
41 while (pidx[c] >= pshape[c] && c > 0)
42 {
43 pidx[c] = 0;
44 pidx[--c]++;
45 }
46 }
47 _pos++;
48 return *this;
49 }
int32_t & at(int32_t axis)
return position on given axis
int32_t & dim(int32_t axis) noexcept
References mir::Index::at(), mir::Shape::dim(), and mir::Shape::rank().
◆ operator++() [2/2]
const ShapeIter mir::ShapeIter::operator++ |
( |
int |
| ) |
|
|
inline |
Definition at line 51 of file ShapeRange.h.
52 {
53 ShapeIter it = *this;
54 ++*this;
55 return it;
56 }
◆ ShapeRange
The documentation for this class was generated from the following file: