deal.II version GIT relicensing-2289-g1e5549a87a 2024-12-21 21:30:00+00:00
|
#include <deal.II/lac/qr.h>
Public Member Functions | |
virtual | ~BaseQR ()=default |
virtual bool | append_column (const VectorType &column)=0 |
virtual void | remove_column (const unsigned int k=0)=0 |
unsigned int | size () const |
const LAPACKFullMatrix< Number > & | get_R () const |
void | solve (Vector< Number > &x, const Vector< Number > &y, const bool transpose=false) const |
virtual void | multiply_with_Q (VectorType &y, const Vector< Number > &x) const =0 |
virtual void | multiply_with_QT (Vector< Number > &y, const VectorType &x) const =0 |
virtual void | multiply_with_A (VectorType &y, const Vector< Number > &x) const =0 |
virtual void | multiply_with_AT (Vector< Number > &y, const VectorType &x) const =0 |
boost::signals2::connection | connect_givens_slot (const std::function< void(const unsigned int i, const unsigned int j, const std::array< Number, 3 > &csr)> &slot) |
Protected Member Functions | |
BaseQR () | |
void | multiply_with_cols (VectorType &y, const Vector< Number > &x) const |
void | multiply_with_colsT (Vector< Number > &y, const VectorType &x) const |
Protected Attributes | |
std::vector< std::unique_ptr< VectorType > > | columns |
LAPACKFullMatrix< Number > | R |
unsigned int | current_size |
boost::signals2::signal< void(const unsigned int i, const unsigned int j, const std::array< Number, 3 > &)> | givens_signal |
Private Types | |
using | Number = typename VectorType::value_type |
A base class for thin QR implementations.
This class and classes derived from it are meant to build \(Q\) and \(R\) matrices one row/column at a time, i.e., by growing \(R\) matrix from an empty \(0\times 0\) matrix to \(N\times N\), where \(N\) is the number of added column vectors.
As a consequence, matrices which have the same number of rows as each vector (i.e. \(Q\) matrix) is stored as a collection of vectors of VectorType
.
|
private |
Default private constructor.
|
pure virtual |
Append column
to the QR factorization. Returns true
if the result is successful, i.e. the columns are linearly independent. Otherwise the column
is rejected and the return value is false
.
Implemented in QR< VectorType >, and ImplicitQR< VectorType >.
|
pure virtual |
Remove a column k
and update QR factorization.
Implemented in QR< VectorType >, and ImplicitQR< VectorType >.
Return size of the subspace.
const LAPACKFullMatrix< Number > & BaseQR< VectorType >::get_R | ( | ) | const |
Return the current upper triangular matrix R.
void BaseQR< VectorType >::solve | ( | Vector< Number > & | x, |
const Vector< Number > & | y, | ||
const bool | transpose = false |
||
) | const |
Solve \(Rx=y\). Vectors x
and y
should be consistent with the current size of the subspace. If transpose
is true
, \(R^Tx=y\) is solved instead.
|
pure virtual |
Set \(y = Qx\). The size of \(x\) should be consistent with the size of the R matrix.
Implemented in QR< VectorType >, and ImplicitQR< VectorType >.
|
pure virtual |
Set \(y = Q^Tx\). The size of \(x\) should be consistent with the size of column vectors.
Implemented in QR< VectorType >, and ImplicitQR< VectorType >.
|
pure virtual |
Set \(y = QRx\). The size of \(x\) should be consistent with the size of the R matrix.
Implemented in QR< VectorType >, and ImplicitQR< VectorType >.
|
pure virtual |
Set \(y = R^T Q^Tx\). The size of \(x\) should be consistent with the size of column vectors.
Implemented in QR< VectorType >, and ImplicitQR< VectorType >.
boost::signals2::connection BaseQR< VectorType >::connect_givens_slot | ( | const std::function< void(const unsigned int i, const unsigned int j, const std::array< Number, 3 > &csr)> & | slot | ) |
Connect a slot to retrieve a notification when the Givens rotations are performed.
The function takes two indices, i
and j
, describing the plane of rotation, and a triplet of numbers csr
(cosine, sine and radius, see Utilities::LinearAlgebra::givens_rotation()) which represents the rotation matrix.
|
protected |
Compute \(y=Hx\) where \(H\) is the matrix formed by the column vectors stored by this object.
|
protected |
Multiply with transpose columns stored in the object.
|
protected |
|
protected |