[gecode-users] Dynamic creation of IntVarArgs

Max chaosangel at gmx.de
Tue Dec 2 14:04:26 CET 2008


Thank you very much. Its a good idea. The overhead of copying should be 
not that big.
But maybe i'm not that lazy and rewrite my code that it precomputes  the 
linear relation size.

Thanks.
Max


Guido Tack wrote:
> Max wrote:
>
>   
>> Yes, of course i can do this (and have to do this),
>> but my tree is an abstracted form that should not know about linear
>> constraints or not.
>> An resize function would be much easier.
>>     
>
> If you just want to get it done quickly, simply collect the vars in an  
> std::vector<IntVar>, and then after walking the tree copy the vector  
> to an IntVarArgs.  There's nothing wrong with keeping IntVars in data  
> structures other than the ones we provide, you just have to get them  
> in the right shape for passing them to our post functions.
>
> Cheers,
> 	Guido
>
>
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
>
>   





More information about the gecode-users mailing list