Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | Friends | List of all members
CDPL::Math::TranslationMatrix< T > Class Template Reference

\( N \times N \) translation matrix in homogeneous coordinates. More...

#include <AffineTransform.hpp>

+ Inheritance diagram for CDPL::Math::TranslationMatrix< T >:

Public Types

typedef T ValueType
 The scalar value type. More...
 
typedef const T Reference
 Reference type (always a const reference — elements are computed). More...
 
typedef const T ConstReference
 Constant reference type to an element. More...
 
typedef std::size_t SizeType
 The unsigned size type. More...
 
typedef std::ptrdiff_t DifferenceType
 The signed difference type. More...
 
typedef MatrixReference< SelfTypeClosureType
 Closure type used when this matrix appears inside another expression. More...
 
typedef const MatrixReference< const SelfTypeConstClosureType
 Constant closure type used when this matrix appears inside another expression. More...
 
typedef Matrix< T, std::vector< T > > MatrixTemporaryType
 Concrete temporary matrix type used by expression-template machinery. More...
 
typedef Vector< T, std::vector< T > > VectorTemporaryType
 Concrete temporary vector type used when assembling vectors from this matrix. More...
 
- Public Types inherited from CDPL::Math::MatrixContainer< TranslationMatrix< T > >
typedef TranslationMatrix< T > ContainerType
 The derived matrix container type. More...
 
- Public Types inherited from CDPL::Math::MatrixExpression< E >
typedef E ExpressionType
 The derived matrix expression type. More...
 
- Public Types inherited from CDPL::Math::Expression< E >
typedef E ExpressionType
 The derived expression type (made available to expression-template machinery). More...
 

Public Member Functions

 TranslationMatrix (SizeType n, const ValueType &tx=ValueType(), const ValueType &ty=ValueType(), const ValueType &tz=ValueType())
 Constructs an \( N \times N \) translation matrix with the supplied per-axis translation components. More...
 
 TranslationMatrix (const TranslationMatrix &m)
 Constructs a copy of the translation matrix m. More...
 
void set (const ValueType &tx=ValueType(), const ValueType &ty=ValueType(), const ValueType &tz=ValueType())
 Sets the per-axis translation components. More...
 
ConstReference operator() (SizeType i, SizeType j) const
 Returns the translation-matrix entry at (i, j). More...
 
bool isEmpty () const
 Tells whether the matrix is empty (size zero). More...
 
SizeType getSize1 () const
 Returns the dimension N (the row count). More...
 
SizeType getSize2 () const
 Returns the dimension N (the column count). More...
 
SizeType getMaxSize1 () const
 Returns the maximum representable row count. More...
 
SizeType getMaxSize2 () const
 Returns the maximum representable column count. More...
 
TranslationMatrixoperator= (const TranslationMatrix &m)
 Copy-assigns the dimension and the translation components from m. More...
 
void swap (TranslationMatrix &m)
 Swaps the dimension and the translation components with m. More...
 
void resize (SizeType n)
 Resizes the matrix dimension to n (the translation components are left unchanged). More...
 
- Public Member Functions inherited from CDPL::Math::MatrixContainer< TranslationMatrix< T > >
const ContainerTypeoperator() () const
 Returns a const reference to the derived matrix container. More...
 
ContainerTypeoperator() ()
 Returns a reference to the derived matrix container. More...
 
- Public Member Functions inherited from CDPL::Math::MatrixExpression< E >
const ExpressionTypeoperator() () const
 Returns a const reference to the derived matrix expression. More...
 
ExpressionTypeoperator() ()
 Returns a reference to the derived matrix expression. More...
 

Friends

void swap (TranslationMatrix &m1, TranslationMatrix &m2)
 ADL-enabled free-function form of swap(). More...
 

Additional Inherited Members

- Protected Member Functions inherited from CDPL::Math::MatrixContainer< TranslationMatrix< T > >
 MatrixContainer ()
 
 ~MatrixContainer ()
 
- Protected Member Functions inherited from CDPL::Math::MatrixExpression< E >
 MatrixExpression ()
 
 ~MatrixExpression ()
 
- Protected Member Functions inherited from CDPL::Math::Expression< E >
 Expression ()
 
 ~Expression ()
 

Detailed Description

template<typename T>
class CDPL::Math::TranslationMatrix< T >

\( N \times N \) translation matrix in homogeneous coordinates.

The diagonal entries are all 1; the last column (above the diagonal) holds the per-axis translation components; all other entries are 0. The size \( N \) is configurable to fit the embedding coordinate dimension plus one (e.g. 4 for translations of 3D points in homogeneous form).

Template Parameters
TThe scalar value type.

Member Typedef Documentation

◆ ValueType

template<typename T >
typedef T CDPL::Math::TranslationMatrix< T >::ValueType

The scalar value type.

◆ Reference

template<typename T >
typedef const T CDPL::Math::TranslationMatrix< T >::Reference

Reference type (always a const reference — elements are computed).

◆ ConstReference

template<typename T >
typedef const T CDPL::Math::TranslationMatrix< T >::ConstReference

