![]() |
Reference documentation for deal.II version 9.3.3
|
#include <deal.II/lac/qr.h>
Public Types | |
using | Number = typename VectorType::value_type |
Public Member Functions | |
ImplicitQR () | |
virtual | ~ImplicitQR ()=default |
virtual bool | append_column (const VectorType &column) |
virtual void | remove_column (const unsigned int k=0) |
virtual void | multiply_with_Q (VectorType &y, const Vector< Number > &x) const |
virtual void | multiply_with_QT (Vector< Number > &y, const VectorType &x) const |
virtual void | multiply_with_A (VectorType &y, const Vector< Number > &x) const |
virtual void | multiply_with_AT (Vector< Number > &y, const VectorType &x) const |
boost::signals2::connection | connect_append_column_slot (const std::function< bool(const Vector< Number > &u, const Number &rho2, const Number &col_norm_sqr)> &slot) |
unsigned int | size () const |
const LAPACKFullMatrix< Number > & | get_R () const |
void | solve (Vector< Number > &x, const Vector< Number > &y, const bool transpose=false) const |
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 | |
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 Member Functions | |
void | apply_givens_rotation (const unsigned int i, const unsigned int k) |
Private Attributes | |
boost::signals2::signal< bool(const Vector< Number > &u, const Number &rho, const Number &col_norm_sqr)> | column_signal |
A class to obtain the triangular matrix of the
factorization together with the matrix
itself. The orthonormal matrix
is not stored explicitly, the name of the class. The multiplication with
can be represented as
, whereas the multiplication with
is given by
.
The class is designed to update a given (possibly empty) QR factorization due to the addition of a new column vector. This is equivalent to constructing an orthonormal basis by the Gram-Schmidt procedure. The class also provides update functionality when the column is removed.
The VectorType
template argument may either be a parallel and serial vector, and only need to have basic operations such as additions, scalar product, etc. It also needs to have a copy-constructor.
using ImplicitQR< VectorType >::Number = typename VectorType::value_type |
ImplicitQR< VectorType >::ImplicitQR | ( | ) |
Default constructor.
|
virtualdefault |
Destructor.
|
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
.
Implements BaseQR< VectorType >.
|
virtual |
Remove column and update QR factorization.
Starting from the given QR decomposition we aim at computing factorization of
.
Note that , where the RHS is included in
. Therefore
can be obtained by Cholesky decomposition.
Implements BaseQR< VectorType >.
|
virtual |
Set . The size of
should be consistent with the size of the R matrix.
Implements BaseQR< VectorType >.
|
virtual |
Set . The size of
should be consistent with the size of column vectors.
Implements BaseQR< VectorType >.
|
virtual |
Set . The size of
should be consistent with the size of the R matrix.
Implements BaseQR< VectorType >.
|
virtual |
Set . The size of
should be consistent with the size of column vectors.
Implements BaseQR< VectorType >.
boost::signals2::connection ImplicitQR< VectorType >::connect_append_column_slot | ( | const std::function< bool(const Vector< Number > &u, const Number &rho2, const Number &col_norm_sqr)> & | slot | ) |
Connect a slot to implement a custom check of linear dependency during addition of a column.
Here, u
is the last column of the to-be R matrix, rho
is its diagonal and col_norm_sqr
is the square of the norm of the column. The function should return
true
if the new column is linearly independent.
|
private |
Apply givens rotation in the (i,k)
-plane to zero out .
Return size of the subspace.
|
inherited |
Return the current upper triangular matrix R.
|
inherited |
Solve . Vectors
x
and y
should be consistent with the current size of the subspace. If transpose
is true
, is solved instead.
|
inherited |
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.
|
protectedinherited |
Compute where
is the matrix formed by the column vectors stored by this object.
|
protectedinherited |
Multiply with transpose columns stored in the object.
|
private |
Signal used to decide if the new column is linear dependent.
Here, u
is the last column of the to-be R matrix, rho
is its diagonal and col_norm_sqr
is the square of the norm of the column. The function should return
true
if the new column is linearly independent.
|
protectedinherited |
|
protectedinherited |