#include <CgSolver.hpp>
Public Member Functions | |
CgSolver (size_t n_max_iterations=10000) | |
void | solve (const ublas::compressed_matrix< float_t > &eqs, const ublas::vector< float_t > &rhs, ublas::vector< float_t > &result) const |
This class implements a conjugated gradients solver by interfacing ITPACK.
imaging::CgSolver::CgSolver | ( | size_t | n_max_iterations = 10000 |
) | [inline] |
Constructs a CG solver. The solver iterates at most n_max_iterations times.
void imaging::CgSolver::solve | ( | const ublas::compressed_matrix< float_t > & | eqs, | |
const ublas::vector< float_t > & | rhs, | |||
ublas::vector< float_t > & | result | |||
) | const [virtual] |
Solves the system of equations defined by the matrix eqs and the vector rhs and writes the solution to result. The vector result is automatically resized to dimension of the system. If the sizes of the input data are such that the system cannot be solved an Exception is thrown.
Implements imaging::SolverInterface.