Decision Optimization

 View Only
Expand all | Collapse all

IloIntVar from IloIntExpr

Archive User

Archive UserFri September 27, 2013 05:54 AM

  • 1.  IloIntVar from IloIntExpr

    Posted Fri September 27, 2013 05:54 AM

    Originally posted by: NicolasBarnier


    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

     


    #CPOptimizer
    #DecisionOptimization


  • 2.  Re: IloIntVar from IloIntExpr

    Posted Tue October 01, 2013 05:57 AM

    Originally posted by: Philippe_Refalo


    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


    #CPOptimizer
    #DecisionOptimization