Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
Mantid::DataObjects::CoordTransformAligned Class Reference

Unique type declaration for which dimensions are used in the input workspace. More...

#include <CoordTransformAligned.h>

Inheritance diagram for Mantid::DataObjects::CoordTransformAligned:
Mantid::API::CoordTransform

Public Member Functions

void apply (const coord_t *inputVector, coord_t *outVector) const override
 Apply the coordinate transformation. More...
 
CoordTransformclone () const override
 Virtual cloner. More...
 
 CoordTransformAligned (const size_t inD, const size_t outD, const size_t *dimensionToBinFrom, const coord_t *origin, const coord_t *scaling)
 Constructor. More...
 
 CoordTransformAligned (const size_t inD, const size_t outD, std::vector< size_t > dimensionToBinFrom, std::vector< coord_t > origin, std::vector< coord_t > scaling)
 Constructor. More...
 
std::string id () const override
 Coordinate transform id. More...
 
Mantid::Kernel::Matrix< coord_tmakeAffineMatrix () const override
 Create an equivalent affine transformation matrix out of the parameters of this axis-aligned transformation. More...
 
std::string toXMLString () const override
 Serialize the coordinate transform. More...
 
- Public Member Functions inherited from Mantid::API::CoordTransform
virtual void apply (const coord_t *inputVector, coord_t *outVector) const =0
 
Mantid::Kernel::VMD applyVMD (const Mantid::Kernel::VMD &inputVector) const
 Wrapper for VMD. More...
 
virtual CoordTransformclone () const =0
 
 CoordTransform (const size_t inD, const size_t outD)
 Constructor. More...
 
size_t getInD () const
 
size_t getOutD () const
 
virtual std::string id () const =0
 
virtual Mantid::Kernel::Matrix< coord_tmakeAffineMatrix () const
 
virtual std::string toXMLString () const =0
 Pure abstract methods to be implemented. More...
 
virtual ~CoordTransform ()=default
 

Protected Attributes

std::vector< size_t > m_dimensionToBinFrom
 For each dimension in the output, index in the input workspace of which dimension it is. More...
 
std::vector< coord_tm_origin
 Offset (minimum) position in each of the output dimensions, sized [outD]. More...
 
std::vector< coord_tm_scaling
 Scaling from the input to the output dimension, sized [outD]. More...
 
- Protected Attributes inherited from Mantid::API::CoordTransform
size_t inD
 Input number of dimensions. More...
 
size_t outD
 Output number of dimensions. More...
 

Detailed Description

Unique type declaration for which dimensions are used in the input workspace.

Unique type declaration for the offset of coordinates Unique type declaration for the step size in transformation A restricted version of CoordTransform which transforms from one set of dimensions to another, allowing:

While a normal Affine matrix would handle this case, this special case is used in order to reduce the number of calculation.

Author
Janik Zikovsky
Date
2011-08-29

Definition at line 38 of file CoordTransformAligned.h.

Constructor & Destructor Documentation

◆ CoordTransformAligned() [1/2]

Mantid::DataObjects::CoordTransformAligned::CoordTransformAligned ( const size_t  inD,
const size_t  outD,
const size_t *  dimensionToBinFrom,
const coord_t origin,
const coord_t scaling 
)

Constructor.

Parameters
inD:: input number of dimensions, >= 1
outD:: output number of dimensions, <= inD
dimensionToBinFrom:: For each dimension in the output, index in the input workspace of which dimension it is
origin:: Offset (minimum) position in each of the output dimensions, sized [outD]
scaling:: Scaling from the input to the output dimension, sized [outD]
Exceptions
std::runtime_errorif outD > inD or if an invalid index is in dimensionToBinFrom

Definition at line 30 of file CoordTransformAligned.cpp.

References Mantid::Geometry::d, Mantid::API::CoordTransform::inD, m_dimensionToBinFrom, m_origin, m_scaling, Mantid::API::CoordTransform::outD, and std::to_string().

◆ CoordTransformAligned() [2/2]

Mantid::DataObjects::CoordTransformAligned::CoordTransformAligned ( const size_t  inD,
const size_t  outD,
std::vector< size_t >  dimensionToBinFrom,
std::vector< coord_t origin,
std::vector< coord_t scaling 
)

Constructor.

