21 using namespace Eigen;
26 CRationalApproximationCGMJob::CRationalApproximationCGMJob()
44 m_linear_solver=linear_solver;
47 m_operator=linear_operator;
54 m_const_multiplier=const_multiplier;
57 void CRationalApproximationCGMJob::init()
61 m_const_multiplier=0.0;
69 SG_ADD(&m_vector,
"trace_sample",
72 SG_ADD(&m_weights,
"complex_shifts",
75 SG_ADD(&m_weights,
"complex_weights",
78 SG_ADD(&m_const_multiplier,
"constant_multiplier",
79 "Constant multiplier to be multiplied with the final solution",
MS_NOT_AVAILABLE);
93 REQUIRE(m_operator,
"Operator is not set!\n");
100 "Number of shifts and weights are not equal!\n");
104 m_operator, m_vector, m_shifts, m_weights);
117 float64_t result=map_vector.dot(map_agg);
119 result*=m_const_multiplier;
133 #endif // HAVE_EIGEN3
Base class that stores the result of an independent job when the result is a scalar.
const index_t get_dimension() const
virtual ~CRationalApproximationCGMJob()
CRationalApproximationCGMJob()
SGVector< float64_t > get_imag()
class that uses conjugate gradient method for solving a shifted linear system family where the linear...
virtual void submit_result(CJobResult *result)=0
Class SGObject is the base class of all shogun objects.
Template class that aggregates scalar job results in each submit_result call, finalize then transform...
Abstract base class that provides an interface for computing an aggeregation of the job results of in...
virtual SGVector< T > apply(SGVector< T > b) const =0
all of classes and functions are contained in the shogun namespace
Abstract base for general computation jobs to be registered in CIndependentComputationEngine. compute method produces a job result and submits it to the internal JobResultAggregator. Each set of jobs that form a result will share the same job result aggregator.
virtual SGVector< complex128_t > solve_shifted_weighted(CLinearOperator< float64_t > *A, SGVector< float64_t > b, SGVector< complex128_t > shifts, SGVector< complex128_t > weights)
CJobResultAggregator * m_aggregator