MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
gmres.hpp File Reference
#include <mtl/detail/exceptions.hpp>
#include <mtl/concepts/vector.hpp>
#include <cmath>
#include <limits>
#include <type_traits>
#include <stdexcept>
#include <vector>
#include <mtl/vec/dense_vector.hpp>
#include <mtl/mat/dense2D.hpp>
#include <mtl/operation/dot.hpp>
#include <mtl/operation/norms.hpp>
#include <mtl/operation/givens.hpp>
#include <mtl/operation/mult.hpp>
#include <mtl/itl/krylov/apply_operator.hpp>
#include <mtl/itl/krylov/scaled_rhs.hpp>
#include <mtl/math/identity.hpp>

Classes

struct  mtl::itl::detail::gmres_workspace< Value >
 gmres's vectors, allocated once per solve rather than per restart cycle and per Arnoldi step: kmax + 1 basis vectors were zero-filled on every cycle (about 250 MB at n = 1e6 and restart 30), and two vectors were allocated on every step (issue 924). More...
struct  mtl::itl::detail::gmres_no_unscale
 The identity, for a gmres_inner called without a scaled right-hand side. More...

Namespaces

namespace  mtl
namespace  mtl::itl
namespace  mtl::itl::detail

Functions

template<typename Accumulator, typename LinearOp, typename VecX, typename VecB, typename PC, typename Iter, typename Value, typename Unscale>
int mtl::itl::detail::gmres_cycle (const LinearOp &A, VecX &x, const VecB &b, const PC &M, Iter &iter, int kmax, gmres_workspace< Value > &ws, const Unscale &unscale)
 One GMRES cycle in the workspace ws, for the right-hand side b.
template<typename Accumulator = void, typename LinearOp, typename VecX, typename VecB, typename PC, typename Iter>
requires FieldVector<VecX>
int mtl::itl::detail::gmres_inner (const LinearOp &A, VecX &x, const VecB &b, const PC &M, Iter &iter, int kmax)
 Single GMRES cycle (inner iteration) – up to kmax Arnoldi steps.
template<typename Accumulator = void, typename LinearOp, typename VecX, typename VecB, typename PC, typename Iter>
requires FieldVector<VecX>
int mtl::itl::gmres (const LinearOp &A, VecX &x, const VecB &b, const PC &M, Iter &iter, int restart=30)
 GMRES with restart.