Parameters
inD:: input number of dimensions, >= 1
outD:: output number of dimensions, <= inD
dimensionToBinFrom:: For each dimension in the output, index in the input workspace of which dimension it is
origin:: Offset (minimum) position in each of the output dimensions, sized [outD]
scaling:: Scaling from the input to the output dimension, sized [outD]
Exceptions
std::runtime_errorif outD > inD or if an invalid index is in dimensionToBinFrom

Definition at line 63 of file CoordTransformAligned.cpp.

References Mantid::Geometry::d, Mantid::API::CoordTransform::inD, m_dimensionToBinFrom, m_origin, m_scaling, Mantid::API::CoordTransform::outD, and std::to_string().

Member Function Documentation

◆ apply()

void Mantid::DataObjects::CoordTransformAligned::apply ( const coord_t inputVector,
coord_t outVector 
) const
overridevirtual

Apply the coordinate transformation.

Parameters
inputVector:: fixed-size array of input coordinates, of size inD
outVector:: fixed-size array of output coordinates, of size outD

Implements Mantid::API::CoordTransform.

Definition at line 93 of file CoordTransformAligned.cpp.

References m_dimensionToBinFrom, m_origin, m_scaling, Mantid::API::CoordTransform::outD, and Mantid::Geometry::x.

Referenced by Mantid::MDAlgorithms::TransposeMD::exec().

◆ clone()

CoordTransform * Mantid::DataObjects::CoordTransformAligned::clone ( ) const
overridevirtual

Virtual cloner.

Returns
a copy of this object

Implements Mantid::API::CoordTransform.

Definition at line 83 of file CoordTransformAligned.cpp.

References Mantid::API::CoordTransform::inD, m_dimensionToBinFrom, m_origin, m_scaling, and Mantid::API::CoordTransform::outD.

◆ id()

std::string Mantid::DataObjects::CoordTransformAligned::id ( ) const
overridevirtual

Coordinate transform id.

Returns
the type of coordinate transform

Implements Mantid::API::CoordTransform.

Definition at line 172 of file CoordTransformAligned.cpp.

◆ makeAffineMatrix()

Mantid::Kernel::Matrix< coord_t > Mantid::DataObjects::CoordTransformAligned::makeAffineMatrix ( ) const
overridevirtual

Create an equivalent affine transformation matrix out of the parameters of this axis-aligned transformation.

The output can be used to merge CoordTransforms together.

Returns
An affine matrix matrix with inD+1 columns, outD+1 rows.

Reimplemented from Mantid::API::CoordTransform.

Definition at line 112 of file CoordTransformAligned.cpp.

References Mantid::API::CoordTransform::inD, m_dimensionToBinFrom, m_origin, m_scaling, and Mantid::API::CoordTransform::outD.

◆ toXMLString()

std::string Mantid::DataObjects::CoordTransformAligned::toXMLString ( ) const
overridevirtual

Serialize the coordinate transform.

Returns
The coordinate transform in its serialized form.

Implements Mantid::API::CoordTransform.

Definition at line 136 of file CoordTransformAligned.cpp.

References Mantid::API::CoordTransform::inD, and Mantid::API::CoordTransform::outD.

Member Data Documentation

◆ m_dimensionToBinFrom

std::vector<size_t> Mantid::DataObjects::CoordTransformAligned::m_dimensionToBinFrom
protected

For each dimension in the output, index in the input workspace of which dimension it is.

Definition at line 54 of file CoordTransformAligned.h.

Referenced by apply(), clone(), CoordTransformAligned(), and makeAffineMatrix().

◆ m_origin

std::vector<coord_t> Mantid::DataObjects::CoordTransformAligned::m_origin
protected

Offset (minimum) position in each of the output dimensions, sized [outD].

Definition at line 56 of file CoordTransformAligned.h.

Referenced by apply(), clone(), CoordTransformAligned(), and makeAffineMatrix().

◆ m_scaling

std::vector<coord_t> Mantid::DataObjects::CoordTransformAligned::m_scaling
protected

Scaling from the input to the output dimension, sized [outD].

Definition at line 58 of file CoordTransformAligned.h.

Referenced by apply(), clone(), CoordTransformAligned(), and makeAffineMatrix().


The documentation for this class was generated from the following files: