Spectra::UpperHessenbergQR< Scalar > Class Template Reference

Description

template<typename Scalar = double>
class Spectra::UpperHessenbergQR< Scalar >

Perform the QR decomposition of an upper Hessenberg matrix.

Template Parameters
ScalarThe element type of the matrix. Currently supported types are float, double and long double.

#include <UpperHessenbergQR.h>

Public Member Functions

 UpperHessenbergQR (Index size)
 Constructor to preallocate memory. More...
 
 UpperHessenbergQR (ConstGenericMatrix &mat, const Scalar &shift=Scalar(0))
 Constructor to create an object that performs and stores the QR decomposition of an upper Hessenberg matrix mat, with an optional shift: \(H-sI=QR\). More...
 
virtual ~UpperHessenbergQR ()
 Virtual destructor.
 
virtual void compute (ConstGenericMatrix &mat, const Scalar &shift=Scalar(0))
 Compute the QR decomposition of an upper Hessenberg matrix with an optional shift. More...
 
virtual Matrix matrix_R () const
 Return the \(R\) matrix in the QR decomposition, which is an upper triangular matrix. More...
 
virtual void matrix_QtHQ (Matrix &dest) const
 Overwrite dest with \(Q^H H Q = RQ + sI\), where \(H\) is the input matrix mat, and \(s\) is the shift. More...
 
void apply_QY (Vector &Y) const
 Apply the \(Q\) matrix to a vector \(y\). More...
 
void apply_QtY (Vector &Y) const
 Apply the \(Q\) matrix to a vector \(y\). More...
 
void apply_QY (GenericMatrix Y) const
 Apply the \(Q\) matrix to another matrix \(Y\). More...
 
void apply_QtY (GenericMatrix Y) const
 Apply the \(Q\) matrix to another matrix \(Y\). More...
 
void apply_YQ (GenericMatrix Y) const
 Apply the \(Q\) matrix to another matrix \(Y\). More...
 
void apply_YQt (GenericMatrix Y) const
 Apply the \(Q\) matrix to another matrix \(Y\). More...
 

Protected Attributes

Index m_n
 
Scalar m_shift
 
RealArray m_rot_cos
 
Array m_rot_sin
 
bool m_computed
 

Constructor & Destructor Documentation

◆ UpperHessenbergQR() [1/2]

template<typename Scalar = double>
Spectra::UpperHessenbergQR< Scalar >::UpperHessenbergQR ( Index  size)
inline

Constructor to preallocate memory.

Computation can be performed later by calling the compute() method.

◆ UpperHessenbergQR() [2/2]

template<typename Scalar = double>
Spectra::UpperHessenbergQR< Scalar >::UpperHessenbergQR ( ConstGenericMatrix &  mat,
const Scalar &  shift = Scalar(0) 
)
inline

Constructor to create an object that performs and stores the QR decomposition of an upper Hessenberg matrix mat, with an optional shift: \(H-sI=QR\).

Here \(H\) stands for the matrix mat, and \(s\) is the shift.

Parameters
matMatrix type can be Eigen::Matrix<Scalar, ...> (e.g. Eigen::MatrixXd and Eigen::MatrixXf), or its mapped version (e.g. Eigen::Map<Eigen::MatrixXd>). Only the upper triangular and the subdiagonal elements of the matrix are used.

Member Function Documentation

◆ apply_QtY() [1/2]

template<typename Scalar = double>
void Spectra::UpperHessenbergQR< Scalar >::apply_QtY ( GenericMatrix  Y) const
inline

Apply the \(Q\) matrix to another matrix \(Y\).

Parameters
YA matrix that will be overwritten by the matrix product \(Q'Y\).

Matrix type can be Eigen::Matrix<Scalar, ...> (e.g. Eigen::MatrixXd and Eigen::MatrixXf), or its mapped version (e.g. Eigen::Map<Eigen::MatrixXd>).

◆ apply_QtY() [2/2]

template<typename Scalar = double>
void Spectra::UpperHessenbergQR< Scalar >::apply_QtY ( Vector &  Y) const
inline

Apply the \(Q\) matrix to a vector \(y\).

Parameters
YA vector that will be overwritten by the matrix product \(Q'y\).

Vector type can be Eigen::Vector<Scalar, ...>, depending on the template parameter Scalar defined.

◆ apply_QY() [1/2]

template<typename Scalar = double>
void Spectra::UpperHessenbergQR< Scalar >::apply_QY ( GenericMatrix  Y) const
inline

Apply the \(Q\) matrix to another matrix \(Y\).

Parameters
YA matrix that will be overwritten by the matrix product \(QY\).

Matrix type can be Eigen::Matrix<Scalar, ...> (e.g. Eigen::MatrixXd and Eigen::MatrixXf), or its mapped version (e.g. Eigen::Map<Eigen::MatrixXd>).

◆ apply_QY() [2/2]

template<typename Scalar = double>
void Spectra::UpperHessenbergQR< Scalar >::apply_QY ( Vector &  Y) const
inline

Apply the \(Q\) matrix to a vector \(y\).

Parameters
YA vector that will be overwritten by the matrix product \(Qy\).

Vector type can be Eigen::Vector<Scalar, ...>, depending on the template parameter Scalar defined.

◆ apply_YQ()

template<typename Scalar = double>
void Spectra::UpperHessenbergQR< Scalar >::apply_YQ ( GenericMatrix  Y) const
inline

Apply the \(Q\) matrix to another matrix \(Y\).

Parameters
YA matrix that will be overwritten by the matrix product \(YQ\).

Matrix type can be Eigen::Matrix<Scalar, ...> (e.g. Eigen::MatrixXd and Eigen::MatrixXf), or its mapped version (e.g. Eigen::Map<Eigen::MatrixXd>).

◆ apply_YQt()

template<typename Scalar = double>
void Spectra::UpperHessenbergQR< Scalar >::apply_YQt ( GenericMatrix  Y) const
inline

Apply the \(Q\) matrix to another matrix \(Y\).

Parameters
YA matrix that will be overwritten by the matrix product \(YQ'\).

Matrix type can be Eigen::Matrix<Scalar, ...> (e.g. Eigen::MatrixXd and Eigen::MatrixXf), or its mapped version (e.g. Eigen::Map<Eigen::MatrixXd>).

◆ compute()

template<typename Scalar = double>
virtual void Spectra::UpperHessenbergQR< Scalar >::compute ( ConstGenericMatrix &  mat,
const Scalar &  shift = Scalar(0) 
)
inlinevirtual

Compute the QR decomposition of an upper Hessenberg matrix with an optional shift.

Parameters
matMatrix type can be Eigen::Matrix<Scalar, ...> (e.g. Eigen::MatrixXd and Eigen::MatrixXf), or its mapped version (e.g. Eigen::Map<Eigen::MatrixXd>). Only the upper triangular and the subdiagonal elements of the matrix are used.

◆ matrix_QtHQ()

template<typename Scalar = double>
virtual void Spectra::UpperHessenbergQR< Scalar >::matrix_QtHQ ( Matrix &  dest) const
inlinevirtual

Overwrite dest with \(Q^H H Q = RQ + sI\), where \(H\) is the input matrix mat, and \(s\) is the shift.

The result is an upper Hessenberg matrix.

Parameters
matThe matrix to be overwritten, whose type should be Eigen::Matrix<Scalar, ...>, depending on the template parameter Scalar defined.

◆ matrix_R()

template<typename Scalar = double>
virtual Matrix Spectra::UpperHessenbergQR< Scalar >::matrix_R ( ) const
inlinevirtual

Return the \(R\) matrix in the QR decomposition, which is an upper triangular matrix.

Returns
Returned matrix type will be Eigen::Matrix<Scalar, ...>, depending on the template parameter Scalar defined.

The documentation for this class was generated from the following file:
  • /builds/uwsbel/chrono/src/chrono_thirdparty/spectra/Spectra/LinAlg/UpperHessenbergQR.h