Repository navigation
Expand file tree
/
Copy pathsolver.h
More file actions
62 lines (45 loc) · 1.35 KB
/
Copy pathsolver.h
File metadata and controls
62 lines (45 loc) · 1.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef SOLVER_MODULE_H
#define SOLVER_MODULE_H
#include <stdlib.h>
#include <math.h>
#include <gsl/gsl_errno.h>
#include <gsl/gsl_math.h>
#include <gsl/gsl_multiroots.h>
#include "kernels.h"
#include "vector.h"
typedef int (*FFunc)(const gsl_vector *, void *, gsl_vector *);
typedef int (*DFunc)(const gsl_vector *, void *, gsl_matrix *);
typedef int (*FDFunc)(const gsl_vector *, void *, gsl_vector *,
gsl_matrix *);
/*
* Avaliable kernel types
*/
#define KURTIC 'k'
#define RGARDEN 'r'
#define POLYEXP 'p'
/*
* Holds info about problem initial data
*/
struct problem_info{
struct linspace k_grid; /* grid of kurtosis excess */
struct linspace d_grid; /* grid of dispersion */
struct linspace space_grid; /* grid of space */
int iter_count; /* iteration max count */
double eps; /* precision */
char kern_type; /* kernel type */
FFunc f; /* function GSL representation */
DFunc df; /* derivative GSL representation */
FDFunc fdf; /* function and derivative GSL */
};
/*
* Holds info about problem solution (kernel parameters)
*/
struct result{
struct vector_func a;
struct vector_func b;
};
/*
* Solves the problem
*/
struct result solve(struct problem_info *p);
#endif