12#ifndef ARCCORE_ALINA_PRECONDITIONERONLYSOLVER_H
13#define ARCCORE_ALINA_PRECONDITIONERONLYSOLVER_H
26#include "arccore/alina/SolverUtils.h"
27#include "arccore/alina/AlinaUtils.h"
32namespace Arcane::Alina
40template <
class Backend,
class InnerProduct = detail::default_inner_product>
46 typedef Backend backend_type;
48 typedef typename Backend::vector vector;
49 typedef typename Backend::value_type value_type;
50 typedef typename Backend::params backend_params;
52 typedef typename math::scalar_of<value_type>::type scalar_type;
55 typename math::rhs_of<value_type>::type>::return_type coef_type;
63 const backend_params& = backend_params(),
64 const InnerProduct& inner_product = InnerProduct())
66 , inner_product(inner_product)
84 template <
class Matrix,
class Precond,
class Vec1,
class Vec2>
101 template <
class Precond,
class Vec1,
class Vec2>
104 return (*
this)(P.system_matrix(), P, rhs, x);
116 <<
"\nUnknowns: " << s.n
117 <<
"\nMemory footprint: " << human_readable_memory(s.
bytes())
125 InnerProduct inner_product;
128 scalar_type norm(
const Vec& x)
const
130 return sqrt(math::norm(inner_product(x, x)));
Solver which only apply preconditioner once.
SolverResult operator()(const Precond &P, const Vec1 &rhs, Vec2 &&x) const
Computes the solution for the given right-hand side.
SolverResult operator()(const Matrix &, const Precond &P, const Vec1 &rhs, Vec2 &&x) const
Computes the solution for the given system matrix.
Alina::detail::empty_params params
PreconditionerOnlySolver(size_t n, const params &=params(), const backend_params &=backend_params(), const InnerProduct &inner_product=InnerProduct())
Preallocates necessary data structures for the system of size n.
size_t bytes() const
Mémoire utilisée en octets.
Classe de base pour les solveurs.
Classe pour gérer une liste de paramètres vide.
Matrix class, to be used by user.
Default implementation for inner product.