Date: 2001-10-02 15:33:34
--- In boost_at_y..., Thomas Lien <tgunlien_at_y...> wrote:
> > What is the difference between your grid and a
> > matrix?
> I chose the name grid because in my mind, Matrix
> implies a NUMERICAL grid, which my current
> implementation would not have to be restricted to.
In my understanding "Matrix" is not restricted
to numerics only.
Anyway, I agree that there is need for
moredimensional arrays (or whatever name you choose).
I, however, have no need for arrays with boundaries
fixed at compile time (see below).
In addition observe that there has already been
quite a lot of discussion on matrices in boost,
> > Why do you fix the dimensions ROW/COL at compile
> > time?
> This decision was made to prevent improper operations
> at compile time such assignment of a grid with
> different dimensions to another (clearly a bad thing).
Perhaps the same that Wirth (the inventor of Pascal) thought ...
> > Clearly you will be as type safe as Pascal arrays,
> > the experience from Pascal, however, tells
> > that this type safety is too restrictive for many
> > purposes.
> I guess I missed out on the experiences of Pascal. :)
> Could you give me an example of how this would be too restrictive?
You would exclude every application
where the array size is not known at compile time,
in particular you would exclude most numerical calculations.
The usual workaround in Pascal is that you specify
a mximum size. For lower sizes, you will waste memory,
for larger size you have to recompile your code.
In addition, you are no longer really type safe
because you can now assign two grids with different
"run time size" to each other because they have
the same compile time (maximum) size ...
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk