Public Types | Public Member Functions | Static Public Member Functions | List of all members
i2d::CMatrix2d Class Reference

2D matrix. More...

#include <CMatrix2d.h>

Inheritance diagram for i2d::CMatrix2d:
imath::TMatrix< 2, 2 >

Public Types

typedef imath::TMatrix< 2, 2 > BaseClass
 
- Public Types inherited from imath::TMatrix< 2, 2 >
enum  MatrixInitMode
 
typedef istd::CIndex2d IndexType
 
typedef istd::CIndex2d SizesType
 
typedef double ElementType
 
typedef imath::TVector< Height,
double > 
ColumnVector
 
typedef imath::TVector< Width,
double > 
RowVector
 

Public Member Functions

 CMatrix2d ()
 Constructor with no member initialization. More...
 
 CMatrix2d (const CMatrix2d &transform)
 
 CMatrix2d (const CVector2d &axisX, const CVector2d &axisY)
 Constructor using 2 vectors to span the transformation space. More...
 
 CMatrix2d (double m11, double m12, double m21, double m22)
 Constructor using matrix members. More...
 
void Reset ()
 Default reset to identity. More...
 
void Reset (double angle, double scale=1.0)
 Set the matrix using specified angle (in radians) and uniform scale. More...
 
void Reset (double angle, const CVector2d &scale)
 Set the deformation matrix using specified angle (in radians) and scale determined for both axis separately. More...
 
CVector2d GetMultiplied (const CVector2d &position) const
 
CMatrix2d GetMultiplied (const CMatrix2d &matrix) const
 
void Multiply (const CMatrix2d &matrix)
 
void MultiplyLeft (const CMatrix2d &matrix)
 
CVector2d GetAxisX () const
 Get axis X vector. More...
 
CVector2d GetAxisY () const
 Get axis Y vector. More...
 
CVector2d GetAxesLengths () const
 Get lengths of axes vectors. More...
 
void GetAxesLengths (CVector2d &result) const
 Get lengths of axes vectors. More...
 
double GetApproxAngle () const
 Get angle of axis X in radians. More...
 
double GetApproxScale () const
 Get approximated scale. More...
 
i2d::CVector2d GetInvMultiplied (const i2d::CVector2d &position) const
 Inverted operation to GetApply(). More...
 
bool GetInvMultiplied (const i2d::CVector2d &position, i2d::CVector2d &result) const
 Inverted operation to GetApply(). More...
 
CMatrix2d GetInverted () const
 Calculate inverted matrix. More...
 
bool GetInverted (CMatrix2d &result) const
 Calculate inverted matrix. More...
 
CMatrix2d GetTransposed () const
 Calculate transposed matrix. More...
 
bool GetEigenVectors (i2d::CVector2d &vector1, i2d::CVector2d &vector2, double &value1, double &value2) const
 Calculate eigen vectors and eigen values. More...
 
double GetDet () const
 Calculate determinant of deformation matrix. More...
 
CMatrix2doperator= (const CMatrix2d &matrix)
 Copy operator. More...
 
CMatrix2d operator+ (const BaseClass &matrix) const
 
CMatrix2d operator- (const BaseClass &matrix) const
 
CMatrix2d operator- ()
 
CMatrix2d operator* (double scale) const
 Multiplication by scalar number. More...
 
CMatrix2d operator/ (double scale) const
 Division by scalar number. More...
 
- Public Member Functions inherited from imath::TMatrix< 2, 2 >
 TMatrix ()
 Create matrix without initialization. More...
 
 TMatrix (MatrixInitMode mode)
 Create matrix with initialization to some specified one. More...
 
 TMatrix (const TMatrix &matrix)
 Copy constructor. More...
 
void Reset ()
 Set all matrix cells to zero. More...
 
void Clear ()
 Set all matrix cells to zero. More...
 
bool IsDimensionsCountFixed () const
 Check, if number dimensions is fixed. More...
 
int GetDimensionsCount () const
 Get number of dimensions of this array. More...
 
bool SetDimensionsCount (int count)
 Set number of dimensions of this array. More...
 
const SizesTypeGetSizes () const
 Get list of all sizes. More...
 
bool SetSizes (const SizesType &sizes)
 Set list of all sizes. More...
 
int GetSize (int dimension) const
 Get size of array for specified dimension. More...
 
bool SetSize (int dimension, int size)
 Set size of array for specified dimension. More...
 
const ElementTypeGetAt (const IndexType &index) const
 Get element stored at specified index. More...
 
const ElementTypeGetAt (int x, int y) const
 Get element stored at specified index. More...
 
ElementTypeGetAtRef (const IndexType &index)
 Get reference to element stored at specified index. More...
 
ElementTypeGetAtRef (int x, int y)
 Get reference to element stored at specified index. More...
 
void SetAt (const IndexType &index, const ElementType &value)
 Set element at specified index. More...
 
void SetAt (int x, int y, const ElementType &value)
 Set element at specified index. More...
 
