Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
uni20::krylov::KrylovVectorOps Concept Reference

Concept for opaque vector-space operations required by Krylov solvers. More...

#include <matrix_free.hpp>

Concept definition

template<typename Ops, typename Vector, typename Scalar>
concept uni20::krylov::KrylovVectorOps = requires(Ops ops, Vector x, Vector y, Scalar alpha) {
{ ops.problem_dimension() } -> std::convertible_to<std::size_t>;
{ ops.vector_dimension(x) } -> std::convertible_to<std::size_t>;
{ ops.allocate_like(x) } -> std::same_as<Vector>;
{ ops.copy(y, x) } -> std::same_as<void>;
{ ops.axpy(y, alpha, x) } -> std::same_as<void>;
{ ops.scal(y, alpha) } -> std::same_as<void>;
{ ops.set_zero(y) } -> std::same_as<void>;
{ ops.inner_product(x, y) } -> std::convertible_to<Scalar>;
}
Concept for numeric scalar types (integer, real, or complex).
Definition scalar_concepts.hpp:81
Concept for opaque vector-space operations required by Krylov solvers.
Definition matrix_free.hpp:382

Detailed Description

Concept for opaque vector-space operations required by Krylov solvers.

Native Krylov solvers keep solver state local to each call and do not use hidden global workspaces. They are therefore reentrant when each solve receives independent operation/vector state, and nested native solves from inside a matrix-free callback are valid. If an implementation is shared across concurrent solves, that implementation is responsible for synchronizing its own mutable backend/cache state. Krylov callbacks use the local convention that mutable/output vector arguments appear first, for example copy(y, x), axpy(y, alpha, x), and matvec(y, x). inner_product(x, y) returns the host scalar for <x,y>; for complex scalar types it is conjugate-linear in x and linear in y. Norms are exposed separately through optional norm(x), which returns a real host scalar.