ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itk::QRDecomposition< T > Class Template Reference

#include <itkQRDecomposition.h>

Detailed Description

template<typename T>
class itk::QRDecomposition< T >

QR decomposition A = Q R of a real or complex matrix, backed by Eigen.

Eigen-backed replacement for vnl_qr. The factors Q (orthonormal/unitary) and R (upper triangular) are computed once in the constructor via Eigen's HouseholderQR and stored as vnl matrices, so no Eigen type appears in the public interface. Q/R follow Eigen's sign convention; rely on the QR identities Q R == A and Q^* Q == I rather than on specific factor signs.

Definition at line 42 of file itkQRDecomposition.h.

Public Types

using MatrixType = vnl_matrix<T>
 
using VectorType = vnl_vector<T>
 

Public Member Functions

GetDeterminant () const
 
const MatrixTypeGetQ () const
 
const MatrixTypeGetR () const
 
 QRDecomposition (const MatrixType &A)
 
VectorType Solve (const VectorType &b) const
 

Private Attributes

m_Determinant {}
 
MatrixType m_Q
 
MatrixType m_R
 
bool m_Square { false }
 

Member Typedef Documentation

◆ MatrixType

template<typename T>
using itk::QRDecomposition< T >::MatrixType = vnl_matrix<T>

Definition at line 45 of file itkQRDecomposition.h.

◆ VectorType

template<typename T>
using itk::QRDecomposition< T >::VectorType = vnl_vector<T>

Definition at line 46 of file itkQRDecomposition.h.

Constructor & Destructor Documentation

◆ QRDecomposition()

template<typename T>
itk::QRDecomposition< T >::QRDecomposition ( const MatrixType & A)
inlineexplicit

Definition at line 48 of file itkQRDecomposition.h.

References m_Determinant, m_Q, m_R, and m_Square.

Member Function Documentation

◆ GetDeterminant()

template<typename T>
T itk::QRDecomposition< T >::GetDeterminant ( ) const
inline

Determinant of a square A (zero-initialized value for non-square A).

Definition at line 114 of file itkQRDecomposition.h.

References m_Determinant.

◆ GetQ()

template<typename T>
const MatrixType & itk::QRDecomposition< T >::GetQ ( ) const
inline

Orthonormal/unitary factor Q (rows x rows).

Definition at line 73 of file itkQRDecomposition.h.

References m_Q.

◆ GetR()

template<typename T>
const MatrixType & itk::QRDecomposition< T >::GetR ( ) const
inline

Upper-triangular factor R (rows x cols).

Definition at line 80 of file itkQRDecomposition.h.

References m_R.

◆ Solve()

template<typename T>
VectorType itk::QRDecomposition< T >::Solve ( const VectorType & b) const
inline

Solve A x = b (least-squares for an overdetermined A) using x = R^-1 Q^* b. A must have full column rank; a rank-deficient R yields a non-finite x.

Definition at line 88 of file itkQRDecomposition.h.

References m_Q, and m_R.

Member Data Documentation

◆ m_Determinant

template<typename T>
T itk::QRDecomposition< T >::m_Determinant {}
private

Definition at line 122 of file itkQRDecomposition.h.

Referenced by GetDeterminant(), and QRDecomposition().

◆ m_Q

template<typename T>
MatrixType itk::QRDecomposition< T >::m_Q
private

Definition at line 120 of file itkQRDecomposition.h.

Referenced by GetQ(), QRDecomposition(), and Solve().

◆ m_R

template<typename T>
MatrixType itk::QRDecomposition< T >::m_R
private

Definition at line 121 of file itkQRDecomposition.h.

Referenced by GetR(), QRDecomposition(), and Solve().

◆ m_Square

template<typename T>
bool itk::QRDecomposition< T >::m_Square { false }
private

Definition at line 123 of file itkQRDecomposition.h.

Referenced by QRDecomposition().


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