r_stats 0.1.0

A port of R's `nmath` stats module to Rust.
Documentation

Things I've done to make R's nmath library work

  1. Copied the nmath source
  2. Set MATHLIB_STANDALONE: telling nmath to build for use outside R
  3. Copied R's includes since they are still needed even with MATHLIB_STANDALONE.
  4. Copy Rconfig.h and config.h from the mingw dir (normally these files would be generated, but I think the math libs use very little of them).
  5. Copy Rmath.h from Rmath.h0.in and replace the build system placeholders (there are only 2).
  6. Manually whitelist the functions to include, otherwise we pull in a lot of stuff, including stuff outside the source tree (and also it doesn't compile for some reason).
  7. Rmath.h wierdly sets the normal functions as aliases - we have to use the raw function name here e.g. dnorm4.

I've done some work on rust versions of these functions in the riir branch. This branch should be used for testing those functions in future.

R is released as GPLv2 which I interpret as meaning this library must also be released as GPLv2. If all the functions were replaced with native rust ones, then the license could be changed to something more permissive.