KrisLibrary  1.0.0
Public Types | Public Member Functions | Public Attributes | List of all members
Math::QRDecomposition< T > Class Template Reference

Calculates the QR decomposition. More...

#include <QRDecomposition.h>

Public Types

typedef MatrixTemplate< T > MatrixT
 
typedef VectorTemplate< T > VectorT
 

Public Member Functions

bool set (const MatrixT &A)
 
void backSub (const VectorT &x, VectorT &b) const
 
void leastSquares (const VectorT &x, VectorT &b, VectorT &residual) const
 
void QMul (const VectorT &b, VectorT &x) const
 
void QtMul (const VectorT &b, VectorT &x) const
 
void RBackSub (const VectorT &b, VectorT &x) const
 
void getQ (MatrixT &Q) const
 
void getR (MatrixT &R) const
 

Public Attributes

MatrixT QR
 
VectorT tau
 

Detailed Description

template<class T>
class Math::QRDecomposition< T >

Calculates the QR decomposition.

Factorise an M x N matrix A into A = Q R, where Q is orthogonal (M x M) and R is upper triangular (M x N).

Q is stored as a packed set of Householder transformations in the strict lower triangular part of the input matrix. R is stored in the diagonal and upper triangle of the input matrix.

The full matrix for Q can be obtained as the product

  Q = Q_k .. Q_2 Q_1

where k = MIN(M,N) and

  Q_i = (I - tau_i * v_i * v_i')

and where v_i is a Householder vector

  v_i = [1, m(i+1,i), m(i+2,i), ... , m(M,i)]

This storage scheme is the same as in LAPACK.


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