numerics
0.1.0
Loading...
Searching...
No Matches
linear_solver.hpp
Go to the documentation of this file.
1
/// @file linalg/solvers/linear_solver.hpp
2
/// @brief Universal linear solver callable type.
3
///
4
/// LinearSolver is a first-class callable: given a right-hand side vector,
5
/// it solves A*x = rhs in-place. Any algorithm (CG, LU, Cholesky, ...) that
6
/// satisfies this contract can be stored as a LinearSolver and passed to ODE
7
/// integrators, PDE time-steppers, or nonlinear solvers without change.
8
///
9
/// Factory functions in linalg/solvers/ return LinearSolver:
10
/// num::make_cg_solver(A)
11
/// num::make_lu_solver(A) (planned)
12
/// num::make_chol_solver(A) (planned)
13
#pragma once
14
15
#include "
core/vector.hpp
"
16
#include "
linalg/solvers/solver_result.hpp
"
17
#include <functional>
18
19
namespace
num
{
20
21
/// Callable that solves A*x = rhs in-place. rhs is passed by value so
22
/// the solver can use it as a work vector without copying.
23
using
LinearSolver
= std::function<
SolverResult
(
const
Vector
&rhs,
Vector
&x)>;
24
25
}
// namespace num
num::BasicVector< real >
num
Definition
quadrature.hpp:8
num::LinearSolver
std::function< SolverResult(const Vector &rhs, Vector &x)> LinearSolver
Definition
linear_solver.hpp:23
solver_result.hpp
Common result type shared by all iterative solvers.
num::SolverResult
Definition
solver_result.hpp:8
vector.hpp
Vector operations.
include
linalg
solvers
linear_solver.hpp
Generated by
1.9.8