Skip to content

num::unsafe::cg

Defined in header <linear/solvers/cg.hpp>

solver_result cg(const mat<real> &A, const vec<real> &b, vec<real> &x,
                 cg_options options = {});

Solve a system by conjugate gradients without checking that it is SPD: \(A x = b\).

Warning

On an indefinite or asymmetric matrix the iteration breaks down silently.