Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Good maths library

Reply
Thread Tools

Good maths library

 
 
NEG
Guest
Posts: n/a
 
      10-25-2010
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.
 
Reply With Quote
 
 
 
 
Juha Nieminen
Guest
Posts: n/a
 
      10-26-2010
NEG <(E-Mail Removed)> wrote:
> 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/
 
Reply With Quote
 
 
 
 
Jeff Flinn
Guest
Posts: n/a
 
      10-26-2010
NEG wrote:
> 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...tml/index.html
provide what you are looking for.

Jeff
 
Reply With Quote
 
Daniel
Guest
Posts: n/a
 
      10-27-2010
On Oct 25, 7:07*pm, NEG <(E-Mail Removed)> wrote:
> 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...t/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
 
Reply With Quote
 
Martin B.
Guest
Posts: n/a
 
      10-27-2010
On 26.10.2010 01:07, NEG wrote:
> 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
 
Reply With Quote
 
Anton Ivanov
Guest
Posts: n/a
 
      10-27-2010
Ok, thank you all
looks like I'll use alglib for interpolation and boost for other things
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Maths in HTML Geoff HTML 10 01-06-2007 06:25 AM
Maths expression drawing library Ross Clement (Email address invalid - do not use) Java 4 10-02-2006 05:52 AM
Maths Involved Calum Maciver Java 5 02-19-2006 10:17 PM
bit of a maths quesiton Andrew Bullock C++ 2 02-05-2005 08:15 PM
thanx all now maths prob for offspring Kenneth Computer Support 12 12-07-2003 03:22 PM



Advertisments