OONumerics User :

From: Gabriel M. Beddingfield (gabriel_at_[hidden])
Date: 2005-01-24 21:54:05


On Monday 24 January 2005 03:36 pm, Nick Cummings wrote:

> I'm a physics graduate student working on a problem for which I need to do
> a bit of numerical linear algebra, which I've not had much experience doing

Take a look at MTL
http://www.osl.iu.edu/research/mtl/

Also check out Dongarra's list:
http://www.netlib.org/utk/people/JackDongarra/la-sw.html

Not c++, but also check out Octave. It's like matlab.
http://www.octave.org

> before. One possibility is using the FORTRAN package LAPACK, but I wanted
> to explore the possibility of using and object oriented approach in C++, so
> I was wondering if anyone could suggest a good, free library. I thought
> finding such a thing would be a breeze, but it seems it is harder than I
> thought to find what I want.

IMHO, this is par for the course in c++ numerics. There appears to be a lot
of half-done projects in c++. Outstanding among them is MTL. This appears
to be because nobody has put the weight (graduate research $$) behind a c++
linear algebra library. Why? Why, indeed! Have you seen just how big
LAPACK is?

If you're just getting started, c++ linear algebra is likely to frustrate you
and leave you a bit disillusioned. You may want to just learn how to
use/call LAPACK routines from your c++ programs. Start there, and then move
on to class libraries. When you're in a pinch, LAPACK will be your friend.

> As a bare minimum I require vector and matrix classes, matrix
> multiplication (as in A_ik = B_ij C_jk), the ability to easily solve the

There are lot of libraries that do this.

> matrix equation A*X = B for X, and the ability to exponentiate
> diagonalizable matrices (so a function to diagonalize them would do). I
> need to be able to do all these operations on dense complex valued

These are more scarce.

> a must. The ability to manipulate sparse matrices is also on the wish list
> of non-essential features. Any suggestions? I've looked at a few

IML
http://math.nist.gov/iml++/

> I thought at the outset that an OO approach would allow a much more
> transparent treatment of the formulae, e.g. with the ability to treat
> matrices as objects with operator overloading. And easy translation of

It does, but this sort of black-box approach typically comes at the price of
all the performance requirements you just gave. To really get away with this
sort of simplification, you'd probably need to look at packages like
Mathematica and Matlab.

To get the performance advantage of a high-powered library and enable the
programmer to simply code:

> formulae between the chalkboard and the program would be a big advantage
> for physicists who don't (and probably don't want to) spend a lot of time
> programming.

Perhaps you could collaborate with mathematicians and computer scientists who
*do* want to spend a lot of time programming. :-)

-- 
            G a b r i e l   M .  B e d d i n g f i e l d