![]() |
Reference documentation for deal.II version 9.3.3
|
#include <deal.II/lac/householder.h>
Public Types | |
using | size_type = types::global_dof_index |
Public Member Functions | |
Householder ()=default | |
template<typename number2 > | |
Householder (const FullMatrix< number2 > &A) | |
template<typename number2 > | |
void | initialize (const FullMatrix< number2 > &A) |
template<typename number2 > | |
double | least_squares (Vector< number2 > &dst, const Vector< number2 > &src) const |
template<typename number2 > | |
double | least_squares (BlockVector< number2 > &dst, const BlockVector< number2 > &src) const |
template<class VectorType > | |
void | vmult (VectorType &dst, const VectorType &src) const |
template<class VectorType > | |
void | Tvmult (VectorType &dst, const VectorType &src) const |
Private Attributes | |
std::vector< number > | diagonal |
FullMatrix< double > | storage |
QR-decomposition of a full matrix.
This class computes the QR-decomposition of given matrix by the Householder algorithm. Then, the function least_squares() can be used to compute the vector minimizing
for a given vector
. The QR decomposition of
is useful for this purpose because the minimizer is given by the equation
which is easy to compute because
is an orthogonal matrix, and consequently
. Thus,
. Furthermore,
is triangular, so applying
to a vector only involves a backward or forward solve.
The class does not in fact store the and
factors explicitly as matrices. It does store
, but the
factor is stored as the product of Householder reflections of the form
where the vectors
are so that they can be stored in the lower-triangular part of an underlying matrix object, whereas
is stored in the upper triangular part.
The vectors and the
matrix now are in conflict because they both want to use the diagonal entry of the matrix, but we can only store one in these positions, of course. Consequently, the entries
are stored separately in the
diagonal
member variable.
<float> and <double>
; others can be generated in application programs (see the section on Template instantiations in the manual). Definition at line 79 of file householder.h.