Good maths library

N

NEG

Hi
I need a good, fast maths library.
It would be great if it's written in c++ but c will be very good too.
I've already looked at GSL but as I understood it won't run on msvc but
I need support for both win and nix platforms. Especially for win
because there are no *nixes as desktops there.
Lib should support cubic interpolation, distributions, matrices, random
number generators.

Thank you in advance

Anton I.
 
J

Juha Nieminen

NEG said:
I need a good, fast maths library.
It would be great if it's written in c++ but c will be very good too.
I've already looked at GSL but as I understood it won't run on msvc but
I need support for both win and nix platforms. Especially for win
because there are no *nixes as desktops there.
Lib should support cubic interpolation, distributions, matrices, random
number generators.

I don't know if it will suit your needs, but check the PARI library:
http://pari.math.u-bordeaux.fr/
 
J

Jeff Flinn

NEG said:
Hi
I need a good, fast maths library.
It would be great if it's written in c++ but c will be very good too.
I've already looked at GSL but as I understood it won't run on msvc but
I need support for both win and nix platforms. Especially for win
because there are no *nixes as desktops there.
Lib should support cubic interpolation, distributions, matrices, random
number generators.

Does http://www.boost.org/doc/libs/1_44_0/libs/math/doc/html/index.html
provide what you are looking for.

Jeff
 
D

Daniel

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
 
M

Martin B.

Hi
I need a good, fast maths library.
It would be great if it's written in c++ but c will be very good too.
I've already looked at GSL but as I understood it won't run on msvc but
I need support for both win and nix platforms. Especially for win
because there are no *nixes as desktops there.
Lib should support cubic interpolation, distributions, matrices, random
number generators.

Have a look at ALGLIB: http://www.alglib.net/

I only use it for interpolation, but it works fine on VS2005.

br,
Martin
 
A

Anton Ivanov

Ok, thank you all
looks like I'll use alglib for interpolation and boost for other things
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top