Polymetic  1.1
A c++ library for polynomial and matrix arithmetic, focused on applications in Kinematics.
 All Classes Namespaces Files Functions Variables Typedefs Friends Macros Pages
MatrixAlgorithms.hpp File Reference

Declarations for algorithms that work on Matrices. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename MatrixT >
MatrixT exp (const MatrixT &M, size_t n)
 Finds the M^n for a square matrix M. More...
 
template<typename MatrixT >
MatrixT::value_type det (const MatrixT &M)
 Finds the determinant of a square matrix. More...
 

Detailed Description

Declarations for algorithms that work on Matrices.

Definition in file MatrixAlgorithms.hpp.

Function Documentation

template<typename MatrixT >
MatrixT::value_type det ( const MatrixT &  M)

Finds the determinant of a square matrix.

Todo:

Implement Matrix_Traits class to capture the requirements/properties of Matrix types at compile time to provide better error messages.

exp() uses exponentiation by squaring. Give user the ability to specify algorithm using a template parameter.

Template Parameters
MatrixTA Matrix type which supports indexing using (m,n), the *, + ,the transpose and the trace operators.
Todo:
Cache the matrix exponentiation results. This will eleminate a lot of redundant computation.

< Contains tr(M^(i+1)) is i-th position

Todo:
Make special arrangement when valueT is rational. This can be done using traits for the valueT

Definition at line 100 of file MatrixAlgorithms_impl.ipp.

References boost::numeric::ublas::isSquare(), and anonymous_namespace{MatrixAlgorithms_impl.ipp}::trace().

Referenced by anonymous_namespace{Test_MatrixAlgorithms_double.cpp}::TEST_F(), and anonymous_namespace{Test_MatrixAlgorithms_polynomial_double.cpp}::TEST_F().

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename MatrixT >
MatrixT exp ( const MatrixT &  M,
size_t  n 
)

Finds the M^n for a square matrix M.

Todo:

Implement Matrix_Traits class to capture the requirements/properties of Matrix types at compile time to provide better error messages.

exp() uses exponentiation by squaring. Give user the ability to specify algorithm using a template parameter.

Template Parameters
MatrixTA Matrix type which supports indexing using (m,n), the *, + and the transpose opeators.

Uses exponent by squaring

Definition at line 91 of file MatrixAlgorithms_impl.ipp.

References anonymous_namespace{MatrixAlgorithms_impl.ipp}::exp_by_squaring().

Referenced by anonymous_namespace{MatrixAlgorithms_impl.ipp}::trace().

Here is the call graph for this function:

Here is the caller graph for this function: