Conjugate gradient solvers (dense and matrix-free)
constexpr T ipow(T x) noexcept
Compute x^N at compile time via repeated squaring.
void matvec(const Matrix &A, const Vector &x, Vector &y, Backend b=default_backend)
y = A * x
BasicVector< real > Vector
Real-valued dense vector with full backend dispatch (CPU + GPU)
Vector expv(real t, const MatVecFn &matvec, idx n, const Vector &v, int m_max=30, real tol=1e-8)
Compute exp(t*A)*v via Krylov-Padé approximation (matrix-free)
std::function< void(const Vector &, Vector &)> MatVecFn
Callable type for matrix-free matvec: computes y = A*x.
Compressed Sparse Row (CSR) matrix and operations.