-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstruct_init.c
More file actions
34 lines (26 loc) · 834 Bytes
/
struct_init.c
File metadata and controls
34 lines (26 loc) · 834 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
#include <stdlib.h>
#include "header.h"
parameters *param_init (double complex u, double A, double B, int N,
double S0, double T,double r, double K,
double V0, double sigma, double kappa,
double theta, double rho) {
parameters *init;
init = (parameters *) malloc(sizeof(parameters));
if (init == NULL) {
printf("memory error");
}
init -> u = u;
init -> A =A;
init -> B = B;
init -> N = N;
init -> S0 = S0;
init -> T = T;
init -> r = r;
init -> K = K;
init -> V0 = V0;
init -> sigma = sigma;
init -> kappa = kappa;
init -> theta = theta;
init -> rho = rho;
return init;
}