[Ltilib-devel] On matrix/vector resize
Status: Beta
Brought to you by:
alvarado
From: Pablo A. <pal...@ie...> - 2005-11-23 14:58:07
|
Hello all, Well, I'm guilty of all charges. While implementing the matrices and the=20 vectors an their relationships obviously I leave some inconsistencies betwe= en=20 documentation and implementation lying around... The way it was, (before Peter changed it) was the best compromise I found, = but=20 I forgot to change the docu (terrible sinn, but I'm not the only one :-P ).= =20 The resizing of a matrix or vector, which do not own its data, changed the= =20 memory allocantion and ownership if and only if the new size was different= =20 than the previous one. A resize had absolutelly no effect if the there was= =20 no resize in the terms that the new desired dimensions were already there. = =20 So, to restore ownership some tricks had to be done: like a detach, or a=20 resize but changing the size. I have in mind that an explicit method to=20 restore ownership was also done, but, I don't remember if it was for the=20 LTI-Lib 1 or 2.=20 Other methods would cause that most of the library wouldn't work, because t= oo=20 much time would be required making unnecessary resizes; some"strict" on-pla= ce=20 methods would change the memory used, etc. (I think this should be a major= =20 topic in the LTI-Lib-2: all on-place methods have to be strict on-place (at= =20 least if the size of the result is correct, avoiding even the memory change= s=20 of the result container class! However, I know this is too much work and n= o=20 one has the time.) I believe with a consistent documentation the problem is solved, leaving it= as=20 it was before. Regards, Pablo =2D-=20 Dr. Pablo Alvarado E-Mail: pal...@ie... Escuela de Electr=F3nica Tel.: (+506) 550 2106 Instituto Tecnol=F3gico de Costa Rica Apartado Postal 159-7050 Cartago Costa Rica |