SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
RationalApproximation.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2013 Soumyajit De
8  * Written (W) 2013 Heiko Strathmann
9  */
10 
11 #ifndef RATIONAL_APPROXIMATION_H_
12 #define RATIONAL_APPROXIMATION_H_
13 
14 #include <shogun/lib/config.h>
16 
17 namespace shogun
18 {
19 
20 template<class T> class SGVector;
21 template<class RetType, class OperandType> class CLinearOperator;
22 class CIndependentComputationEngine;
23 class CJobResultAggregator;
24 class CEigenSolver;
25 
63 class CRationalApproximation : public COperatorFunction<float64_t>
64 {
65 public:
68 
83  CIndependentComputationEngine* computation_engine,
84  CEigenSolver* eigen_solver,
85  float64_t desired_accuracy,
86  EOperatorFunction function_type);
87 
89  virtual ~CRationalApproximation();
90 
99  virtual void precompute();
100 
113 
125 
128 
131 
134 
136  index_t get_num_shifts() const;
137 
139  void set_num_shifts(index_t num_shifts);
140 
142  virtual const char* get_name() const
143  {
144  return "RationalApproximation";
145  }
146 
147 protected:
150 
153 
156 
159 
161  int32_t m_num_shifts;
162 
165 
166 private:
168  void init();
169 
174  void compute_shifts_weights_const();
175 };
176 
177 }
178 
179 #endif // RATIONAL_APPROXIMATION_H_
Abstract template base class for computing for a linear operator C and a vector s. submit_jobs method creates a bunch of jobs needed to solve for this particular and attaches one unique job aggregator to each of them, then submits them all to the computation engine.
SGVector< complex128_t > get_weights() const
int32_t index_t
Definition: common.h:62
virtual CJobResultAggregator * submit_jobs(SGVector< float64_t > sample)=0
virtual const char * get_name() const
SGVector< complex128_t > m_shifts
double float64_t
Definition: common.h:50
Abstract base class of the rational approximation of a function of a linear operator (A) times vector...
Abstract base class that provides an interface for computing an aggeregation of the job results of in...
SGVector< complex128_t > m_weights
void set_num_shifts(index_t num_shifts)
Abstract base class that provides an abstract compute method for computing eigenvalues of a real valu...
Definition: EigenSolver.h:24
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
Abstract template base class that represents a linear operator, e.g. a matrix.
Abstract base class for solving multiple independent instances of CIndependentJob. It has one method, submit_job, which may add the job to an internal queue and might block if there is yet not space in the queue. After jobs are submitted, it might not yet be ready. wait_for_all waits until all jobs are completed, which must be called to guarantee that all jobs are finished.
SGVector< complex128_t > get_shifts() const

SHOGUN Machine Learning Toolbox - Documentation