vrcore  0.45
visuReal Messkern
 All Classes Files Functions Variables
orthogonal.hpp File Reference

The gmres algorithm. -*- c++ -*-. More...

#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/vector_proxy.hpp>
#include <boost/numeric/ublas/vector_of_vector.hpp>
#include <boost/numeric/ublas/vector_expression.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
#include <boost/numeric/ublas/operation.hpp>
#include <boost/numeric/ublas/operation_sparse.hpp>
#include <boost/numeric/ublas/matrix_sparse.hpp>
#include <boost/numeric/ublas/banded.hpp>
Include dependency graph for orthogonal.hpp:

Go to the source code of this file.

Functions

template<class Vector >
std::vector< Vector > orthogonal_system (std::vector< Vector > &basis)
 returns the orthogonal system of a given set of vectors More...
 
template<class Vector >
Vector orthogonal_vector (std::vector< Vector > &basis, Vector &v)
 preforms the orthogonalization of a given vector to a given basis using the arnoldi approach More...
 
template<class Matrix , class Vector >
Vector arnoldi_step (std::vector< Vector > &q, Matrix &A, Matrix &H, int n)
 preforms the orthogonalization of a given vector to a given basis using the arnoldi approach the basis is represented as a matrix More...
 
template<class Matrix , class Vector >
void gmres (const Matrix &A, Vector &x, const Vector &b, double tol)
 the standard gmres algorithm, without linear operator or any improvements More...
 
template<class Matrix , class LinOp , class Vector , class Precond >
unsigned int gmres_step (LinOp const &A, Vector &x, const Vector &b, Precond const &B, unsigned int const maxiter, double const tol)
 a single step of the gmres algorithm, one iteration. Returns true if the approach converges. More...
 
template<class Matrix , class LinOp , class Vector , class Precond >
int gmres_restarts (LinOp const &A, Vector &x, const Vector &b, Precond const &B, unsigned int const maxiter, unsigned int const nrestarts, double const tol)
 the gmres algorithm restarting after maxiter steps. nrestarts is the number of the allowed restarts More...
 
template<class Matrix , class LinOp , class Vector , class Precond >
int gmres_short (LinOp const &A, Vector &x, const Vector &b, Precond const &B, int number, int maxiter, double tol)
 /QGMRES. Only the last "number" vectors are taken into account, i.e. the orthogonalization depends only on the last number vectors. More...
 

Detailed Description

The gmres algorithm. -*- c++ -*-.

Function Documentation

template<class Matrix , class Vector >
Vector arnoldi_step ( std::vector< Vector > &  q,
Matrix &  A,
Matrix &  H,
int  n 
)

preforms the orthogonalization of a given vector to a given basis using the arnoldi approach the basis is represented as a matrix

  • Parameters
    Vectoris the type of the vectors
  • Parameters
    Matrixis the type of the matrix
template<class Matrix , class Vector >
void gmres ( const Matrix &  A,
Vector &  x,
const Vector &  b,
double  tol 
)

the standard gmres algorithm, without linear operator or any improvements

  • Parameters
    Vectoris the type of the vectors
  • Parameters
    Matrixis the type of the matrix
  • Note
    the input parameter x must be predefined
template<class Matrix , class LinOp , class Vector , class Precond >
int gmres_restarts ( LinOp const &  A,
Vector &  x,
const Vector &  b,
Precond const &  B,
unsigned int const  maxiter,
unsigned int const  nrestarts,
double const  tol 
)

the gmres algorithm restarting after maxiter steps. nrestarts is the number of the allowed restarts

  • Parameters
    LinOpis the type of the linear opeartor representing the matrix
  • Parameters
    Vectoris the type of the vectors
  • Parameters
    Matrixis the type of the matrix
  • Parameters
    Precondis the type of the used preconditioner
  • Note
    the input parameter x must be predefined

Here is the call graph for this function:

template<class Matrix , class LinOp , class Vector , class Precond >
int gmres_short ( LinOp const &  A,
Vector &  x,
const Vector &  b,
Precond const &  B,
int  number,
int  maxiter,
double  tol 
)

/QGMRES. Only the last "number" vectors are taken into account, i.e. the orthogonalization depends only on the last number vectors.

  • The solution x is updated at the end of each iteration.
  • Parameters
    LinOpis the type of the linear opeartor representing the matrix
  • Parameters
    Vectoris the type of the vectors
  • Parameters
    Matrixis the type of the matrix
  • Parameters
    Precondis the type of the used preconditioner
  • Note
    the input parameter x must be predefined

Here is the call graph for this function:

template<class Matrix , class LinOp , class Vector , class Precond >
unsigned int gmres_step ( LinOp const &  A,
Vector &  x,
const Vector &  b,
Precond const &  B,
unsigned int const  maxiter,
double const  tol 
)

a single step of the gmres algorithm, one iteration. Returns true if the approach converges.

  • Parameters
    LinOpis the type of the linear opeartor representing the matrix
  • Parameters
    Vectoris the type of the vectors
  • Parameters
    Matrixis the type of the matrix
  • Parameters
    Precondis the type of the used preconditioner
  • Note
    the input parameter x must be predefined, assume maxiter < A.image_size()

Here is the call graph for this function:

template<class Vector >
std::vector< Vector > orthogonal_system ( std::vector< Vector > &  basis)

returns the orthogonal system of a given set of vectors

  • Parameters
    Vectoris the type of the vectors
template<class Vector >
Vector orthogonal_vector ( std::vector< Vector > &  basis,
Vector &  v 
)

preforms the orthogonalization of a given vector to a given basis using the arnoldi approach

  • Parameters
    Vectoris the type of the vectors