Konrad Hinsen wrote:
> It is certainly not obvious that OOP will enhance productivity for tasks
> like writing an efficient linear algebra library - but that would be an
> interesting topic of discussion.
But if you want to have a linear algebra library which supports linear
algebra over different domains some features from object oriented languages
are very helpful, especially type abstraction, although I doubt the
correctness of the following statement by Todd Veldhuizen
> Languages providing operator overloading
> (for expressiveness) and templates (for type abstraction)
> have a definite advantage.
I assume, you think of templates in the sense of C++ - well, at least I do;
C++'s concept of type abstraction however is fast, but it might result in
very large object code/executables (as I actually see at the linear algebra
example, where our code is getting really large).
For example you could write say a matrix multiplication routine and
instantiate it for matrices over integers, rationals, maybe real and
complex numbers, numbers in Z/mZ and so on. This will produce the complete
multiplication code for each type in the executable. I would prefer to have
the code just once and decide at run time at the start of the
multiplication routine which functions are to be called for multiplication
and addition of ring elements (_just once_ (still one more time than with
C++'s templates), so C++'s virtual functions don't do either). So the only
solution (in C++) I see at the moment is to code this by hand - and then it
definitely looks more like a C-hack than like an object oriented
C++ - program.
I tend to say that for larger projects (say > 500K lines) in the number
theoretic area, at least the C++-variant of templates is far less useful,
than one would think at first.
Stefan Neis
This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 03:20:05 EST