void InitToIdentity ()
 Create identity matrix. More...
 
double GetMaxElement () const
 
double GetMinElement () const
 
void GetNegated (TMatrix< Width, Height, double > &result)
 Get result matrix with negated all elements. More...
 
void GetAdded (const TMatrix< Width, Height, double > &matrix, TMatrix< Width, Height, double > &result) const
 Get sum of two matrices. More...
 
void GetSubstracted (const TMatrix< Width, Height, double > &matrix, TMatrix< Width, Height, double > &result) const
 Get result of substraction of two matrices. More...
 
void GetMultiplied (const TMatrix< SecondWidth, Width, double > &matrix, TMatrix< SecondWidth, Height, double > &result) const
 Get result of multiplication of two matrices. More...
 
TMatrix< SecondWidth, Height,
double > 
GetMultiplied (const TMatrix< SecondWidth, Width, double > &matrix) const
 Get result of multiplication of two matrices. More...
 
void GetMultiplied (const TVector< Width, double > &vector, TVector< Height, double > &result) const
 Get result of multiplication of this matrix and some vector. More...
 
TVector< Height, double > GetMultiplied (const TVector< Width, double > &vector) const
 Get result of multiplication of this matrix and some vector. More...
 
void GetScaled (double value, TMatrix< Width, Height, double > &result) const
 Get result of multiplication of this matrix with scalar value. More...
 
void GetTransposed (TMatrix< Height, Width, double > &result) const
 Get transposed matrix. More...
 
TMatrix< Height, Width, double > GetTransposed () const
 Get transposed matrix. More...
 
void Transpose ()
 Transpose matrix. More...
 
double GetTrace () const
 Get trace of this matrix. More...
 
double GetFrobeniusNorm2 () const
 
double GetFrobeniusNorm () const
 
bool GetTriangleDecomposed (TMatrix< Width, Height, double > &result, TMatrix< Height, Height, double > *matrixQPtr=NULL, int maxColumns=-1, double minHhNorm=I_BIG_EPSILON) const
 Transform matrix to upper triangle form using method of Householder reflexions. More...
 
bool GetDecompositionQDQ (TMatrix< Height, Height, double > &matrixQ, TVector< Height, double > &diagonalD, double tolerance=I_BIG_EPSILON, int maxIterations=100) const
 Calculate decomposition in form of QDQ where Q is orthogonal matrix and D is diagonal one. More...
 
void GetColumnVector (int columnIndex, TVector< Height, double > &result)
 Get single column as vector. More...
 
void SetColumnVector (int columnIndex, const TVector< Height, double > &columnVector)
 Set a single column vector to matrix. More...
 
void GetRowVector (int rowIndex, TVector< Width, double > &result)
 Get single row as vector. More...
 
bool Serialize (iser::IArchive &archive)
 
TMatrix< Width, Height, double > operator+ (const TMatrix< Width, Height, double > &matrix) const
 
TMatrix< Width, Height, double > operator- (const TMatrix< Width, Height, double > &matrix) const
 
TMatrix< Width, Height, double > operator- ()
 
TMatrix< SecondWidth, Height,
double > 
operator* (const TMatrix< SecondWidth, Width, double > &matrix) const
 
TMatrix< Width, Height, double > operator* (double value) const
 
TMatrix< Width, Height, double > & operator+= (const TMatrix< Width, Height, double > &matrix)
 
TMatrix< Width, Height, double > & operator-= (const TMatrix< Width, Height, double > &matrix)
 
TMatrix< Width, Height, double > & operator*= (double value)
 
bool operator== (const TMatrix< Width, Height, double > &matrix) const
 
bool operator!= (const TMatrix< Width, Height, double > &matrix) const
 
const ElementTypeoperator[] (const IndexType &index) const
 
ElementTypeoperator[] (const IndexType &index)
 

Static Public Member Functions

static const CMatrix2dGetIdentity ()
 

Detailed Description

2D matrix.

Definition at line 18 of file CMatrix2d.h.

Member Typedef Documentation

Definition at line 21 of file CMatrix2d.h.

Constructor & Destructor Documentation

i2d::CMatrix2d::CMatrix2d ( )
inline

Constructor with no member initialization.

Definition at line 148 of file CMatrix2d.h.

Referenced by GetTransposed(), and operator/().

i2d::CMatrix2d::CMatrix2d ( const CMatrix2d transform)
inline

Definition at line 153 of file CMatrix2d.h.

i2d::CMatrix2d::CMatrix2d ( const CVector2d axisX,
const CVector2d axisY 
)
inline

Constructor using 2 vectors to span the transformation space.

Definition at line 159 of file CMatrix2d.h.

References imath::TMatrix< 2, 2 >::SetAt().

i2d::CMatrix2d::CMatrix2d ( double  m11,
double  m12,
double  m21,
double  m22 
)
inline

Constructor using matrix members.

Definition at line 168 of file CMatrix2d.h.

