"Richard Weidner" <richard@spartacus.jpl.nasa.gov> wrote:
|On Jul 23, 9:36am, Paul Beardsley wrote:
|> 1. What is the most extensively implemented library for
|> matrix and vector classes at the moment, which uses the
|> STL generic approach?
|>
..
|My experience is that such a beast is not really a good idea.
|It can never be efficient for every practitioner.
..
|I am not saying a standard library is a bad idea. I would think the
|best, most extensive library for regression analysis would be useful.
|The people who work in that area may have found a common implementation
|that uses the STL generic approach that is efficient for them. But I
|can guarantee it would not be the best approach for people doing computer
|graphics.
(many thoughtful comments clipped)
Perhaps what would be required is not to use the STL techniques
(necessarily), but to use the STL philosophy. That is, the user has the
ability to choose the implementation based on what would be most
appropriate for their use. For instance, I can choose to store data in an
STL list or a STL vector depending on whether I want to insert often and
don't need random access (in which case the list is better), or if
insertions will be rare and I need fast random access (in which case the
vector is better).
Such a system would require:
a) a lot of up-front design or prototyping (as I understand STL did) to
find a way of making it work efficiently while allowing the user choice of
representation and algorithm, and
b) an awful lot of development work, since providing multiple
representations and algorithms would considerably increase the size of the
task when compared with a "normal" numerical library.
Apart from the clear advantages described above, however, the system would
have the advantage that it would be somewhat usable in a part-completed
state - e.g. if the first sets of algorithms and representations emphasised
efficiency for some particular class of problems, then it would be useful
for that class of problems relatively early in its development.
Two important difficulties occur to me, however:
1) doing a random access on an STL list representation will be slow but it
will still work; on the other hand, using an algorithm suitable for a
matrix that is (say) positive-definite on one that does not have that
property could give a seriously wrong answer. Perhaps the system should
just provide algorithms to check these sorts of properties and trust the
user to use them if the user is not sure of them.
2) It may be that given the efficiency constraints of numerical software,
any system as flexible as STL would be unbearably inefficient for any
real-life problem.
- Simon Lovatt
This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 03:20:05 EST