Rex_chaos said:
Hi all,
I am looking for a high-performance container(matrix and vector) for
numerical computation. Someone recommended the boost::multi_array. After
having looked at the documentation, I know several more candidates from
it. They are : MTL, blitz++, boost::ublas. I have no idea which one is the
best. The documentation of these packages are trying to convince me that
they are free from drawback
) I need someone to tell me the experience
in using these packages. I must pick one of them before I begin my
development of a special numerical library based on it.
there's one more:
FLENS - Flexible Library for Efficient Numerical Solutions
http://sourceforge.net/projects/flens/
I am working in the department of numerical analysis at the University of
Ulm and we started about half a year ago with the implementation of FLENS.
First of all some reasons why we started with an own implementation might be
interesting for you:
MTL: It doesn't compile with iso standard conform compilers. It seams the
MTL-project is no longer active or at least has become a little sleepy.
It's also hard to maintain or to extend the MTL-code. And IMO to use MTL
is not always intuitive and the code just looks ugly (ok, matter of taste).
Blitz: Very nice and we copied some usability-features. But it's not ment
to be a numerical analysis library. It defines array-containers, provides
functionality to fill those ellegant, avoids unnecessary temoprary objects.
But if you need a matrix-vector multiplication or you need solvers for
linear equatiuons you have to implement this on your own (well, one thing
the developers of Blitz write themselves is that it's hard to extend,
partly due to the usage of expression templates)
boost::ublas I think from the above boost::ublas is best suited for
numerical analysis. It provides dense and sparse matrices, operations for
slicing (like in MatLab A(3:5, 7:8) just a less convenient notation). For
our purpose it was still not flexible enough regarding creation of own
matrix types. Another reason was, thst it also has some inconvenient
notations (not well suited for teaching purpose and some of our master
students are great mathematicians but poor programmers, they need a
interface as close to something like MatLab as possible.)
So I would say if you have to choose from the above 3 libs and if you really
need numerical functionality I would go with boost::ublas. However it
depends on what exactly your project is about (You said "special" numerical
library we experienced that "our special" required a more flexible
matrix-/vector concept)
So now some words about our library. Our master students use it for their
master thesis and in our lectures it's used for the exercises. But of
course it's only about 6 months old, so I don't want to claim that it is as
mature (and documented) as one of the lib's above. I only know that it
works fine for OUR teaching and research, but we steadily find and fix
bugs. If you plan to use our library you can tell me more about what your
project is about and I can tell you if it's reasonable IMO to really use
it. Of course, we would support by fixing flens-lib problems as soon as
possible over that time (like we do for our students).
cheers
Michael
P.S. a little example of what we call a usable interface:
DoubleDenseMatrix A(2, 2);
A = 1, 1,
1, 3
1, 5;
DoubleDenseVector b(3);
b = 4,
8,
11;
// SLICING
cout << "A(1:2,1:2) = " << A(_(1,2), _(1,2)) << endl;
cout << "b(1:2) = " << b(_(1,2)) << endl;
// SOLVE for x: A(1:2,1:2)*x = b(1:2)
cout << "x = A(1:2,1:2)/b(1:2) = "
<< A(_(1,2), _(1,2))/b(_(1,2)) << endl;