TooN 2.1
Public Member Functions
QR_Lapack< Rows, Cols, Precision > Class Template Reference

Performs QR decomposition. More...

#include <QR_Lapack.h>

List of all members.

Public Member Functions

template<int R, int C, class P , class B >
 QR_Lapack (const Matrix< R, C, P, B > &m, bool p=0)
const Matrix< Rows, Cols,
Precision, ColMajor > & 
get_R ()
const Matrix< square_Size,
square_Size, Precision,
ColMajor > & 
get_Q ()
const Vector< Cols, int > & get_P ()

Detailed Description

template<int Rows = Dynamic, int Cols = Rows, class Precision = double>
class TooN::QR_Lapack< Rows, Cols, Precision >

Performs QR decomposition.

Warning:
this will only work if the number of columns is greater than the number of rows!

The QR decomposition operates on a matrix A. It can be performed with or without column pivoting. In general:

\[ AP = QR \]

Where $P$ is a permutation matrix constructed to permute the columns of A. In practise, $P$ is stored as a vector of integer elements.

With column pivoting, the elements of the leading diagonal of $R$ will be sorted from largest in magnitude to smallest in magnitude.


Constructor & Destructor Documentation

QR_Lapack ( const Matrix< R, C, P, B > &  m,
bool  p = 0 
)

Construct the QR decomposition of a matrix.

This initialises the class, and performs the decomposition immediately.

Parameters:
mThe matrix to decompose
pWhether or not to perform pivoting

Member Function Documentation

const Vector<Cols, int>& get_P ( )

Return the permutation vector.

The definition is that column $i$ of A is column $P(i)$ of $QR$.