Assignments
Assignments
Util::Matrix< Dim, Dim > Class Template Reference

#include <geometry.h>

Inheritance diagram for Util::Matrix< Dim, Dim >:
Util::_BaseMatrix< Dim, Dim, Matrix< Dim, Dim >, Matrix< Dim, Dim > > Util::InnerProductSpace< Matrix< Dim, Dim > > Util::Algebra< Matrix< Dim, Dim > > Util::VectorSpace< Element > Util::_InnerProductSpace< Element >

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< Element >
double squareNorm (void) const
 
double length (void) const
 
Element 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< Element >
static double Dot (const Element &e1, const Element &e2)
 
static double SquareNorm (const Element &e)
 
static double Length (const Element &e)
 
static double SquareDistance (const Element &e1, const Element &e2)
 
static double Distance (const Element &e1, const Element &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 upper 3x3 matrix, such that r1 and r2 are rotations and the upper 3x3 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: