[gecode-users] problem using IntVarArgs

Kish Shen kisshen at cisco.com
Thu Jun 11 18:35:00 CEST 2009


Christian Schulte wrote:
> Hi Kish,
> 
> Let me venture a guess: you did not initialize the arguments of IntVarArgs.
> When you create an IntVarArgs object, its fields are uninitialized. So what
> you might want do is
> 
> IntVarArgs x(n);
> for (int i=0; i<n; i++)
>    x[i].init(home, ..., ...);
> 
> Where ... are smallest and largest possible value.
> 
> Is that it?
> 
> Cheers
> Christian
> 

Hi Christian,

Thanks. You are correct, I did not initialise the variables, because in 
the normal case they will be set to other IntVar that is already part of 
the space.

In this case, I assume I should just use x[i].init() to set x[i]'s min 
and max to the same integer value,
x[i].init(home, v, v)

and then I don't need to post the dom or rel constraint at all, right?

Cheers,

Kish

-- 
This e-mail may contain confidential and privileged material for the
sole use of the intended recipient. Any review, use, distribution or
disclosure by others is strictly prohibited. If you are not the intended
recipient (or authorized to receive for the recipient), please contact
the sender by reply e-mail and delete all copies of this message.
Cisco Systems Limited (Company Number: 02558939), is registered in
England and Wales with its registered office at 1 Callaghan Square,
Cardiff, South Glamorgan CF10 5BT.




More information about the gecode-users mailing list