[gecode-users] vector or PrimArgArray ?

Guido Tack tack at gecode.org
Fri Jan 22 22:28:04 CET 2010


Vincent Barichard wrote:
> I  made a subclass of Brancher in order to implement my own behaviour (class QViewBrancher : public Brancher).
> I copied the code of ViewBrancher and modified it to make it match with my needs. In this new class, I
> added another variable member which is an array of integers.
> So I added a new member "const std::vector<int> q;" in QViewBrancher. But now I wonder if I had to use a
> PrimArgArray<int> or IntArgs instead of vector ,
> What do you think about it ? Vector or PrimArgArray ? (The size of the vector is equal to the size of the ViewArray x)

Neither, you should use something that is space-allocated (i.e., a simple int* and then use home.alloc<int>(x.size()) in the constructors etc), or a SharedArray<int> if the array can be shared among all clones of the brancher.

Cheers,
	Guido




More information about the users mailing list