[gecode-users] posting LinExpr
'Stanimir Dragiev'
stanio at cs.tu-berlin.de
Fri Feb 15 12:50:36 CET 2008
Hello Christian,
* Christian Schulte <cschulte at kth.se> [2008-02-15 01:13]:
> not so shy ;-) That was a bug, apparently there were no tests for posting
Well, after couple of hours in front of an old CRT I haven't
considered my perceptions reliable.
:o)
> not so shy ;-) That was a bug, apparently there were no tests for posting
> linear expressions but only linear relations! I'll fixed it in the trunk and
> it should be soon in 2.0.2. For the time being, just replace sign*-c with
> sign*c and recompile...
I prefer messing around with my code, than with gecode's, so
I use a workaround for now (the constants are 0 and this
avoids the impact of sign*-c):
=-=-=-=-=-=Begin
IntVar
get_variable_difference(Solver *space, IntVar& var1, int var2){
- return abs(space, post(space, var1 - var2, ICL_DOM), ICL_DOM);
+ IntVar tmp(space, var2, var2);
+ return abs(space, post(space, var1 - tmp, ICL_DOM), ICL_DOM);
}
=-=-=-=-=-=End
Could using a temp IntVar (and as consequence one Term more
inside the LinExpr, I guess) be a considerable performance
issue?
cheers
stanio_
More information about the gecode-users
mailing list