OONumerics User : |
From: Drew McCormack (drewmccormack_at_[hidden])
Date: 2005-01-25 01:52:23
On Jan 24, 2005, at 10:36 PM, Nick Cummings wrote:
> Hi,
>
> 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 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.
>
> 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 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
> matrices. Efficiency of operations on large matrices is the main
> concern rather than small. I would love to find a library that
> implements operator overloading on matrices (perhaps via expression
> templates), but that is not 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 libraries, but so far it looks like
> the sticking point is the ability to diagonalize non-symmetric
> matrices, as some libraries will only solve symmetric eigenvaule
> problems. I've also tried some that seem to have issues solving
> complex matrix equations.
>
> 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 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.
>
> Thanks for your insight,
>
> Nick
>
Hi Nick,
You could check out uBlas, which is part of Boost
(http://www.boost.org/). A good thing about Boost projects is that they
are less likely to just dwindle due to developer disinterest. There is
a graveyard full of old linear algebra libraries written in C++.
(Lapack++, for example. This would have been perfect for you, except it
has not been updated in a long time, and doesn't support complex
numbers.)
I went through the same search around 6 months ago, when I was looking
for a library for my project, a quantum chemistry package. In the end,
I got disillusioned, and just wrote my own matrix/vector classes,
wrapping lapack. I just wrote what I needed, and will add to it as I
need more. It took me about 2 weeks. Unfortunately, I think this is how
a lot of people do it, because there isn't a well supported package
around (except perhaps uBlas).
Good luck in your search.
Regards,
Drew McCormack
---------------------------------------------------------
Drew McCormack
www.maniacalextent.com