1 /* Apache 2.0 INS-AMU 2015 */
12 sk_sys sys
, void *sys_data
,
13 sk_sch scheme
, void *scheme_data
,
14 sk_out out
, void *out_data
,
15 sk_hist_filler hf
, void *hfill_data
,
18 int nc
, int *vi
, double *vd
,
28 s
->schd
= scheme_data
;
33 SK_MALLOCHECK(s
->x
= malloc (sizeof(double) * nx
));
34 SK_MALLOCHECK(s
->x0
= malloc (sizeof(double) * nx
));
35 if (nc
> 0 && vi
!=NULL
&& vd
!=NULL
) {
36 sk_hist_init(&s
->hist
, nc
, vi
, vd
, t0
, dt
);
37 sk_hist_fill(&s
->hist
, hf
, hfill_data
);
38 SK_MALLOCHECK(s
->c
= malloc(sizeof(double) * s
->nc
));
43 rk_seed(seed
, &(s
->rng
));
44 memcpy(s
->x
, x0
, sizeof(double) * s
->nx
);
45 memcpy(s
->x0
, x0
, sizeof(double) * s
->nx
);
51 void sk_solv_free(sk_solv
*s
)
57 sk_hist_free(&s
->hist
);
61 int sk_solv_cont(sk_solv
*s
)
67 sk_hist_get(&s
->hist
, s
->t
, s
->c
);
68 s
->sch(s
->schd
, &(s
->rng
), s
->sys
, s
->sysd
, s
->t
, s
->dt
,
69 s
->nx
, s
->x
, s
->nc
, s
->c
);
70 sk_hist_set(&s
->hist
, s
->t
, s
->x
);
71 s
->cont
= s
->out(s
->outd
, s
->t
, s
->nx
, s
->x
);
76 s
->sch(s
->schd
, &(s
->rng
), s
->sys
, s
->sysd
, s
->t
, s
->dt
,
77 s
->nx
, s
->x
, s
->nc
, s
->c
);
78 s
->cont
= s
->out(s
->outd
, s
->t
, s
->nx
, s
->x
);