TooN
Public Member Functions | List of all members
TooN::QR_Lapack< Rows, Cols, Precision > Class Template Reference

Performs QR decomposition. More...

#include <QR_Lapack.h>

Public Member Functions

template<int R, int C, class P , class B >
 QR_Lapack (const Matrix< R, C, P, B > &m, bool p=0)
 Construct the QR decomposition of a matrix. More...
 
const Matrix< Rows, Cols, Precision, ColMajor > & get_R ()
 Return R.
 
const Matrix< square_Size, square_Size, Precision, ColMajor > & get_Q ()
 Return Q.
 
const Vector< Cols, int > & get_P ()
 Return the permutation vector. More...
 

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()

template<int Rows = Dynamic, int Cols = Rows, class Precision = double>
template<int R, int C, class P , class B >
TooN::QR_Lapack< Rows, Cols, Precision >::QR_Lapack ( const Matrix< R, C, P, B > &  m,
bool  p = 0 
)
inline

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

◆ get_P()

template<int Rows = Dynamic, int Cols = Rows, class Precision = double>
const Vector<Cols, int>& TooN::QR_Lapack< Rows, Cols, Precision >::get_P ( )
inline

Return the permutation vector.

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


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