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
,
18 int nc
, int *vi
, double *vd
,
28 s
->schd
= scheme_data
;
32 SK_MALLOCHECK(s
->x
= malloc (sizeof(double) * nx
));
33 if (nc
> 0 && vi
!=NULL
&& vd
!=NULL
) {
34 sk_hist_init(&s
->hist
, nc
, vi
, vd
, t0
, dt
);
35 sk_hist_fill(&s
->hist
, hf
);
36 SK_MALLOCHECK(s
->c
= malloc(sizeof(double) * s
->nc
));
41 rk_seed(seed
, &(s
->rng
));
42 memcpy(s
->x
, x0
, sizeof(double) * s
->nx
);
48 void sk_solv_free(struct sk_solv
*s
)
53 sk_hist_free(&s
->hist
);
57 int sk_solv_cont(struct sk_solv
*s
)
63 sk_hist_get(&s
->hist
, s
->t
, s
->c
);
64 s
->sch(s
->schd
, &(s
->rng
), s
->sys
, s
->sysd
, s
->t
, s
->dt
,
65 s
->nx
, s
->x
, s
->nc
, s
->c
);
66 sk_hist_set(&s
->hist
, s
->t
, s
->x
);
67 s
->cont
= s
->out(s
->outd
, s
->t
, s
->nx
, s
->x
);
72 s
->sch(s
->schd
, &(s
->rng
), s
->sys
, s
->sysd
, s
->t
, s
->dt
,
73 s
->nx
, s
->x
, s
->nc
, s
->c
);
74 s
->cont
= s
->out(s
->outd
, s
->t
, s
->nx
, s
->x
);