elegent is hosted by Hepforge, IPPP Durham
Elegent
Math.h
1 /********************************************************************************
2 
3  Copyright 2013 Jan Kašpar
4 
5  This file is part of Elegent (http://elegent.hepforge.org/).
6 
7  Elegent is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  Elegent is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with Elegent. If not, see <http://www.gnu.org/licenses/>.
19 
20 ********************************************************************************/
21 
22 #ifndef _elegent_math_
23 #define _elegent_math_
24 
25 #include <TComplex.h>
26 
27 #include <gsl/gsl_integration.h>
28 
29 namespace Elegent
30 {
31 
37 extern bool abortOnIntegrationError;
40 
46 typedef double (* RealFunction)(double x, double *par, const void *obj);
47 
50 double RealIntegrate(
51  RealFunction fcn,
52  double *par,
53  const void *object,
54  double from,
55  double to,
56  double abs_err,
57  double rel_err,
58  unsigned long work_space_size,
59  gsl_integration_workspace *work_space,
60  const char* errorLabel=""
61  );
62 
65 typedef TComplex (* ComplexFunction)(double x, double *par, const void *obj);
66 
69 TComplex ComplexIntegrate(ComplexFunction fcn, double *par, const void *object,
70  double from, double to,
71  double abs_err, double rel_err,
72  unsigned long work_space_size, gsl_integration_workspace *work_space, const char* errorLabel="");
73 
74 } // namespace
75 
76 #endif
Definition: BHModel.h:28
TComplex(* ComplexFunction)(double x, double *par, const void *obj)
Represents a complex function of real variable.
Definition: Math.h:65
TComplex ComplexIntegrate(ComplexFunction fcn, double *par, const void *object, double from, double to, double abs_err, double rel_err, unsigned long work_space_size, gsl_integration_workspace *work_space, const char *errorLabel="")
Integration of a complex function of a real variable.
Definition: Math.cc:119
bool abortOnIntegrationError
Abort when integration error occurs?
Definition: Math.cc:31
double RealIntegrate(RealFunction fcn, double *par, const void *object, double from, double to, double abs_err, double rel_err, unsigned long work_space_size, gsl_integration_workspace *work_space, const char *errorLabel="")
Integration of a real function of a real variable.
Definition: Math.cc:58
double(* RealFunction)(double x, double *par, const void *obj)
Represents a real function of real variable.
Definition: Math.h:46