[gecode-users] IntVarArgs of unknown size...

Christian Schulte cschulte at kth.se
Mon May 21 22:20:48 CEST 2007


Dear Sébastien,

ArgArrays are just meant to pass arguments, nothing more, nothing less. They
are very bad as data structures to be stored inside other data structures,
they are just good when being created automatically: they allocate a huge
chunk of memory on the runtime stack to speed up argument passing (avoiding
malloc).

Otherwise they are useless, and they ought to be that.

The best thing you can do is use to some other array data structure for
storing your variables and then create a VarArgArray when needed from
scratch (and do not store it anywhere!).

Cheers
Christian

-----Original Message-----
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Sébastien Mouthuy
Sent: Monday, May 21, 2007 8:35 PM
To: users at gecode.org
Subject: [gecode-users] IntVarArgs of unknown size...


	Hello everybody,

I have a class with an IntVarArgs as instance variable, but its size is
unknown at creation of my class. How can I safely set the size of my
IntVarArgs in a function that is not my constructor. 

There is the allocate(int) function, but it is protected, and I am not sure
whether it is safe to use it.

Thanks. Cheers,

sebastien


_______________________________________________
Gecode users mailing list
users at gecode.org https://www.gecode.org/mailman/listinfo/gecode-users





More information about the gecode-users mailing list