Boost logo

Glas :

Re: [glas] MTL3 design ? [was MTL project site is up]

From: Karl Meerbergen (Karl.Meerbergen_at_[hidden])
Date: 2005-02-03 08:38:11


Russell Smiley wrote:

> >
> > The most important question is do we want vectors to be resized. I do
> > not think so.
> >
>
> I have to agree. If the goal of MTL3 is relatively high performance
> then vector/matrix resizing is probably not a good idea. On the other
> hand one of the powerful and useful aspects of Matlab, for example, is
> the dynamic matrix/vector resizing.
>
> Could we not have a template specialisation, or something, that might
> allow for vector resizing in the future, at least.
>
> For example, I'm imagining something like:
>
> Vector<float, nonresizeable> a;
> Vector<float, resizeable> b;
>
> I have found resizeable vectors and matrices useful in modified nodal
> analysis circuit simulation where you don't know before analysing the
> circuit graph how large the system of equations is. Once the circuit
> is analysed and you are about to simulate the system of equations is
> static and at that point it would be useful to have nonresizeable
> vectors for computational efficiency.
>
> Russell.
>

I suggested earlier to use AssignmentAdaptors that fix the assignment
policy for the vectors. This should make everybody happy. If other tests
should be happen at assignment, they can be performed by a user defined
AssignmentAdaptor.

This implies that the vector container has a mechanism that allows
AssignmentAdaptors to access the data and perform the assigment.

By default, I suggest, however, for the performance reasons given above
that assignment does not resize. If resize is require, the vector should
first be resized and then assigned (these two steps could be done by the
AssignmentAdaptor)

Karl