Honeycomb  0.1
Component-Model Framework
Public Types | Public Member Functions | List of all members
honey::Qrd< Real > Class Template Reference

QR Decomposition. Can be used to solve least squares problems. More...

#include <Qrd.h>

Public Types

enum  Mode { Mode::full, Mode::reduced }
 
typedef Matrix< matrix::dynamic, matrix::dynamic, RealMatrix
 

Public Member Functions

 Qrd ()
 
template<class T >
 Qrd (const MatrixBase< T > &a, Mode mode=Mode::reduced)
 Calculate the QRD of matrix A. More...
 
template<class T >
Qrdcalc (const MatrixBase< T > &a, Mode mode=Mode::reduced)
 Calculate the QRD of matrix A. More...
 
bool isFullRank () const
 Check if the decomposed matrix has full rank (ie. all vectors are linearly independent; no vector is a linear combination of others) More...
 
template<class B , class X >
void solve (const MatrixBase< B > &b, MatrixBase< X > &x)
 Solve the linear system $ Ax = B $ where A is the decomposed matrix. A and B row sizes must match. A must have full rank. More...
 
const Matrixq () const
 Get Q of the decomposition. More...
 
const Matrixr () const
 Get R of the decomposition. More...
 
const Matrixh () const
 Get the Householder column vectors that define the reflections. H is a (m x n) lower trapazoidal matrix. More...
 

Detailed Description

template<class Real>
class honey::Qrd< Real >

QR Decomposition. Can be used to solve least squares problems.

The reduced QRD of (m x n) matrix A with m >= n is: $ A = Q R $ where Q is an orthogonal (m x n) matrix, and R is an upper triangular (n x n) matrix.

The full QRD is: $ A = Q \begin{bmatrix} R \\ 0 \end{bmatrix} $ where Q is (m x m) and 0 is (m-n x n).

Most linear systems do not require the full QRD to solve.

Complexity: $ O(n^2 m) $

Member Typedef Documentation

template<class Real >
typedef Matrix<matrix::dynamic, matrix::dynamic, Real> honey::Qrd< Real >::Matrix

Member Enumeration Documentation

template<class Real >
enum honey::Qrd::Mode
strong
Enumerator
full 

compute full QRD

reduced 

compute reduced QRD

Constructor & Destructor Documentation

template<class Real >
honey::Qrd< Real >::Qrd ( )
inline
template<class Real >
template<class T >
honey::Qrd< Real >::Qrd ( const MatrixBase< T > &  a,
Mode  mode = Mode::reduced 
)
inline

Calculate the QRD of matrix A.

Member Function Documentation

template<class Real >
template<class T >
Qrd& honey::Qrd< Real >::calc ( const MatrixBase< T > &  a,
Mode  mode = Mode::reduced 
)
inline

Calculate the QRD of matrix A.

template<class Real >
const Matrix& honey::Qrd< Real >::h ( ) const
inline

Get the Householder column vectors that define the reflections. H is a (m x n) lower trapazoidal matrix.

template<class Real >
bool honey::Qrd< Real >::isFullRank ( ) const
inline

Check if the decomposed matrix has full rank (ie. all vectors are linearly independent; no vector is a linear combination of others)

template<class Real >
const Matrix& honey::Qrd< Real >::q ( ) const
inline

Get Q of the decomposition.

template<class Real >
const Matrix& honey::Qrd< Real >::r ( ) const
inline

Get R of the decomposition.

template<class Real >
template<class B , class X >
void honey::Qrd< Real >::solve ( const MatrixBase< B > &  b,
MatrixBase< X > &  x 
)
inline

Solve the linear system $ Ax = B $ where A is the decomposed matrix. A and B row sizes must match. A must have full rank.


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