SLIP
1.4
|
Provides some QR decomposition algorithms. More...
#include "linear_algebra.hpp"
#include "linear_algebra_traits.hpp"
#include "linear_algebra_svd.hpp"
#include "macros.hpp"
#include "gram_schmidt.hpp"
#include "compare.hpp"
#include <limits>
#include <vector>
Go to the source code of this file.
Namespaces | |
slip | |
This namespace corresponds to the kernel of the Simple Library on Image Processing (SLIP). That is to say that it contains the data structures and the algorithms needed by these data strucutres. | |
Functions | |
template<class Matrix1 , class Matrix2 > | |
void | slip::balance (Matrix1 &A, Matrix2 &D) |
applies a diagonal similarity transform to the square matrix A to make the rows and columns as close in norm as possible. Balancing may reduce the 1-norm of the matrix, and improves the accuracy of the computed eigenvalues and/or eigenvectors. To avoid round-off errors, balance scales A with powers of 2. A is replaced by the balanced matrix which has the same eigenvalues and singular values : ![]() | |
template<typename MatrixIterator1 , typename MatrixIterator2 , typename MatrixIterator3 > | |
void | slip::gram_schmidt_qr (MatrixIterator1 A_up, MatrixIterator1 A_bot, MatrixIterator2 Q_up, MatrixIterator2 Q_bot, MatrixIterator3 R_up, MatrixIterator3 R_bot, const typename slip::lin_alg_traits< typename MatrixIterator1::value_type >::value_type tol) |
(modified) Gram-Schmidt qr decomposition. More... | |
template<typename Matrix1 , typename Matrix2 , typename Matrix3 > | |
void | slip::gram_schmidt_qr (const Matrix1 &A, Matrix2 &Q, Matrix3 &R, const typename slip::lin_alg_traits< typename Matrix1::value_type >::value_type tol) |
(modified) Gram-Schmidt qr decomposition. More... | |
template<typename Matrix1 , typename Vector > | |
void | slip::householder_qr (Matrix1 &M, Vector &V0) |
in place Householder QR decomposition M = QR
Q is a rotation matrix and R is an upper triangular matrix More... | |
template<typename Matrix1 , typename Matrix2 , typename Matrix3 > | |
void | slip::householder_qr (const Matrix1 &M, Matrix2 &Q, Matrix3 &R) |
Computes the QR decomposition of a matrix M :
Q is a rotation matrix and R is an upper triangular matrix. More... | |
template<typename MatrixIterator > | |
std::size_t | slip::subdiag_smaller_elem (MatrixIterator A_up, MatrixIterator A_bot, typename slip::lin_alg_traits< typename std::iterator_traits< MatrixIterator >::value_type >::value_type precision) |
find the smaller non null (according to the precision) subdiagonal element of a matrix More... | |
template<typename MatrixIterator1 , typename MatrixIterator2 , typename MatrixIterator3 > | |
void | slip::Schur_factorization_2by2 (MatrixIterator1 A_up, MatrixIterator1 A_bot, MatrixIterator2 Z_up, MatrixIterator2 Z_bot, MatrixIterator3 D_up, MatrixIterator3 D_bot) |
Computes the Schur factorization of a real 2-by-2 2d container : ![]()
where : More... | |
template<class Matrix , typename VectorIterator > | |
void | slip::MatrixHouseholder (Matrix &H, VectorIterator V_begin, VectorIterator V_end) |
Computes the Householder matrix of a vector V :
If V is an householder vector of a matrix M then | |
template<class Vector , typename MatrixIterator > | |
void | slip::VectorHouseholder (Vector &V, MatrixIterator M_up, MatrixIterator M_bot) |
Computes a Householder vector V from a matrix M :
with
. More... | |
template<typename HessenbergMatrix , typename Matrix > | |
bool | slip::Francis_QR_Step (HessenbergMatrix &H, Matrix &Z, slip::Box2d< int > box, bool compute_z) |
Computes the Francis QR Step used in the Schur decomposition
Algorithm 7.5-1 in "Matrix Computations", Golub and Van Loan. More... | |
template<class HessenbergMatrix , class Vector , class Matrix > | |
void | slip::Francis_Schur_standardize (HessenbergMatrix &H, Vector &Eig, Matrix &Z, slip::Box2d< int > b22, bool compute_z) |
Converts a 2-by-2 diagonal block of H in the Schur form, normalizes H and extract the associated eigenvalues.
Algorithm 7.5-1 in "Matrix Computations", Golub and Van Loan. More... | |
template<class HessenbergMatrix , class Vector , class Matrix > | |
bool | slip::Francis_Schur_decomp (HessenbergMatrix &H, Vector &Eig, Matrix &Z, slip::Box2d< int > &box, typename slip::lin_alg_traits< typename HessenbergMatrix::value_type >::value_type precision, bool compute_Z) |
computes the Schur decomposition of a square Hessenberg Matrix and copy the eigenvalues in the Eig vector :
Algorithm 7.5-2 in "Matrix Computations", Golub and Van Loan. More... | |
template<class Matrix1 , class Matrix2 , class Vector , class Matrix3 > | |
bool | slip::schur (const Matrix1 &M, Matrix2 &H, Matrix3 &Z, Vector &Eig, bool compute_Z, typename slip::lin_alg_traits< typename Matrix1::value_type >::value_type precision=typename slip::lin_alg_traits< typename Matrix1::value_type >::value_type(1.0E-12)) |
computes the shur decomposition of a square Matrix and copy the eigenvalues in the Eig vector:
Algorithm 7.5-2 in "Matrix Computations", Golub and Van Loan. More... | |
template<class Matrix1 , class Matrix2 > | |
bool | slip::Sylvester_solve (const Matrix1 &S, slip::Box2d< int > &b11, slip::Box2d< int > &b22, double &g, Matrix2 &X) |
Solve the sylvester equation (from Z.Bai and J.W. Demmel article : -On Swapping Diagonal Blocks in Real Schur Form- In Linear Algebra and its Applications 186:73-95(1993)) : ![]() | |
Provides some QR decomposition algorithms.
Definition in file linear_algebra_qr.hpp.