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_impl.ipp File Reference

Implements the template classes and functions in MatrixAlgorithms.hpp. More...

#include "../include/MatrixAlgorithms.hpp"
#include <memory>
#include <stdexcept>
#include <vector>
Include dependency graph for MatrixAlgorithms_impl.ipp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 anonymous_namespace{MatrixAlgorithms_impl.ipp}
 

Macros

#define _MATRIXALGORITHMS_IMPL_IPP
 

Functions

template<typename MatrixT >
MatrixT anonymous_namespace{MatrixAlgorithms_impl.ipp}::exp_by_squaring (const MatrixT &M, size_t n)
 
template<typename MatrixT >
MatrixT::value_type anonymous_namespace{MatrixAlgorithms_impl.ipp}::trace (const MatrixT &M, size_t n)
 
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

Implements the template classes and functions in MatrixAlgorithms.hpp.

Definition in file MatrixAlgorithms_impl.ipp.

Macro Definition Documentation

#define _MATRIXALGORITHMS_IMPL_IPP

Definition at line 19 of file MatrixAlgorithms_impl.ipp.

Function Documentation

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

Finds the determinant of a square matrix.

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.

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: