C++ Numerical Libraries

I haven been searching for C++ numerical libraries for scientific calculation. As I have come to several alternatives in the internet, so I decided to put it here.

IT++

URL: http://itpp.sourceforge.net/

Now this is my favorite, though Armadillo seems to be promising also. I have left Octave since I have to hack around to get certain functions to work, but not so with IT++.

Armadillo

URL: http://arma.sourceforge.net/

It looks promising, but still in early development. Armadillo 0.2.0 just out, the bug in eigen solver has been fixed.

Octave C++

URL: http://www.octave.org

Once you have installed octave, then you can use the C++ libraries. To read more on how to write a stand alone C++ code using liboctave, you can refer to my previous post:

http://techlogbook.wordpress.com/2008/09/19/writing-mixed-code-octav-e-and-c/

Some disadvantage is that it is pretty difficult to utilize the built-in functions. Most of the built-in functions are meant to be called from Octave interactive, not C++.

Gmm++

URL: http://home.gna.org/getfem/gmm_intro

This a simpler library compared to MTL2. It is used by Getfem++ by the same author.

MTL 2 and MTL 4

URL: http://www.osl.iu.edu/research/mtl/

MTL 4 is rather different than MTL 2. MTL 4 overloads many operators so that you can write C=A*B kind to solve linear problems. However, the development of MTL 4 is still in alpha. MTL2 has a better documentation.

NST++

URL: http://www.telemed.no/index.php?id=550350

This is developed by Norwegian Center for Telemedicine.  The program tried to achieve Matlab functionality using GSL libraries. However, I am unable to use it so far. It can’t compile. I will update again once it succeeds.

GSLWrap

URL: https://sourceforge.net/projects/gslwrap/

This is a C++ wrapper for GSL Libraries.

GSL–

URL: http://cholm.home.cern.ch/cholm/misc/gslmm/

This is also another GSL library wrapper in C++.

Flens

URL: http://flens.sourceforge.net/index.html

Similar to Gmm++ and MTL. I am trying it now.

5 Responses

  1. First of all thank you for useful information in this page and related articles around this blog.

    I am a bit confused about GSL and Octave. I am a C/C++ Developer but new to scientific libraries for C/C++. I want a comparison table between Octave & GSL regarding functionality and speed.

    Why didn’t use GSL and opt Octave? Could you please explain more …

  2. Hi Mani,
    I have not done any thorough comparison. But Octave is primarily used interactively like Matlab. It is just that the libraries can be used to write your own C++ code. It has a lot of functions and it can call GSL also. It can use Suitesparse for sparse matrix. However, to use it you have to install the whole Octave.

    GSL is mostly written in C, so some people tried to write a C++ wrapper for it. Actually there are other C++ libraries such as Blitz++ and uBlas. But I don’t really have much time to try it. For my needs, I need matrix operation and some mathematical special function. So I think the best is to use some Matrix library and GSL.

  3. @kurniawano: Thank you very much for your answer, I will surf around more and write some sample codes. If I get anything valuable to blog, I’ll let you know :)

  4. The eigensolver in Armadillo should work now. Let me know if you have any particular requests for functionality.

  5. some other C++ numerical Libraries that I know:
    eigen
    Boost uBlas ()
    Blitz
    POOMA
    TNT
    Lapack++
    eigen seems quite promising (Includes fixed size and dynamic size Matrices and uses expression templates (like Armadilla, UBLas, Blitz,.. do)

Leave a Reply