An array of ints which specifies a list of dimensions.
More...
#include <tomographer/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 306 of file ezmatio.h.
§ DimList() [1/3]
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 318 of file ezmatio.h.
§ DimList() [2/3]
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 334 of file ezmatio.h.
§ DimList() [3/3]
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 344 of file ezmatio.h.
§ matchesWanted()
bool Tomographer::MAT::DimList::matchesWanted |
( |
const DimList & |
wanted | ) |
const |
|
inline |
Test whether our dimensions match the given required list of dimensions.
Definition at line 364 of file ezmatio.h.
§ ndims()
int Tomographer::MAT::DimList::ndims |
( |
| ) |
const |
|
inline |
§ numel()
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 352 of file ezmatio.h.
§ operator<<() [1/2]
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 382 of file ezmatio.h.
§ operator<<() [2/2]
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 391 of file ezmatio.h.
The documentation for this class was generated from the following file: