SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
tron.h
Go to the documentation of this file.
1 #ifndef _CTron_H
2 #define _CTron_H
3 
4 #include <shogun/lib/config.h>
5 
6 #include <shogun/base/SGObject.h>
7 
8 #ifndef DOXYGEN_SHOULD_SKIP_THIS
9 namespace shogun
10 {
12 class function
13 {
14 public:
22  virtual float64_t fun(float64_t *w) = 0 ;
23 
31  virtual void grad(float64_t *w, float64_t *g) = 0 ;
32 
40  virtual void Hv(float64_t *s, float64_t *Hs) = 0 ;
41 
48  virtual int32_t get_nr_variable() = 0 ;
49 
50  virtual ~function(){}
51 };
52 #endif // DOXYGEN_SHOULD_SKIP_THIS
53 
55 class CTron : public CSGObject
56 {
57 public:
58  CTron() { }
65  CTron(
66  const function *fun_obj, float64_t eps = 0.1, int32_t max_iter = 1000);
67  virtual ~CTron();
68 
74  void tron(float64_t *w, float64_t max_train_time);
75 
77  virtual const char* get_name() const { return "Tron"; }
78 
79 private:
80  int32_t trcg(float64_t delta, double* g, double* s, double* r);
81  float64_t norm_inf(int32_t n, float64_t *x);
82 
83  float64_t eps;
84  int32_t max_iter;
85  function *fun_obj;
86 };
87 }
88 #endif
class Tron
Definition: tron.h:55
double float64_t
Definition: common.h:50
virtual const char * get_name() const
Definition: tron.h:77
CTron()
Definition: tron.h:58
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18

SHOGUN Machine Learning Toolbox - Documentation