SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Integration.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) 2014 Wu Lin
8  * Written (W) 2013 Roman Votyakov
9  *
10  * The abscissae and weights for Gauss-Kronrod rules are taken form
11  * QUADPACK, which is in public domain.
12  * http://www.netlib.org/quadpack/
13  *
14  * See method comments which functions are adapted from GNU Octave,
15  * file quadgk.m: Copyright (C) 2008-2012 David Bateman under GPLv3
16  * http://www.gnu.org/software/octave/
17  *
18  * See method comments which functions are adapted from
19  * Gaussian Process Machine Learning Toolbox, file util/gauher.m,
20  * http://www.gaussianprocess.org/gpml/code/matlab/doc/
21  *
22  */
23 
24 #ifndef _INTEGRATION_H_
25 #define _INTEGRATION_H_
26 
27 #include <shogun/lib/config.h>
28 
29 
30 #include <shogun/base/SGObject.h>
34 
35 namespace shogun
36 {
37 template<class T> class SGVector;
38 
42 class CIntegration : public CSGObject
43 {
44 public:
74  float64_t b, float64_t abs_tol=1e-10, float64_t rel_tol=1e-5,
75  uint32_t max_iter=1000, index_t sn=10);
76 
99 
126 
127 
138 
139 
150 
155  virtual const char* get_name() const { return "Integration"; }
156 
157 private:
173  static void evaluate_quadgk(CFunction* f, CDynamicArray<float64_t>* subs,
175  float64_t* xgk, float64_t* wg, float64_t* wgk);
176 
192  static void evaluate_quadgk15(CFunction* f, CDynamicArray<float64_t>* subs,
194 
210  static void evaluate_quadgk21(CFunction* f, CDynamicArray<float64_t>* subs,
212 
224  static float64_t evaluate_quadgh(CFunction* f, index_t n, float64_t* xh,
225  float64_t* wh);
226 
240  static float64_t evaluate_quadgh64(CFunction* f);
241 };
242 }
243 #endif /* _INTEGRATION_H_ */
int32_t index_t
Definition: common.h:62
static float64_t integrate_quadgk(CFunction *f, float64_t a, float64_t b, float64_t abs_tol=1e-10, float64_t rel_tol=1e-5, uint32_t max_iter=1000, index_t sn=10)
static void generate_gauher(SGVector< float64_t > xgh, SGVector< float64_t > wgh)
Class that contains certain methods related to numerical integration.
Definition: Integration.h:42
Class of a function of one variable.
Definition: Function.h:22
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:112
static float64_t integrate_quadgh(CFunction *f)
double float64_t
Definition: common.h:50
static void generate_gauher20(SGVector< float64_t > xgh, SGVector< float64_t > wgh)
virtual const char * get_name() const
Definition: Integration.h:155
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
static float64_t integrate_quadgh_customized(CFunction *f, SGVector< float64_t > xgh, SGVector< float64_t > wgh)

SHOGUN Machine Learning Toolbox - Documentation