Assignments Assignments

Public Member Functions | Static Public Member Functions | List of all members
Util::Matrix< Dim, Dim > Class Template Reference

`#include <geometry.h>`

Inheritance diagram for Util::Matrix< Dim, Dim >:

## Public Member Functions
| Matrix (void)
| Matrix (const Matrix< Dim+1, Dim+1 > &m)
| Matrix (const Matrix< Dim-1, Dim-1 > &m, Point< Dim-1 > p=Point< Dim-1 >())
double | subDeterminant (int r, int c) const
double | determinant (void) const
double | trace (void) const
Matrix | inverse (void) const
bool | setInverse (Matrix &m) const
Point< Dim-1 > | operator* (const Point< Dim-1 > &p) const
void | SVD (Matrix &r1, Matrix &diagonal, Matrix &r2) const
Matrix | symmetrize (void) const
Matrix | skewSymmetrize (void) const
Matrix | closestRotation (void) const
template<unsigned int Cols>
Matrix< Dim, Cols > | operator* (const Matrix< Dim, Cols > &m) const
Public Member Functions inherited from Util::_BaseMatrix< Dim, Dim, Matrix< Dim, Dim >, Matrix< Dim, Dim > >
| _BaseMatrix (void)
double & | operator() (int r, int c)
const double & | operator() (int r, int c) const
Matrix< Dim, Dim > | transpose (void) const
Point< Rows > | operator* (const Point< Cols > &p) const
Matrix< Dim, Dim > | operator* (double s) const
Matrix< Dim, Dim > | operator+ (const Matrix< Dim, Dim > &m) const
double | dot (const _BaseMatrix &p) const
Public Member Functions inherited from Util::_InnerProductSpace< Matrix< Dim, Dim > >
double | squareNorm (void) const
double | length (void) const
Matrix< Dim, Dim > | unit (void) const

## Static Public Member Functions
static Matrix | Identity (void)
static Matrix | Log (const Matrix &m, double eps=0.0001)
static Matrix | SquareRoot (const Matrix &m, double eps=0.000001)
static Matrix | Exp (const Matrix &m, int terms=100)
Static Public Member Functions inherited from Util::_InnerProductSpace< Matrix< Dim, Dim > >
static double | Dot (const Matrix< Dim, Dim > &e1, const Matrix< Dim, Dim > &e2)
static double | SquareNorm (const Matrix< Dim, Dim > &e)
static double | Length (const Matrix< Dim, Dim > &e)
static double | SquareDistance (const Matrix< Dim, Dim > &e1, const Matrix< Dim, Dim > &e2)
static double | Distance (const Matrix< Dim, Dim > &e1, const Matrix< Dim, Dim > &e2)

## Detailed Description

template<unsigned int Dim>
class Util::Matrix< Dim, Dim >

Specialization of the matrix class for the case when it is square.

## Constructor & Destructor Documentation

## ◆ Matrix() [1/3]

template<unsigned int Dim>

Util::SquareMatrix::Matrix | ( | void |  | ) |

The default constructor that initializes the matrix to zero.

## ◆ Matrix() [2/3]

template<unsigned int Dim>

Util::Matrix< Dim, Dim >::Matrix | ( | const Matrix< Dim+1, Dim+1 > & | m | ) |

This constructor generates a matrix by slicing out the top left sub-matrix

## ◆ Matrix() [3/3]

template<unsigned int Dim>

Util::Matrix< Dim, Dim >::Matrix | ( | const Matrix< Dim-1, Dim-1 > & | m,
|  | Point< Dim-1 > | p = Point< Dim-1 >() )

This constructor generates matrix by projectivizing the input matrix, using m as the linear part and p as the translation.

## Member Function Documentation

## ◆ closestRotation()

template<unsigned int Dim>

Matrix< Dim, Dim > Util::Matrix< Dim, Dim >::closestRotation | ( | void |  | ) | const

This method returns the closest rotation matrix

## ◆ determinant()

template<unsigned int Dim>

double Util::SquareMatrix::determinant | ( | void |  | ) | const

This method returns the determinant of the matrix.

## ◆ Exp()

template<unsigned int Dim>

Matrix< Dim, Dim > Util::Matrix< Dim, Dim >::Exp | ( | const Matrix< Dim, Dim > & | m,
|  | int | terms = 100 )
| static

This method returns the exponent of a matrix using a Taylor approximation with the specified number of terms.

## ◆ Identity()

template<unsigned int Dim>

SquareMatrix< Dim > Util::SquareMatrix::Identity | ( | void |  | ) |
| static

This static method returns the identity matrix.

## ◆ inverse()

template<unsigned int Dim>

SquareMatrix< Dim > Util::SquareMatrix::inverse | ( | void |  | ) | const

This method returns the inverse of a matrix. The method throws an exception if the determinant is zero.

## ◆ Log()

template<unsigned int Dim>

SquareMatrix< Dim > Util::SquareMatrix::Log | ( | const Matrix< Dim, Dim > & | m,
|  | double | eps = 0.0001 )
| static

This method returns the logarithm of a matrix, using the specified threshold to terminate the approxmation.

## ◆ operator*() [1/2]

template<unsigned int Dim>
template<unsigned int Cols>

Matrix< Dim, Cols > Util::SquareMatrix::operator* | ( | const Matrix< Dim, Cols > & | m | ) | const

Multiplication of matrices

## ◆ operator*() [2/2]

template<unsigned int Dim>

Point< Dim-1 > Util::SquareMatrix::operator* | ( | const Point< Dim-1 > & | p | ) | const

This method transforms a (Dim-1)-dimensional point by applying the projective transformation.

## ◆ setInverse()

template<unsigned int Dim>

bool Util::SquareMatrix::setInverse | ( | Matrix< Dim, Dim > & | m | ) | const

This method tries to set the reference to the inverse of the matrix. The boolean value indicates if it succeeded (i.e. if the matrix is non-singular).

## ◆ skewSymmetrize()

template<unsigned int Dim>

SquareMatrix< Dim > Util::SquareMatrix::skewSymmetrize | ( | void |  | ) | const

This method returns nearest skew-symmetric matrix

## ◆ SquareRoot()

template<unsigned int Dim>

SquareMatrix< Dim > Util::SquareMatrix::SquareRoot | ( | const Matrix< Dim, Dim > & | m,
|  | double | eps = 0.000001 )
| static

This method returns the square-root of a matrix, using the specified threshold to terminate the approxmation.

## ◆ subDeterminant()

template<unsigned int Dim>

double Util::SquareMatrix::subDeterminant | ( | int | r,
|  | int | c ) const

This method returns the determinant of the sub-matrix with the prescribed columns and rows removed.

## ◆ SVD()

template<unsigned int Dim>

void Util::SquareMatrix::SVD | ( | Matrix< Dim, Dim > & | r1,
|  | Matrix< Dim, Dim > & | diagonal,
|  | Matrix< Dim, Dim > & | r2 ) const

This method computes the SVD decomposition of the Dim x Dim matrix, such that r1 and r2 are rotations and the Dim x Dim matrix is equal to r1*diagonal*r2

## ◆ symmetrize()

template<unsigned int Dim>

SquareMatrix< Dim > Util::SquareMatrix::symmetrize | ( | void |  | ) | const

This method returns nearest symmetric matrix

## ◆ trace()

template<unsigned int Dim>

double Util::SquareMatrix::trace | ( | void |  | ) | const

This method returns the trace of the matrix.

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

- Assignments/Util/geometry.h
- Assignments/Util/geometry.inl
- Assignments/Util/geometry.todo.inl