References imath::TMatrix< 2, 2 >::SetAt().

Member Function Documentation

double i2d::CMatrix2d::GetApproxAngle ( ) const

Get angle of axis X in radians.

Please note that this angle is in radians

double i2d::CMatrix2d::GetApproxScale ( ) const

Get approximated scale.

CVector2d i2d::CMatrix2d::GetAxesLengths ( ) const
inline

Get lengths of axes vectors.

Definition at line 209 of file CMatrix2d.h.

void i2d::CMatrix2d::GetAxesLengths ( CVector2d result) const
inline

Get lengths of axes vectors.

Definition at line 219 of file CMatrix2d.h.

References GetAxisX(), GetAxisY(), i2d::CVector2d::SetX(), and i2d::CVector2d::SetY().

CVector2d i2d::CMatrix2d::GetAxisX ( ) const
inline

Get axis X vector.

Definition at line 197 of file CMatrix2d.h.

References imath::TMatrix< 2, 2 >::GetAt().

Referenced by GetAxesLengths().

CVector2d i2d::CMatrix2d::GetAxisY ( ) const
inline

Get axis Y vector.

Definition at line 203 of file CMatrix2d.h.

References imath::TMatrix< 2, 2 >::GetAt().

Referenced by GetAxesLengths().

double i2d::CMatrix2d::GetDet ( ) const
inline

Calculate determinant of deformation matrix.

Definition at line 242 of file CMatrix2d.h.

References imath::TMatrix< 2, 2 >::GetAt().

bool i2d::CMatrix2d::GetEigenVectors ( i2d::CVector2d vector1,
i2d::CVector2d vector2,
double &  value1,
double &  value2 
) const

Calculate eigen vectors and eigen values.

The first eigen value is always bigger or equal than the second one.

const CMatrix2d & i2d::CMatrix2d::GetIdentity ( )
inlinestatic

Definition at line 306 of file CMatrix2d.h.

CMatrix2d i2d::CMatrix2d::GetInverted ( ) const
inline

Calculate inverted matrix.

Definition at line 226 of file CMatrix2d.h.

bool i2d::CMatrix2d::GetInverted ( CMatrix2d result) const

Calculate inverted matrix.

i2d::CVector2d i2d::CMatrix2d::GetInvMultiplied ( const i2d::CVector2d position) const

Inverted operation to GetApply().

bool i2d::CMatrix2d::GetInvMultiplied ( const i2d::CVector2d position,
i2d::CVector2d result 
) const

Inverted operation to GetApply().

CVector2d i2d::CMatrix2d::GetMultiplied ( const CVector2d position) const
inline
CMatrix2d i2d::CMatrix2d::GetMultiplied ( const CMatrix2d matrix) const
inline

Definition at line 187 of file CMatrix2d.h.

References GetMultiplied().

CMatrix2d i2d::CMatrix2d::GetTransposed ( ) const
inline

Calculate transposed matrix.

Definition at line 236 of file CMatrix2d.h.

References CMatrix2d(), and imath::TMatrix< 2, 2 >::GetAt().

void i2d::CMatrix2d::Multiply ( const CMatrix2d matrix)
void i2d::CMatrix2d::MultiplyLeft ( const CMatrix2d matrix)
CMatrix2d i2d::CMatrix2d::operator* ( double  scale) const
inline

Multiplication by scalar number.

Definition at line 288 of file CMatrix2d.h.

References imath::TMatrix< 2, 2 >::GetScaled().

CMatrix2d i2d::CMatrix2d::operator+ ( const BaseClass matrix) const
inline

Definition at line 250 of file CMatrix2d.h.

References imath::TMatrix< 2, 2 >::GetAdded().

CMatrix2d i2d::CMatrix2d::operator- ( const BaseClass matrix) const
inline

Definition at line 260 of file CMatrix2d.h.

References imath::TMatrix< 2, 2 >::GetSubstracted().

CMatrix2d i2d::CMatrix2d::operator- ( )
inline

Definition at line 270 of file CMatrix2d.h.

References imath::TMatrix< 2, 2 >::GetNegated().

CMatrix2d i2d::CMatrix2d::operator/ ( double  scale) const
inline

Division by scalar number.

Definition at line 298 of file CMatrix2d.h.

References CMatrix2d(), and imath::TMatrix< 2, 2 >::GetAt().

CMatrix2d & i2d::CMatrix2d::operator= ( const CMatrix2d matrix)
inline

Copy operator.

Definition at line 280 of file CMatrix2d.h.

void i2d::CMatrix2d::Reset ( )

Default reset to identity.

void i2d::CMatrix2d::Reset ( double  angle,
double  scale = 1.0 
)

Set the matrix using specified angle (in radians) and uniform scale.

void i2d::CMatrix2d::Reset ( double  angle,
const CVector2d scale 
)

Set the deformation matrix using specified angle (in radians) and scale determined for both axis separately.


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

© 2007-2017 Witold Gantzke and Kirill Lepskiy