Constant reference type to an element.

◆ SizeType

template<typename T >
typedef std::size_t CDPL::Math::TranslationMatrix< T >::SizeType

The unsigned size type.

◆ DifferenceType

template<typename T >
typedef std::ptrdiff_t CDPL::Math::TranslationMatrix< T >::DifferenceType

The signed difference type.

◆ ClosureType

template<typename T >
typedef MatrixReference<SelfType> CDPL::Math::TranslationMatrix< T >::ClosureType

Closure type used when this matrix appears inside another expression.

◆ ConstClosureType

template<typename T >
typedef const MatrixReference<const SelfType> CDPL::Math::TranslationMatrix< T >::ConstClosureType

Constant closure type used when this matrix appears inside another expression.

◆ MatrixTemporaryType

template<typename T >
typedef Matrix<T, std::vector<T> > CDPL::Math::TranslationMatrix< T >::MatrixTemporaryType

Concrete temporary matrix type used by expression-template machinery.

◆ VectorTemporaryType

template<typename T >
typedef Vector<T, std::vector<T> > CDPL::Math::TranslationMatrix< T >::VectorTemporaryType

Concrete temporary vector type used when assembling vectors from this matrix.

Constructor & Destructor Documentation

◆ TranslationMatrix() [1/2]

template<typename T >
CDPL::Math::TranslationMatrix< T >::TranslationMatrix ( SizeType  n,
const ValueType tx = ValueType(),
const ValueType ty = ValueType(),
const ValueType tz = ValueType() 
)
inlineexplicit

Constructs an \( N \times N \) translation matrix with the supplied per-axis translation components.

Parameters
nThe matrix dimension N.
txThe x-axis translation (default: 0).
tyThe y-axis translation (default: 0).
tzThe z-axis translation (default: 0).

◆ TranslationMatrix() [2/2]

template<typename T >
CDPL::Math::TranslationMatrix< T >::TranslationMatrix ( const TranslationMatrix< T > &  m)
inline

Constructs a copy of the translation matrix m.

Parameters
mThe translation matrix to copy.

Member Function Documentation

◆ set()

template<typename T >
void CDPL::Math::TranslationMatrix< T >::set ( const ValueType tx = ValueType(),
const ValueType ty = ValueType(),
const ValueType tz = ValueType() 
)
inline

Sets the per-axis translation components.

Parameters
txThe x-axis translation (default: 0).
tyThe y-axis translation (default: 0).
tzThe z-axis translation (default: 0).

◆ operator()()

template<typename T >
ConstReference CDPL::Math::TranslationMatrix< T >::operator() ( SizeType  i,
SizeType  j 
) const
inline

Returns the translation-matrix entry at (i, j).

Parameters
iThe zero-based row index.
jThe zero-based column index.
Returns
1 on the diagonal; the corresponding translation component in the last column (rows 0-2); 0 elsewhere.
Exceptions
Base::IndexErrorif either index is out of range.

◆ isEmpty()

template<typename T >
bool CDPL::Math::TranslationMatrix< T >::isEmpty ( ) const
inline

Tells whether the matrix is empty (size zero).

Returns
true if N is zero, and false otherwise.

◆ getSize1()

template<typename T >
SizeType CDPL::Math::TranslationMatrix< T >::getSize1 ( ) const
inline

Returns the dimension N (the row count).

Returns
N.

◆ getSize2()

template<typename T >
SizeType CDPL::Math::TranslationMatrix< T >::getSize2 ( ) const
inline

Returns the dimension N (the column count).

Returns
N.

◆ getMaxSize1()

template<typename T >
SizeType CDPL::Math::TranslationMatrix< T >::getMaxSize1 ( ) const
inline

Returns the maximum representable row count.

Returns
The maximum row count.

◆ getMaxSize2()

template<typename T >
SizeType CDPL::Math::TranslationMatrix< T >::getMaxSize2 ( ) const
inline

Returns the maximum representable column count.

Returns
The maximum column count.

◆ operator=()

template<typename T >
TranslationMatrix& CDPL::Math::TranslationMatrix< T >::operator= ( const TranslationMatrix< T > &  m)
inline

Copy-assigns the dimension and the translation components from m.

Parameters
mThe source translation matrix.
Returns
A reference to itself.

◆ swap()

template<typename T >
void CDPL::Math::TranslationMatrix< T >::swap ( TranslationMatrix< T > &  m)
inline

Swaps the dimension and the translation components with m.

Parameters
mThe translation matrix to swap with.

◆ resize()

template<typename T >
void CDPL::Math::TranslationMatrix< T >::resize ( SizeType  n)
inline

Resizes the matrix dimension to n (the translation components are left unchanged).

Parameters
nThe new dimension.

Friends And Related Function Documentation

◆ swap

template<typename T >
void swap ( TranslationMatrix< T > &  m1,
TranslationMatrix< T > &  m2 
)
friend

ADL-enabled free-function form of swap().

Parameters
m1The first translation matrix.
m2The second translation matrix.

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