|
|
lucid
0.0.1
Lifting-based Uncertain Control Invariant Dynamics
|
Utility class to iterate over all elements of a tensor. More...
#include <TensorIterator.h>
Public Member Functions | |
| TensorIterator (const TensorView< T > &tensor, bool end=false) | |
| Construct a new TensorIterator object. | |
| const std::vector< Index > & | indexes () const |
| Get read-only access to the indexes of the tensor. | |
| const IndexIterator< std::vector< Index > > & | index_iterator () const |
| Get read-only access to the index iterator of the tensor. | |
Private Attributes | |
| IndexIterator< std::vector< Index > > | indexes_ |
| Iterator used to go through all elements of the tensor. | |
| const TensorView< T > & | tensor_ |
| Tensor to iterate over. | |
Utility class to iterate over all elements of a tensor.
They will be visited in order, avoiding the need to use nested loops and hiding the memory layout and strides.
| T | type of the elements in the tensor |
|
explicit |
Construct a new TensorIterator object.
| tensor | tensor to iterate over |
| end | if true, the iterator will be exhausted immediately, indicating that there is nothing else to iterate |
|
inlinenodiscard |
Get read-only access to the index iterator of the tensor.
|
inlinenodiscard |
Get read-only access to the indexes of the tensor.