mmottl / gsl-ocaml

OCaml bindings to the GSL (GNU Scientific Library).
Other
36 stars 10 forks source link

Bindings for gsl_ran_multivariate_gaussian #23

Closed igarnier closed 7 years ago

igarnier commented 7 years ago

Some code to allow sampling from multivariate gaussians.

mmottl commented 7 years ago

Thanks for contributing!

Btw., random number generation is pretty expensive. The implementation might benefit from releasing the OCaml lock around the call to GSL, which would also require protecting OCaml values and extracting GSL-values before releasing the lock. I'm aware that none of the other calls in the current bindings does this and would only change this on a personal by-need basis. But if it helps your code in multi-threaded environments, feel free to submit improvements.