00001 #ifndef MTH_QR_H 00002 #define MTH_QR_H 00003 00004 #include "mthMatrix.h" 00005 00009 namespace mth { 00010 00019 template <class T, unsigned M, unsigned N> 00020 unsigned decomposeQR( 00021 Matrix<T,M,N> const& a, 00022 Matrix<T,M,M>& q, 00023 Matrix<T,M,N>& r); 00024 00031 template <class T, unsigned M, unsigned N> 00032 void backsubUT( 00033 Matrix<T,M,N> const& r, 00034 Vector<T,M> const& b, 00035 Vector<T,N>& x); 00036 00045 template <class T, unsigned M, unsigned N> 00046 void solveFromQR(Matrix<T,M,M> const& q, 00047 Matrix<T,M,N> const& r, 00048 Vector<T,M> const& b, Vector<T,N>& x); 00049 00057 template <class T, unsigned M, unsigned N> 00058 bool solveQR(Matrix<T,M,N> const& a, 00059 Vector<T,M> const& b, Vector<T,N>& x); 00060 00061 template <class T, unsigned M> 00062 void reduceToHessenberg(Matrix<T,M,M> const& a, Matrix<T,M,M>& q, 00063 Matrix<T,M,M>& h); 00064 00075 template <class T, unsigned M> 00076 bool eigenQR(Matrix<T,M,M> const& a, 00077 Matrix<T,M,M>& l, 00078 Matrix<T,M,M>& q, 00079 unsigned max_iters); 00080 00081 } 00082 00083 #endif