casa
5.7.0-16
|
Info about mapping array axes to another order. More...
#include <AxesMapping.h>
Public Member Functions | |
AxesMapping () | |
The default constructor creates empty maps. More... | |
AxesMapping (const IPosition &oldToNew) | |
Construct it with the mapping from old to new axes order. More... | |
AxesMapping (const AxesMapping &other) | |
Copy constructor (copy semantics). More... | |
~AxesMapping () | |
AxesMapping & | operator= (const AxesMapping &other) |
Assignment (copy semantics). More... | |
Bool | isRemoved () const |
Are axes removed? More... | |
Bool | isReordered () const |
Is the axes order reordered? More... | |
const IPosition & | getToNew () const |
Get the mapping of old->new. More... | |
const IPosition & | getToOld () const |
Get the mapping of new->old. More... | |
IPosition | posToNew (const IPosition &pos) const |
Map an old position to the new one. More... | |
IPosition | posToOld (const IPosition &pos) const |
Map a new position or shape to the old one. More... | |
IPosition | shapeToNew (const IPosition &shape) const |
Map an old shape to the new one. More... | |
IPosition | shapeToOld (const IPosition &shape) const |
Map a new position or shape to the old one. More... | |
Slicer | slicerToNew (const Slicer &slicer) const |
Map an old shape to the new one. More... | |
Slicer | slicerToOld (const Slicer &slicer) const |
Map a new position or shape to the old one. More... | |
Private Attributes | |
IPosition | itsToNew |
IPosition | itsToOld |
Bool | itsRemoved |
Bool | itsReordered |
Info about mapping array axes to another order.
Internal
AxesMapping holds the information about mapping axes to another order. It can be constructed by AxesSpecifier by applying a shape to the axes specification.
AxesMapping is thereafter used to map positions, shapes, and slices to the new axes or backwards.
Caution: Shapes and positions are both represented by class IPosition; However, they have to be treated differently in this class, because removed axes for a position have value 0, while for a shape they have value 1; Hence there are different functions for them and the user has to take care that the correct function is called;
The class encapsulates the mapping functionality. It is meant as a helper class for SubLattice.
Definition at line 87 of file AxesMapping.h.
casacore::AxesMapping::AxesMapping | ( | ) |
The default constructor creates empty maps.
|
explicit |
Construct it with the mapping from old to new axes order.
A value of -1 means that the old axes is ignored in the new one. Another value gives the new axis number.
It determines if axes are removed and/or reordered.
casacore::AxesMapping::AxesMapping | ( | const AxesMapping & | other | ) |
Copy constructor (copy semantics).
casacore::AxesMapping::~AxesMapping | ( | ) |
|
inline |
Get the mapping of old->new.
The length of the resulting IPosition is the dimensionality of the original lattice. A value of -1 indicates that the corresponding axis in the original lattice is removed. Another value is the axis number in the new lattice,
Definition at line 121 of file AxesMapping.h.
References itsToNew.
|
inline |
Get the mapping of new->old.
The length of the resulting IPosition is the dimensionality of the new lattice. Its values give the axes in the original lattice.
Definition at line 127 of file AxesMapping.h.
References itsToOld.
|
inline |
Are axes removed?
Definition at line 109 of file AxesMapping.h.
References itsRemoved.
Referenced by casacore::SubLattice< casacore::Float >::positionInParent().
|
inline |
AxesMapping& casacore::AxesMapping::operator= | ( | const AxesMapping & | other | ) |
Assignment (copy semantics).
This and that do not have to have the same length.
Map an old position to the new one.
In debug-mode it checks if the removed axes have position 0 in the input position.
Map a new position or shape to the old one.
Referenced by casacore::SubLattice< casacore::Float >::positionInParent().
Map an old shape to the new one.
In debug-mode it checks if the removed axes have length 1 in the input shape.
Map a new position or shape to the old one.
Map an old shape to the new one.
In debug-mode it checks if the removed axes have length 1 in the input slicer.
Map a new position or shape to the old one.
|
private |
Definition at line 157 of file AxesMapping.h.
Referenced by isRemoved().
|
private |
Definition at line 158 of file AxesMapping.h.
Referenced by isReordered().
|
private |
Definition at line 155 of file AxesMapping.h.
Referenced by getToNew().
|
private |
Definition at line 156 of file AxesMapping.h.
Referenced by getToOld().