Hi
I need a good, fast maths library.
I need support for both win and nix platforms. Especially for win
Anton I.
Below are some of the libraries I've found useful, and have managed to
compile with VC++ version 8, with more or less difficulty.
For distributions, I highly recommend cephes cprob,
http://www.netlib.org/cephes/
You can use boost for the major distributions, but don't rely on
boost::math::quantile for the inverse, in particular,
const boost::math::students_t dist(dof);
const double t = boost::math::quantile(dist, y);
is pathological. The inverse functions in cephes are excellent.
For non linear solvers, have a look at:
asa (Adaptive Simulated Annealing)-
http://sourceforge.net/projects/asa-caltech/
minuit -
http://wwwasdoc.web.cern.ch/wwwasdoc/minuit/minmain.html
levmar (Levenberg-Marquardt )
http://www.ics.forth.gr/~lourakis/levmar/
brent solver -
http://www.netlib.org/c/
The brent solver is generally fast, but doesn't always converge for a
difficult function. I've found asa very reliable for difficult
functions in one parameter, if there's a global minimum, it finds it.
I've had good experience with minuit for multi-dimensional non-linear
problems. In general you need more than one solver in your toolkit,
it's worthwhile taking the time to wrap them so that you can easily
replace one with another.
lapack (
http://www.netlib.org/lapack/) provides excellent linear
algrebra routines, I'd suggest downloading lapack-3.2.1-CMAKE.zip and
figuring out how to use CMAKE
http://www.cmake.org/cmake/help/runningcmake.html.
It would be nice to have a C++ matrix library that nicely wraps the
lapack data structures, but I haven't found one, boost's ublas is
unfortunately not it.
For a few hundred dollars, you can get a very high quality
implementation of the lapack routines with Intel's math library
http://software.intel.com/en-us/articles/intel-mkl/. You'll easily
get a 3x or more performance improvement running an lapack routine,
more if you have multiple cores and are using the parallel version of
the library.
I'd suggest buying a copy of Numerical Recipes, third editon,
http://www.nr.com/, and the downloadable source. I really dislike the
NR coding conventions, I use it sparringly, and rewrite what I do
use. But if you need something, say cubic spline interpolation,
you'll find it here. I do recommend the NR random number generators,
primarily because they've been so widely used and vetted, and are
known to be reliable.
-- Daniel