An array of ints which specifies a list of dimensions.
More...
#include <tomographer2/tools/ezmatio.h>
An array of ints which specifies a list of dimensions.
This utility may be used to specify a list of dimensions for a N-D array. It is a subclass of std::vector<int>, and implements some additional functions such as numel(), matchesWanted() and operator<<.
You may also use DimList::operator<<(int dim) and DimList::operator<<(const std::vector<int>& moredims) to append dimensions to the list.
Definition at line 304 of file ezmatio.h.
template<typename VectorType >
Tomographer::MAT::DimList::DimList |
( |
VectorType && |
dims | ) |
|
|
inline |
Initialize a dimension list with another list of dimensions.
The dims may be another vector, or another DimList instance. This also works with move semantics.
Definition at line 316 of file ezmatio.h.
template<typename T , ENABLED_IF(std::is_convertible< T) int>
Initialize the dimension list with an explicit initializer.
Enables construction and initialization with the syntax
- Todo:
- Note to self: both syntaxes work, but I'm not sure which constructor exactly the second line calls ...?
Definition at line 332 of file ezmatio.h.
template<class It >
Tomographer::MAT::DimList::DimList |
( |
It |
b, |
|
|
It |
e |
|
) |
| |
|
inline |
Initialize the dimension list with an iterator range.
The dimension list is initialized with begin and end iterators b and e. See std::vector(It b, It e).
Definition at line 342 of file ezmatio.h.
bool Tomographer::MAT::DimList::matchesWanted |
( |
const DimList & |
wanted | ) |
const |
|
inline |
Test whether our dimensions match the given required list of dimensions.
Definition at line 362 of file ezmatio.h.
int Tomographer::MAT::DimList::ndims |
( |
| ) |
const |
|
inline |
int Tomographer::MAT::DimList::numel |
( |
| ) |
const |
|
inline |
Get the total number of elements in an array of these dimensions.
This is simply the product of all elements in the array. See getNumEl().
Definition at line 350 of file ezmatio.h.
DimList& Tomographer::MAT::DimList::operator<< |
( |
int |
dim | ) |
|
|
inline |
Add (append) a dimension to the dimension list.
Pushes the dimension dim at the end of the dimension list, increasing the number of dimensions by one.
Definition at line 380 of file ezmatio.h.
Add (append) dimensions to the dimension list.
Pushes the dimension list moredims at the end of the current dimension list, increasing the number of dimensions by moredims.size().
Definition at line 389 of file ezmatio.h.
The documentation for this class was generated from the following file: