15 #ifndef ALLIUM_LA_GMRES_HPP
16 #define ALLIUM_LA_GMRES_HPP
18 #include "vector_storage.hpp"
19 #include "linear_operator.hpp"
20 #include "iterative_solver.hpp"
21 #include <allium/util/extern.hpp>
22 #include "default.hpp"
43 using Real = real_part_t<N>;
50 int iteration_count() {
return m_iteration_count; }
54 real_part_t<N> residual_norm,
55 real_part_t<N> abs_tol);
57 size_t m_max_krylov_size;
58 int m_iteration_count;
72 template <
typename V,
typename M>
74 std::shared_ptr<M> mat,
76 real_part_t<typename V::Number> tol = 1e-6)
79 solver.tolerance(tol);
81 solver.solve(result, rhs);
84 #define ALLIUM_LA_GMRES_DECL(extern, N) \
85 extern template class GmresSolverBase<N>; \
86 extern template class IterativeSolverMixin<GmresSolverBase<N>, DefaultVector<N>>;
87 ALLIUM_EXTERN_N(ALLIUM_LA_GMRES_DECL)
Implementation of the GMRES algorithm (Saad and Schultz, 1986).
Definition: gmres.hpp:40
Base class for iterative solvers.
Definition: iterative_solver.hpp:29
Mixin for iterative solvers, which implements the apply_matrix method.
Definition: iterative_solver.hpp:52
Abstract base class for any vector storage.
Definition: vector_storage.hpp:41
InitialGuess
Behavior for the initial guess.
Definition: linear_solver.hpp:32
void gmres(V &result, std::shared_ptr< M > mat, const V &rhs, real_part_t< typename V::Number > tol=1e-6)
Definition: gmres.hpp:73