Topic
1 reply Latest Post - ‏2013-10-01T09:56:41Z by Philippe_Refalo
NicolasBarnier
NicolasBarnier
2 Posts
ACCEPTED ANSWER

Pinned topic IloIntVar from IloIntExpr

‏2013-09-27T09:53:45Z |

Hi,

 

I've just started to translate ILOG Solve 4.4 code to Concert technology and I

can't figure yet the right way to functionally define a variable from an expression

without specifying its bounds. It seems that my closest try would be to declare

a variable without providing its bounds and bind it with a constraint afterwards :

 

 IloIntVar v(env);

model.add (v == expr);

 

but the default bounds of the IloIntVar constructor are 0 and IloIntMax, so it

wouldn't be correct if the expression could be negative. Any hint on the subject ?

 

Best regards,

 

-- Nicolas Barnier

 

Updated on 2013-09-27T12:54:37Z at 2013-09-27T12:54:37Z by NicolasBarnier
  • Philippe_Refalo
    Philippe_Refalo
    48 Posts
    ACCEPTED ANSWER

    Re: IloIntVar from IloIntExpr

    ‏2013-10-01T09:56:41Z  in response to NicolasBarnier

    Hi Nicolas,

    There is no other way than adding an equation, but the bounds on the variable need to be -IloIntMax, IloIntMax, like this : IloIntVar v(env, -IloIntMax, IloIntMax).

    Regards

    Philippe

    Updated on 2013-10-01T09:56:58Z at 2013-10-01T09:56:58Z by Philippe_Refalo