31template<IsODEProblem P>
39 return ode_rk45(prob.f, prob.u0, p, obs);
42template<IsODEProblem P>
44 return ode_rk4(prob.f, prob.u0, {.t0 = prob.t0, .tf = prob.tf, .h = alg.h}, obs);
47template<IsODEProblem P>
49 return ode_euler(prob.f, prob.u0, {.t0 = prob.t0, .tf = prob.tf, .h = alg.h}, obs);
90template<
class Op,
class M>
101template<
class Op,
class Alg>
110template<
class Op,
class Alg>
116template<
class Op,
class Alg>
118 return {prob.
A, prob.
b, alg, std::move(u0)};
123template<
class Op,
class Alg>
130template<
class Op,
class Alg>
Algorithm tags: carry the numerics, not the mathematics.
Conjugate gradient solvers.
constexpr idx size() const noexcept
Sparse matrix in Compressed Sparse Row (CSR) format.
Compile-time contract for the matrix-free product y = A*x.
Operator declared to satisfy for all nonzero .
Operator declared to satisfy .
Storage and operator concepts for numerical routines.
Restarted GMRES for general linear systems.
Declared mathematical properties for stored matrices.
Minimum residual iteration for symmetric linear systems.
SolverResult run(const linalg::SPDMatrix< Matrix > &A, const Vector &b, Vector &u, const CG &a)
ODEResult ode_rk4(ODERhsFn f, Vector y0, ODEParams p={}, ObserverFn obs=nullptr)
Classic 4th-order Runge-Kutta, fixed step.
SolverResult gmres(const Op &A, const Vector &b, Vector &x, real tol=1e-6, idx max_iter=1000, idx restart=30)
Operator GMRES for any adapter.
LinearCache< Op, Alg > init(const LinearProblem< Op > &prob, const Alg &alg)
Build a solve cache; the iterate starts at zero.
SolverResult minres(const Op &A, const Vector &b, Vector &x, real tol=1e-10, idx max_iter=1000, Backend backend=default_backend)
std::function< void(real t, const Vector &y)> ObserverFn
ODEResult solve(const P &prob, const RK45 &alg, ObserverFn obs=nullptr)
BasicVector< real > Vector
Real-valued dense vector with full backend dispatch (CPU + GPU)
SolverResult pcg(const Op &A, const M &M_op, const Vector &b, Vector &x, real tol=1e-10, idx max_iter=1000, Backend backend=default_backend)
ODEResult ode_euler(ODERhsFn f, Vector y0, ODEParams p={}, ObserverFn obs=nullptr)
Forward Euler, 1st-order, fixed step.
SolverResult cg(const Matrix &A, const Vector &b, Vector &x, real tol=1e-10, idx max_iter=1000, Backend backend=default_backend)
ODEResult ode_rk45(ODERhsFn f, Vector y0, ODEParams p={}, ObserverFn obs=nullptr)
Adaptive Dormand-Prince RK45 with FSAL and PI step-size control.
ODE and symplectic integrators.
Preconditioned conjugate gradient.
Problem types: carry the mathematics, not the numerics.
Common result type shared by all iterative solvers.
Reusable linear-solve cache (CommonSolve init/solve!): a view of the problem plus the algorithm and t...
Vector u
warm-start on entry, solution on exit
Linear system A x = b. A is any matrix or LinearOperator; b the RHS. Non-owning view over A and b (bi...
Result of a linear solve: the solution vector plus convergence stats.
real residual
final residual norm ||b - A u||
idx iterations
iterations performed
bool converged
Whether tolerance was met.
idx iterations
Number of iterations performed.
real residual
Final residual norm ||b - Ax||.