-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathode_utils.h
More file actions
43 lines (33 loc) · 731 Bytes
/
ode_utils.h
File metadata and controls
43 lines (33 loc) · 731 Bytes
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
#ifndef COMPUTING_ODE_UTILS_H
#define COMPUTING_ODE_UTILS_H
typedef double (*UnaryFunc)(double x);
typedef double (*BiVarFunc)(double x, double y);
typedef struct {
int size;
double r_start;
double r_end;
double data[];
} FunctionTable;
typedef struct {
double val;
double loss;
} LossPair;
typedef struct {
double x;
double y;
} Coord;
double eval_func(const FunctionTable *table, double x);
double deriv(UnaryFunc f, double x);
LossPair var_solve(
UnaryFunc lhs,
UnaryFunc rhs,
double start,
double end,
int amt);
FunctionTable* ode_solve(
BiVarFunc f,
Coord anchor,
double r_start,
double r_end,
int r_amt);
#endif // COMPUTING_ODE_UTILS_H