27 using Apply = std::function<bool(
const double*,
double*)>;
82 Result
solve(
const std::vector<double>& rhs,
const Apply& matrix,
const Apply& inverse,
83 const Controls&
controls, std::vector<double>& output);
99 std::vector<double> basis_, hessenberg_, cosine_, sine_, g_, y_;
100 std::vector<double> x_, r_, w_, z_, update_, image_;
105 std::size_t bytes()
const;
Definition NativeGmres.hpp:25
std::size_t workspaceBytes() const
Count retained numerical workspace capacity in bytes.
Definition NativeGmres.hpp:89
Status
Definition NativeGmres.hpp:34
@ Breakdown
Definition NativeGmres.hpp:41
@ OperatorFailure
Definition NativeGmres.hpp:39
@ MemoryLimit
Definition NativeGmres.hpp:37
@ Stagnated
Definition NativeGmres.hpp:42
@ PreconditionerFailure
Definition NativeGmres.hpp:40
@ NonFinite
Definition NativeGmres.hpp:38
@ IterationLimit
Definition NativeGmres.hpp:43
@ InvalidInput
Definition NativeGmres.hpp:36
@ Converged
Definition NativeGmres.hpp:35
Result solve(const std::vector< double > &rhs, const Apply &matrix, const Apply &inverse, const Controls &controls, std::vector< double > &output)
Solve a dense-vector linear system with restarted fixed-right-preconditioned GMRES.
Definition NativeGmres.cpp:78
std::function< bool(const double *, double *)> Apply
Definition NativeGmres.hpp:27
void clearWorkspace()
Release all retained numerical workspace allocations.
Definition NativeGmres.hpp:96
Definition Controls.cpp:47
Definition AcceptedWaterVolumes.hpp:8
Definition NativeGmres.hpp:28
int restart
Definition NativeGmres.hpp:29
std::size_t workspace_limit_bytes
Definition NativeGmres.hpp:32
double absolute_tolerance
Definition NativeGmres.hpp:31
int stagnant_restarts
Definition NativeGmres.hpp:30
int max_iterations
Definition NativeGmres.hpp:29
double relative_tolerance
Definition NativeGmres.hpp:31
Definition NativeGmres.hpp:45
double estimated_residual
Definition NativeGmres.hpp:50
bool converged() const
Test whether the solve result passed true-residual acceptance.
Definition NativeGmres.hpp:58
Status status
Definition NativeGmres.hpp:46
int reorthogonalizations
Definition NativeGmres.hpp:48
bool happy_breakdown
Definition NativeGmres.hpp:51
std::size_t workspace_bytes
Definition NativeGmres.hpp:49
int iterations
Definition NativeGmres.hpp:47
bool reused_workspace
Definition NativeGmres.hpp:53
double tolerance
Definition NativeGmres.hpp:50
double true_residual
Definition NativeGmres.hpp:50
int matvecs
Definition NativeGmres.hpp:47
int restarts
Definition NativeGmres.hpp:47
int workspace_growths
Definition NativeGmres.hpp:52
int preconditioner_applications
Definition NativeGmres.hpp:48