Public Member Functions | Private Member Functions | Private Attributes | List of all members
vnl_qr< T > Class Template Reference

Extract the Q*R decomposition of matrix M. More...

#include <vnl_algo_fwd.h>

Public Member Functions

 vnl_qr (vnl_matrix< T > const &M)
 
 ~vnl_qr ()
 
vnl_matrix< T > inverse () const
 return the inverse matrix of M. More...
 
vnl_matrix< T > tinverse () const
 return the transpose of the inverse matrix of M. More...
 
vnl_matrix< T > recompose () const
 return the original matrix M. More...
 
vnl_matrix< T > solve (const vnl_matrix< T > &rhs) const
 Solve equation M x = rhs for x using the computed decomposition. More...
 
vnl_vector< T > solve (const vnl_vector< T > &rhs) const
 Solve equation M x = rhs for x using the computed decomposition. More...
 
determinant () const
 Return the determinant of M. This is computed from M = Q R as follows:. More...
 
vnl_matrix< T > const & Q () const
 Unpack and return unitary part Q. More...
 
vnl_matrix< T > const & R () const
 Unpack and return R. More...
 
vnl_vector< T > QtB (const vnl_vector< T > &b) const
 Return residual vector d of M x = b -> d = Q'b. More...
 
void extract_q_and_r (vnl_matrix< T > *q, vnl_matrix< T > *r) const
 

Private Member Functions

 vnl_qr (const vnl_qr< T > &)
 
vnl_qr< T > & operator= (const vnl_qr< T > &)
 

Private Attributes

vnl_matrix< T > qrdc_out_
 
vnl_vector< T > qraux_
 
vnl_vector< long > jpvt_
 
vnl_matrix< T > * Q_
 
vnl_matrix< T > * R_
 

Detailed Description

template<class T>
class vnl_qr< T >

Extract the Q*R decomposition of matrix M.

The decomposition is stored in a compact and time-efficient packed form, which is most easily used via the "solve" and "determinant" methods.

Definition at line 8 of file vnl_algo_fwd.h.

Constructor & Destructor Documentation

◆ vnl_qr() [1/2]

template<class T >
vnl_qr< T >::vnl_qr ( vnl_matrix< T > const &  M)

Definition at line 37 of file vnl_qr.hxx.

◆ ~vnl_qr()

template<class T >
vnl_qr< T >::~vnl_qr ( )

Definition at line 66 of file vnl_qr.hxx.

◆ vnl_qr() [2/2]

template<class T>
vnl_qr< T >::vnl_qr ( const vnl_qr< T > &  )
inlineprivate

Definition at line 78 of file vnl_qr.h.

Member Function Documentation

◆ determinant()

template<class T >
T vnl_qr< T >::determinant ( ) const

Return the determinant of M. This is computed from M = Q R as follows:.

|M| = |Q| |R|. |R| is the product of the diagonal elements. |Q| is (-1)^n as it is a product of Householder reflections. So det = -prod(-r_ii).

|M| = |Q| |R| |R| is the product of the diagonal elements. |Q| is (-1)^n as it is a product of Householder reflections. So det = -prod(-r_ii).

Definition at line 78 of file vnl_qr.hxx.

◆ extract_q_and_r()

template<class T>
void vnl_qr< T >::extract_q_and_r ( vnl_matrix< T > *  q,
vnl_matrix< T > *  r 
) const
inline

Definition at line 68 of file vnl_qr.h.

◆ inverse()

template<class T >
vnl_matrix< T > vnl_qr< T >::inverse ( ) const

return the inverse matrix of M.

Definition at line 251 of file vnl_qr.hxx.

◆ operator=()

template<class T>
vnl_qr<T>& vnl_qr< T >::operator= ( const vnl_qr< T > &  )
inlineprivate

Definition at line 79 of file vnl_qr.h.

◆ Q()

template<class T >
vnl_matrix< T > const & vnl_qr< T >::Q ( ) const

Unpack and return unitary part Q.

Definition at line 91 of file vnl_qr.hxx.

◆ QtB()

template<class T >
vnl_vector< T > vnl_qr< T >::QtB ( const vnl_vector< T > &  b) const

Return residual vector d of M x = b -> d = Q'b.

Definition at line 220 of file vnl_qr.hxx.

◆ R()

template<class T >
vnl_matrix< T > const & vnl_qr< T >::R ( ) const

Unpack and return R.

Definition at line 156 of file vnl_qr.hxx.

◆ recompose()

template<class T >
vnl_matrix< T > vnl_qr< T >::recompose ( ) const

return the original matrix M.

Definition at line 176 of file vnl_qr.hxx.

◆ solve() [1/2]

template<class T >
vnl_matrix< T > vnl_qr< T >::solve ( const vnl_matrix< T > &  rhs) const

Solve equation M x = rhs for x using the computed decomposition.

Definition at line 289 of file vnl_qr.hxx.

◆ solve() [2/2]

template<class T >
vnl_vector< T > vnl_qr< T >::solve ( const vnl_vector< T > &  rhs) const

Solve equation M x = rhs for x using the computed decomposition.

Solve equation M x = b for x using the computed decomposition.

Definition at line 189 of file vnl_qr.hxx.

◆ tinverse()

template<class T >
vnl_matrix< T > vnl_qr< T >::tinverse ( ) const

return the transpose of the inverse matrix of M.

Definition at line 270 of file vnl_qr.hxx.

Member Data Documentation

◆ jpvt_

template<class T>
vnl_vector<long> vnl_qr< T >::jpvt_
private

Definition at line 73 of file vnl_qr.h.

◆ Q_

template<class T>
vnl_matrix<T>* vnl_qr< T >::Q_
mutableprivate

Definition at line 74 of file vnl_qr.h.

◆ qraux_

template<class T>
vnl_vector<T> vnl_qr< T >::qraux_
private

Definition at line 72 of file vnl_qr.h.

◆ qrdc_out_

template<class T>
vnl_matrix<T> vnl_qr< T >::qrdc_out_
private

Definition at line 71 of file vnl_qr.h.

◆ R_

template<class T>
vnl_matrix<T>* vnl_qr< T >::R_
mutableprivate

Definition at line 75 of file vnl_qr.h.


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