toon-members
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Toon-members] resize in dynamic vectors/matrices ?


From: Georg Klein
Subject: Re: [Toon-members] resize in dynamic vectors/matrices ?
Date: Wed, 15 Apr 2009 16:05:01 +0100 (BST)

Does anyone actually use the dynamic vectors/matrices in gvars3? If not they could be cut out and remove the need for some ugly workarounds (like that robust_assignment stuff).

I for one could happily live without gvar3<Vector<-1> > , and also without gvar3<Matrix<?,?> > for that matter.

On Wed, 15 Apr 2009, Gerhard Reitmayr wrote:

Hi Tom and Ed (and everyone else),

while trying to port gvars3 to TooN2, I found that resize() and default constructors on dynamic vectors and matrices are missing. Both are necessary for the current mechanics in gvars3 which creates maps between names and instances of these types and uses default constructors in various places. resize is also necessary to assign to the instance in the map, because otherwise assignment will often fail.

I added resize to both in the attached allocator.hh file and it works nicely with gvars3.

Discussing this with Ed, we are not sure, if we want a resize in the dynamic ones? Ed mentioned the idea of another type which is resizable. One issue with that is, that if resizable would not be default, the interface to gvars3 (which would have to use the resizable ones) might be more error prone.

What does everyone thing would be best solution ?
- add resize as I did
- add a resizable vector/matrix type ?
- larger hack to gvars3 to make it work with pointers to instances and swivel them around ?

cheers,
Gerhard
--
Gerhard Reitmayr
MIL, Engineering Department, Cambridge University
http://mi.eng.cam.ac.uk/~gr281/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]