![]() |
ICF 3.0.5.47
Technical documentation of ICF Libraries
|
Definition of mathematical matrix with fixed dimensions. More...
#include <TMatrix.h>
Public Types | |
enum | MatrixInitMode { MIM_ZERO , MIM_ONES , MIM_IDENTITY , MIM_UPPER_TRIANGLE , MIM_DOWNER_TRIANGLE } |
typedef istd::CIndex2d | IndexType |
typedef istd::CIndex2d | SizesType |
typedef Element | ElementType |
typedef imath::TVector< Height, Element > | ColumnVector |
typedef imath::TVector< Width, Element > | RowVector |
Public Member Functions | |
TMatrix () | |
Create matrix without initialization. | |
TMatrix (MatrixInitMode mode) | |
Create matrix with initialization to some specified one. | |
TMatrix (const TMatrix &matrix) | |
Copy constructor. | |
void | Reset () |
Set all matrix cells to zero. | |
void | Clear () |
Set all matrix cells to zero. | |
bool | IsDimensionsCountFixed () const |
Check, if number dimensions is fixed. | |
int | GetDimensionsCount () const |
Get number of dimensions of this array. | |
bool | SetDimensionsCount (int count) |
Set number of dimensions of this array. | |
const SizesType & | GetSizes () const |
Get list of all sizes. | |
bool | SetSizes (const SizesType &sizes) |
Set list of all sizes. | |
int | GetSize (int dimension) const |
Get size of array for specified dimension. | |
bool | SetSize (int dimension, int size) |
Set size of array for specified dimension. | |
const ElementType & | GetAt (const IndexType &index) const |
Get element stored at specified index. | |
const ElementType & | GetAt (int x, int y) const |
Get element stored at specified index. | |
ElementType & | GetAtRef (const IndexType &index) |
Get reference to element stored at specified index. | |
ElementType & | GetAtRef (int x, int y) |
Get reference to element stored at specified index. | |
void | SetAt (const IndexType &index, const ElementType &value) |
Set element at specified index. | |
void | SetAt (int x, int y, const ElementType &value) |
Set element at specified index. | |
void | InitToIdentity () |
Create identity matrix. | |
double | GetMaxElement () const |
double | GetMinElement () const |
void | GetNegated (TMatrix< Width, Height, Element > &result) |
Get result matrix with negated all elements. | |
void | GetAdded (const TMatrix< Width, Height, Element > &matrix, TMatrix< Width, Height, Element > &result) const |
Get sum of two matrices. | |
void | GetSubstracted (const TMatrix< Width, Height, Element > &matrix, TMatrix< Width, Height, Element > &result) const |
Get result of substraction of two matrices. | |
template<int SecondWidth> | |
void | GetMultiplied (const TMatrix< SecondWidth, Width, Element > &matrix, TMatrix< SecondWidth, Height, Element > &result) const |
Get result of multiplication of two matrices. | |
template<int SecondWidth> | |
TMatrix< SecondWidth, Height, Element > | GetMultiplied (const TMatrix< SecondWidth, Width, Element > &matrix) const |
Get result of multiplication of two matrices. | |
void | GetMultiplied (const TVector< Width, Element > &vector, TVector< Height, Element > &result) const |
Get result of multiplication of this matrix and some vector. | |
TVector< Height, Element > | GetMultiplied (const TVector< Width, Element > &vector) const |
Get result of multiplication of this matrix and some vector. | |
void | GetScaled (double value, TMatrix< Width, Height, Element > &result) const |
Get result of multiplication of this matrix with scalar value. | |
void | GetTransposed (TMatrix< Height, Width, Element > &result) const |
Get transposed matrix. | |
TMatrix< Height, Width, Element > | GetTransposed () const |
Get transposed matrix. | |
void | Transpose () |
Transpose matrix. | |
double | GetTrace () const |
Get trace of this matrix. | |
double | GetFrobeniusNorm2 () const |
double | GetFrobeniusNorm () const |
bool | GetTriangleDecomposed (TMatrix< Width, Height, Element > &result, TMatrix< Height, Height, Element > *matrixQPtr=nullptr, int maxColumns=-1, double minHhNorm=I_BIG_EPSILON) const |
Transform matrix to upper triangle form using method of Householder reflexions. | |
bool | GetDecompositionQDQ (TMatrix< Height, Height, Element > &matrixQ, TVector< Height, Element > &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. | |
void | GetColumnVector (int columnIndex, TVector< Height, Element > &result) const |
Get single column as vector. | |
void | SetColumnVector (int columnIndex, const TVector< Height, Element > &columnVector) |
Set a single column vector to matrix. | |
void | GetRowVector (int rowIndex, TVector< Width, Element > &result) |
Get single row as vector. | |
bool | Serialize (iser::IArchive &archive) |
TMatrix< Width, Height, Element > | operator+ (const TMatrix< Width, Height, Element > &matrix) const |
TMatrix< Width, Height, Element > | operator- (const TMatrix< Width, Height, Element > &matrix) const |
TMatrix< Width, Height, Element > | operator- () |
template<int SecondWidth> | |
TMatrix< SecondWidth, Height, Element > | operator* (const TMatrix< SecondWidth, Width, Element > &matrix) const |
TMatrix< Width, Height, Element > | operator* (double value) const |
TMatrix< Width, Height, Element > & | operator+= (const TMatrix< Width, Height, Element > &matrix) |
TMatrix< Width, Height, Element > & | operator-= (const TMatrix< Width, Height, Element > &matrix) |
TMatrix< Width, Height, Element > & | operator*= (double value) |
bool | operator== (const TMatrix< Width, Height, Element > &matrix) const |
bool | operator!= (const TMatrix< Width, Height, Element > &matrix) const |
const ElementType & | operator[] (const IndexType &index) const |
ElementType & | operator[] (const IndexType &index) |
Definition of mathematical matrix with fixed dimensions.
imath::TVector<Height, Element> imath::TMatrix< Width, Height, Element >::ColumnVector |
Element imath::TMatrix< Width, Height, Element >::ElementType |
istd::CIndex2d imath::TMatrix< Width, Height, Element >::IndexType |
imath::TVector<Width, Element> imath::TMatrix< Width, Height, Element >::RowVector |
istd::CIndex2d imath::TMatrix< Width, Height, Element >::SizesType |
enum imath::TMatrix::MatrixInitMode |
imath::TMatrix< Width, Height, Element >::TMatrix | ( | ) |
|
explicit |
imath::TMatrix< Width, Height, Element >::TMatrix | ( | const TMatrix< Width, Height, Element > & | matrix | ) |
void imath::TMatrix< Width, Height, Element >::Clear | ( | ) |
Set all matrix cells to zero.
It makes the same as Reset() and is used for compatibility with other matrix implementations.
Definition at line 552 of file TMatrix.h.
Referenced by imath::TMatrix< Width, Height, Element >::GetDecompositionQDQ().
void imath::TMatrix< Width, Height, Element >::GetAdded | ( | const TMatrix< Width, Height, Element > & | matrix, |
TMatrix< Width, Height, Element > & | result ) const |
const TMatrix< Width, Height, Element >::ElementType & imath::TMatrix< Width, Height, Element >::GetAt | ( | const IndexType & | index | ) | const |
Get element stored at specified index.
Definition at line 628 of file TMatrix.h.
Referenced by imath::TMatrix< Width, Height, Element >::GetDecompositionQDQ(), and imath::TMatrix< Width, Height, Element >::GetTriangleDecomposed().
const TMatrix< Width, Height, Element >::ElementType & imath::TMatrix< Width, Height, Element >::GetAt | ( | int | x, |
int | y ) const |
TMatrix< Width, Height, Element >::ElementType & imath::TMatrix< Width, Height, Element >::GetAtRef | ( | const IndexType & | index | ) |
Get reference to element stored at specified index.
Definition at line 642 of file TMatrix.h.
Referenced by imath::TMatrix< Width, Height, Element >::GetTriangleDecomposed().
TMatrix< Width, Height, Element >::ElementType & imath::TMatrix< Width, Height, Element >::GetAtRef | ( | int | x, |
int | y ) |
void imath::TMatrix< Width, Height, Element >::GetColumnVector | ( | int | columnIndex, |
TVector< Height, Element > & | result ) const |
bool imath::TMatrix< Width, Height, Element >::GetDecompositionQDQ | ( | TMatrix< Height, Height, Element > & | matrixQ, |
TVector< Height, Element > & | 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.
It works for square matrix only.
Definition at line 829 of file TMatrix.h.
References imath::TMatrix< Width, Height, Element >::Clear(), imath::TMatrix< Width, Height, Element >::GetAt(), imath::TMatrix< Width, Height, Element >::GetMultiplied(), and imath::TMatrix< Width, Height, Element >::GetTriangleDecomposed().
int imath::TMatrix< Width, Height, Element >::GetDimensionsCount | ( | ) | const |
double imath::TMatrix< Width, Height, Element >::GetFrobeniusNorm | ( | ) | const |
double imath::TMatrix< Width, Height, Element >::GetFrobeniusNorm2 | ( | ) | const |
double imath::TMatrix< Width, Height, Element >::GetMaxElement | ( | ) | const |
double imath::TMatrix< Width, Height, Element >::GetMinElement | ( | ) | const |
|
inline |
Get result of multiplication of two matrices.
Definition at line 218 of file TMatrix.h.
References imath::TMatrix< Width, Height, Element >::GetMultiplied().
|
inline |
Get result of multiplication of two matrices.
Definition at line 200 of file TMatrix.h.
Referenced by imath::TMatrix< Width, Height, Element >::GetDecompositionQDQ(), imath::TMatrix< Width, Height, Element >::GetMultiplied(), and imath::TMatrix< Width, Height, Element >::operator*().
TVector< Height, Element > imath::TMatrix< Width, Height, Element >::GetMultiplied | ( | const TVector< Width, Element > & | vector | ) | const |
void imath::TMatrix< Width, Height, Element >::GetMultiplied | ( | const TVector< Width, Element > & | vector, |
TVector< Height, Element > & | result ) const |
void imath::TMatrix< Width, Height, Element >::GetNegated | ( | TMatrix< Width, Height, Element > & | result | ) |
void imath::TMatrix< Width, Height, Element >::GetRowVector | ( | int | rowIndex, |
TVector< Width, Element > & | result ) |
void imath::TMatrix< Width, Height, Element >::GetScaled | ( | double | value, |
TMatrix< Width, Height, Element > & | result ) const |
int imath::TMatrix< Width, Height, Element >::GetSize | ( | int | dimension | ) | const |
const TMatrix< Width, Height, Element >::SizesType & imath::TMatrix< Width, Height, Element >::GetSizes | ( | ) | const |
void imath::TMatrix< Width, Height, Element >::GetSubstracted | ( | const TMatrix< Width, Height, Element > & | matrix, |
TMatrix< Width, Height, Element > & | result ) const |
double imath::TMatrix< Width, Height, Element >::GetTrace | ( | ) | const |
|
inline |
void imath::TMatrix< Width, Height, Element >::GetTransposed | ( | TMatrix< Height, Width, Element > & | result | ) | const |
bool imath::TMatrix< Width, Height, Element >::GetTriangleDecomposed | ( | TMatrix< Width, Height, Element > & | result, |
TMatrix< Height, Height, Element > * | matrixQPtr = nullptr, | ||
int | maxColumns = -1, | ||
double | minHhNorm = I_BIG_EPSILON ) const |
Transform matrix to upper triangle form using method of Householder reflexions.
result | triangle matrix. |
matrix2Ptr | optional matrix will be transformed using the same reflexions. To realize QR decomposition you can use identity matrix. |
maxColumns | optional maximal number of transformed columns. If it is negative value whole matrix will be transformed. |
minHhNorm | minimal Hausholder reflexion vector length. If any reflexion vector is shorter this method fails. |
Definition at line 909 of file TMatrix.h.
References imath::TMatrix< Width, Height, Element >::GetAt(), imath::TMatrix< Width, Height, Element >::GetAtRef(), and imath::TMatrix< Width, Height, Element >::SetAt().
Referenced by imath::TMatrix< Width, Height, Element >::GetDecompositionQDQ().
void imath::TMatrix< Width, Height, Element >::InitToIdentity | ( | ) |
bool imath::TMatrix< Width, Height, Element >::IsDimensionsCountFixed | ( | ) | const |
bool imath::TMatrix< Width, Height, Element >::operator!= | ( | const TMatrix< Width, Height, Element > & | matrix | ) | const |
|
inline |
Definition at line 316 of file TMatrix.h.
References imath::TMatrix< Width, Height, Element >::GetMultiplied().
|
inline |
TMatrix< Width, Height, Element > & imath::TMatrix< Width, Height, Element >::operator*= | ( | double | value | ) |
|
inline |
TMatrix< Width, Height, Element > & imath::TMatrix< Width, Height, Element >::operator+= | ( | const TMatrix< Width, Height, Element > & | matrix | ) |
|
inline |
|
inline |
TMatrix< Width, Height, Element > & imath::TMatrix< Width, Height, Element >::operator-= | ( | const TMatrix< Width, Height, Element > & | matrix | ) |
bool imath::TMatrix< Width, Height, Element >::operator== | ( | const TMatrix< Width, Height, Element > & | matrix | ) | const |
TMatrix< Width, Height, Element >::ElementType & imath::TMatrix< Width, Height, Element >::operator[] | ( | const IndexType & | index | ) |
const TMatrix< Width, Height, Element >::ElementType & imath::TMatrix< Width, Height, Element >::operator[] | ( | const IndexType & | index | ) | const |
void imath::TMatrix< Width, Height, Element >::Reset | ( | ) |
bool imath::TMatrix< Width, Height, Element >::Serialize | ( | iser::IArchive & | archive | ) |
Definition at line 991 of file TMatrix.h.
References iser::IArchive::BeginTag(), iser::IArchive::EndTag(), iser::IArchive::IsChanging(), iser::IArchive::Process(), and iser::CArchiveTag::TT_GROUP.
void imath::TMatrix< Width, Height, Element >::SetAt | ( | const IndexType & | index, |
const ElementType & | value ) |
Set element at specified index.
Definition at line 656 of file TMatrix.h.
Referenced by imath::TMatrix< Width, Height, Element >::GetTriangleDecomposed().
void imath::TMatrix< Width, Height, Element >::SetAt | ( | int | x, |
int | y, | ||
const ElementType & | value ) |
void imath::TMatrix< Width, Height, Element >::SetColumnVector | ( | int | columnIndex, |
const TVector< Height, Element > & | columnVector ) |
bool imath::TMatrix< Width, Height, Element >::SetDimensionsCount | ( | int | count | ) |
bool imath::TMatrix< Width, Height, Element >::SetSize | ( | int | dimension, |
int | size ) |
bool imath::TMatrix< Width, Height, Element >::SetSizes | ( | const SizesType & | sizes | ) |
|
inline |
© Witold Gantzke and Kirill Lepskiy