21 using namespace Eigen;
26 CConjugateGradientSolver::CConjugateGradientSolver()
46 SG_DEBUG(
"CConjugateGradientSolve::solve(): Entering..\n");
49 REQUIRE(A,
"Operator is NULL!\n");
54 result.set_const(0.0);
87 SG_DEBUG(
"CG iteration %d, residual norm %f\n",
134 SG_INFO(
"Iteration took %ld times, residual norm=%.20lf, time elapsed=%lf\n",
137 SG_DEBUG(
"CConjugateGradientSolve::solve(): Leaving..\n");
Class Time that implements a stopwatch based on either cpu time or wall clock time.
void begin(const VectorXt &residual)
const index_t get_dimension() const
CConjugateGradientSolver()
virtual SGVector< float64_t > solve(CLinearOperator< float64_t > *A, SGVector< float64_t > b)
SGVector< float64_t > m_residuals
const bool end(const VectorXt &residual)
virtual const char * get_name() const
float64_t m_absolute_tolerence
float64_t cur_time_diff(bool verbose=false)
template class that is used as an iterator for an iterative linear solver. In the iteration of solvin...
abstract template base for all iterative linear solvers such as conjugate gradient (CG) solvers...
float64_t start(bool verbose=false)
const IterInfo get_iter_info() const
virtual SGVector< T > apply(SGVector< T > b) const =0
all of classes and functions are contained in the shogun namespace
index_t m_max_iteration_limit
const bool succeeded(const VectorXt &residual)
virtual ~CConjugateGradientSolver()
void set_const(T const_elem)
float64_t m_relative_tolerence