Spike
Loading...
Searching...
No Matches
Integrations.h
Go to the documentation of this file.
1
6
#ifndef SPIKE_INTEGRATIONS_H
7
#define SPIKE_INTEGRATIONS_H
8
9
#include <cmath>
10
#include <functional>
11
#include <gsl/gsl_math.h>
12
#include <iostream>
13
14
template
<
typename
F>
class
gsl_function_pp
:
public
gsl_function {
15
public
:
16
explicit
gsl_function_pp
(
const
F &func) : gsl_function_struct(), _func(func) {
17
function = &gsl_function_pp::invoke;
18
params =
this
;
19
}
20
21
private
:
22
const
F &_func;
23
static
double
invoke(
double
x,
void
*params) {
24
return
static_cast<
gsl_function_pp
*
>
(params)->_func(x);
25
}
26
};
27
28
// wrapper functions for integration routines of the gsl
29
double
cquad(
const
std::function<
double
(
double
)> &f,
double
a,
double
b,
30
double
relerr,
double
epsabs);
31
double
qags(
const
std::function<
double
(
double
)> &f,
double
a,
double
b,
32
double
relerr,
double
epsabs);
33
double
qagil(
const
std::function<
double
(
double
)> &f,
double
a,
double
relerr,
34
double
epsabs);
35
36
double
heaviside(
double
x);
37
38
39
#endif
// SPIKE_INTEGRATIONS_H
gsl_function_pp
Definition
Integrations.h:14
Spike
Integration
Integrations.h
Generated by
1.10.0