CAMLprim value ml_gsl_odeiv_evolve_alloc(value dim) { gsl_odeiv_evolve *e = gsl_odeiv_evolve_alloc(Int_val(dim)); value res; Abstract_ptr(res, e); return res; }
CAMLprim value ml_gsl_odeiv_alloc_system(value func, value ojac, value dim) { const int barr_flags = BIGARRAY_FLOAT64 | BIGARRAY_C_LAYOUT | BIGARRAY_EXTERNAL; struct mlgsl_odeiv_params *p; gsl_odeiv_system *syst; value res; p=stat_alloc(sizeof (*p)); p->dim = Int_val(dim); p->closure = func; register_global_root(&(p->closure)); p->jac_closure = (ojac == Val_none ? Val_unit : Unoption(ojac)); register_global_root(&(p->jac_closure)); p->arr1 = alloc(Int_val(dim) * Double_wosize, Double_array_tag); register_global_root(&(p->arr1)); p->arr2 = alloc(Int_val(dim) * Double_wosize, Double_array_tag); register_global_root(&(p->arr2)); p->mat = (ojac == Val_none) ? Val_unit : alloc_bigarray_dims(barr_flags, 2, NULL, Int_val(dim), Int_val(dim)); register_global_root(&(p->mat)); syst=stat_alloc(sizeof (*syst)); syst->function = ml_gsl_odeiv_func; syst->jacobian = ml_gsl_odeiv_jacobian; syst->dimension = Int_val(dim); syst->params = p; Abstract_ptr(res, syst); return res; }
CAMLprim value ml_gsl_bspline_alloc(value k, value nbreak) { value r; gsl_bspline_workspace *w = gsl_bspline_alloc (Long_val(k), Long_val(nbreak)); Abstract_ptr(r, w); return r; }
/* DISCRETE */ CAMLprim value ml_gsl_ran_discrete_preproc(value p) { gsl_ran_discrete_t *G; value r; G = gsl_ran_discrete_preproc(Double_array_length(p), Double_array_val(p)); Abstract_ptr(r, G); return r; }
CAMLprim value ml_gsl_odeiv_control_yp_new(value eps_abs, value eps_rel) { gsl_odeiv_control *c = gsl_odeiv_control_yp_new(Double_val(eps_abs), Double_val(eps_rel)); value res; Abstract_ptr(res, c); return res; }
CAMLprim value ml_gsl_wavelet_workspace_alloc (value n) { value r; gsl_wavelet_workspace *ws; ws = gsl_wavelet_workspace_alloc (Long_val (n)); Abstract_ptr (r, ws); return r; }
CAMLprim value ml_gsl_wavelet_alloc (value ty, value k) { value r; gsl_wavelet *w; w = gsl_wavelet_alloc (gslwavelettype_val (ty), Long_val (k)); Abstract_ptr (r, w); return r; }
CAMLprim value ml_gsl_odeiv_control_standard_new(value eps_abs, value eps_rel, value a_y, value a_dydt) { gsl_odeiv_control *c = gsl_odeiv_control_standard_new(Double_val(eps_abs), Double_val(eps_rel), Double_val(a_y), Double_val(a_dydt)); value res; Abstract_ptr(res, c); return res; }
CAMLprim value ml_gsl_odeiv_control_scaled_new(value eps_abs, value eps_rel, value a_y, value a_dydt, value scale_abs) { gsl_odeiv_control *c = gsl_odeiv_control_scaled_new(Double_val(eps_abs), Double_val(eps_rel), Double_val(a_y), Double_val(a_dydt), Double_array_val(scale_abs), Double_array_length(scale_abs)); value res; Abstract_ptr(res, c); return res; }
CAMLprim value ml_gsl_odeiv_step_alloc(value step_type, value dim) { const gsl_odeiv_step_type *steppers[] = { gsl_odeiv_step_rk2, gsl_odeiv_step_rk4, gsl_odeiv_step_rkf45, gsl_odeiv_step_rkck, gsl_odeiv_step_rk8pd, gsl_odeiv_step_rk2imp, gsl_odeiv_step_rk2simp, gsl_odeiv_step_rk4imp, gsl_odeiv_step_bsimp, gsl_odeiv_step_gear1, gsl_odeiv_step_gear2, }; gsl_odeiv_step *step = gsl_odeiv_step_alloc(steppers[ Int_val(step_type) ], Int_val(dim)); value res; Abstract_ptr(res, step); return res; }
CAMLprim value ml_gsl_multifit_linear_alloc(value n, value p) { value r; Abstract_ptr(r, gsl_multifit_linear_alloc(Int_val(n), Int_val(p))); return r; }
CAMLprim value ml_gsl_qrng_clone(value qrng) { value r; Abstract_ptr(r, gsl_qrng_clone(Qrng_val(qrng))); return r; }
CAMLprim value ml_gsl_qrng_alloc(value type, value dim) { value r; Abstract_ptr(r, gsl_qrng_alloc(qrngtype_val(type), Int_val(dim))); return r; }