21 using namespace Eigen;
26 CConjugateOrthogonalCGSolver::CConjugateOrthogonalCGSolver()
46 SG_DEBUG(
"CConjugateOrthogonalCGSolver::solve(): Entering..\n");
49 REQUIRE(A,
"Operator is NULL!\n");
50 REQUIRE(A->get_dimension()==b.
vlen,
"Dimension mismatch!\n, %d vs %d",
51 A->get_dimension(), b.
vlen);
55 result.set_const(0.0);
88 SG_DEBUG(
"CG iteration %d, residual norm %f\n",
104 if (p_T_times_Ap==0.0)
135 SG_INFO(
"Iteration took %ld times, residual norm=%.20lf, time elapsed=%lf\n",
138 SG_DEBUG(
"CConjugateOrthogonalCGSolver::solve(): Leaving..\n");
143 #endif // HAVE_EIGEN3
Class Time that implements a stopwatch based on either cpu time or wall clock time.
std::complex< float64_t > complex128_t
void begin(const VectorXt &residual)
SGVector< float64_t > m_residuals
virtual SGVector< complex128_t > solve(CLinearOperator< SGVector< complex128_t >, SGVector< complex128_t > > *A, SGVector< float64_t > b)
virtual const char * get_name() const
const bool end(const VectorXt &residual)
float64_t m_absolute_tolerence
virtual ~CConjugateOrthogonalCGSolver()
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...
CConjugateOrthogonalCGSolver()
float64_t start(bool verbose=false)
const IterInfo get_iter_info() const
all of classes and functions are contained in the shogun namespace
index_t m_max_iteration_limit
Abstract template base class that represents a linear operator, e.g. a matrix.
const bool succeeded(const VectorXt &residual)
void set_const(T const_elem)
float64_t m_relative_tolerence