|
numerics 0.1.0
|
Wrap any callable void(const Vector&, Vector&) as a LinearOp. More...
#include <subspace.hpp>
Public Member Functions | |
| CallableOp (F f, idx n) | |
| void | apply (const Vector &x, Vector &y) const override |
| y = A*x (y must be pre-allocated to the correct size) | |
| idx | rows () const noexcept override |
| idx | cols () const noexcept override |
Public Member Functions inherited from num::kernel::subspace::LinearOp | |
| virtual | ~LinearOp ()=default |
Wrap any callable void(const Vector&, Vector&) as a LinearOp.
Useful for structured operators – stencils, FFT-based, implicit matrices – without forming an explicit matrix. The functor is stored by value.
apply() pre-allocates y to the correct size (n_) before calling f_ so that callers (e.g. arnoldi_step passing a pre-allocated scratch buffer) never trigger a heap allocation inside the hot Arnoldi loop. Lambdas passed to make_op / make_op_ptr can safely assume y.size() == n on entry.
Definition at line 108 of file subspace.hpp.
|
inline |
Definition at line 109 of file subspace.hpp.
|
inlineoverridevirtual |
y = A*x (y must be pre-allocated to the correct size)
Implements num::kernel::subspace::LinearOp.
Definition at line 111 of file subspace.hpp.
References num::BasicVector< T >::size().
|
inlineoverridevirtualnoexcept |
Implements num::kernel::subspace::LinearOp.
Definition at line 116 of file subspace.hpp.
|
inlineoverridevirtualnoexcept |
Implements num::kernel::subspace::LinearOp.
Definition at line 115 of file subspace.hpp.