et said:
Hi! I am looking for some linear algebra libraries in C++... without
much success!
Basically, I found that BLAS and LAPACK can, somehow, be interacted
with in C++. However, the whole OO approach of C++ is lost (at least to
my sight).
Do you have any suggestions, apart from building my own wrapper?
OO stuff is usually kept out of numerical stuff mainly due to the fact
that it provides ways to abstract data and concepts that, as a side
effect, add undesired performance penalties to the routines. So, as a
consequence, as those who develop numerical analysis routines tend to want
to milk every drop of performance out of their code, there is a tendency
to keep those techniques away from numerical analysis stuff.
Another issue which tends to lead people to adopt routines that implement
the BLAS API to handle numerical stuff is that they are a de facto
standard in the computing world. So, the BLAS api may not be the most OO-
friendly API available but everyone tends to use it, mainly because
everyone uses it. Adding to this, these routines that are made available
through the BLAS API tend to be highly optimized. Substance counts more
than style.
On the other and, C++ does provide support for templates, and they are
indeed useful.
Now, regarding your question, it really depends on what you want to do
with matrices and the characteristics of the particular problem that you
intend to solve. For example, if you need to solve large systems of
linear equations which end up generating sparse matrices then you are
better off chosing routines that explicitly support sparse matrices and
provide solvers for those problems. Instead, if all you want to do is
perform basic matrix algebra on small dense matrices then your
requirements are entirely different, and you may require some other
library.
So, before giving any suggestion, what stuff do you need to do with
matrices?
Rui Maciel