Tomographer
v5.2
Tomographer C++ Framework Documentation
|
A list of indices with an API for linear or subindices access. More...
#include <tomographer/tools/ezmatio.h>
Public Types | |
typedef std::vector< int > | VectorType |
Base vector type (superclass) | |
Public Member Functions | |
IndexList (const std::vector< int > &dims=std::vector< int >(), int linearindex=-1) | |
Constructor with linear index. More... | |
template<typename VectorIntInitializer > | |
IndexList (const std::vector< int > &dims, VectorIntInitializer &&index) | |
Constructor with multidimensional index specification. More... | |
template<ENABLED_IF( IsRowMajor) > | |
void | setLinearIndex (int linearindex) |
Set the linear index. More... | |
template<ENABLED_IF( !IsRowMajor) > | |
void | setLinearIndex (int linearindex) |
Set the linear index. More... | |
template<ENABLED_IF( IsRowMajor) > | |
int | linearIndex () const |
Linear index corresponding to the stored multidimensional indices. More... | |
template<ENABLED_IF( !IsRowMajor) > | |
int | linearIndex () const |
Linear index corresponding to the stored multidimensional indices. More... | |
const std::vector< int > & | index () const |
Return a reference to *this . | |
const std::vector< int > & | dims () const |
Get the underlying dimensions given to the constructor. More... | |
IndexList & | operator<< (int ind) |
Append index to list. More... | |
IndexList & | operator<< (const std::vector< int > &moredims) |
Append a list of indices to list. More... | |
Public Member Functions inherited from std::vector< int > | |
int | push_back (int ... args) |
int | crbegin (int ... args) |
int | erase (int ... args) |
int | data (int ... args) |
int | insert (int ... args) |
int | pop_back (int ... args) |
int | shrink_to_fit (int ... args) |
int | back (int ... args) |
int | end (int ... args) |
int | resize (int ... args) |
int | emplace_back (int ... args) |
int | size (int ... args) |
int | cbegin (int ... args) |
int | front (int ... args) |
int | ~vector (int ... args) |
int | rbegin (int ... args) |
int | crend (int ... args) |
int | assign (int ... args) |
int | operator= (int ... args) |
int | vector (int ... args) |
int | reserve (int ... args) |
int | capacity (int ... args) |
int | empty (int ... args) |
int | cend (int ... args) |
int | swap (int ... args) |
int | max_size (int ... args) |
int | rend (int ... args) |
int | get_allocator (int ... args) |
int | clear (int ... args) |
int | at (int ... args) |
int | emplace (int ... args) |
int | operator[] (int ... args) |
int | begin (int ... args) |
Static Public Member Functions | |
template<bool IsRowMajor2 = false> | |
static const std::vector< int > & | forward_index (const IndexList< IsRowMajor2 > &index) |
template<bool IsRowMajor2 = false> | |
static std::vector< int > && | forward_index (IndexList< IsRowMajor2 > &&index) |
Static Public Attributes | |
static constexpr bool | IsRowMajor = IsRowMajor_ |
Is this class calculating and expecting row-major (true ) or column-major (false ) format. | |
Additional Inherited Members | |
Public Attributes inherited from std::vector< int > | |
int | elements |
STL member. | |
A list of indices with an API for linear or subindices access.
This subclass of std::vector<int> stores indices into a multi-dimensional array, and adds utilities to access the data with a linear index (i.e. linear memory access model) in either column-major or row-major format.
If RowMajor is true
, then the linear indices in this class are given and calculated in row-major format; if false
, in column-major format. See Eigen's page on storage orders.
|
inline |
|
inline |
Constructor with multidimensional index specification.
The second argument is any (single-argument) initializer which can be used as constructor in a std::vector<int>.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |