← Back to team overview

yade-dev team mailing list archive

Re: [yade/trunk] 59b663: Give the newly created body an id, which is the si...

 

2012/5/21 Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>:
>
> Sure of that?
> The size of the container will increase forever, no?
>
> In addition, insert(b,id=size) triggers body.resize(id+1), which is
> horrible in terms of cpu time (create a new vector, copy the old vector
> into it, erase the old one).
> For inserting 100 new bodies in 100k bodies, you will move and delete
> ~10^7 shared pointers.
>
> lowestFree was a smart trick IMO.
>
> Bruno

I think, it is correct. This lowestFree variable can have only an
advantage, when you delete the last created body. It is a specific
case and I do not think it happens often. It causes also LP:1001194,
which is critical.

>From my point of view it is the best solution without complicating the code.

Anton


Follow ups

References