Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only
  • 1.  const

    Posted Wed April 13, 2011 10:00 AM

    Originally posted by: banun


    hi,

    How can I define a const ? (for example, x=2)?

    thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: const

    Posted Wed April 13, 2011 10:08 AM

    Originally posted by: SystemAdmin


    Please be a bit more specific. Which API are you using? In which context do you want to define a "const"?
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: const

    Posted Wed April 13, 2011 10:38 AM

    Originally posted by: banun


    Hi, sorry -

    c++ API.

    is the only way to define x=2, is yo do the following :

    cplex.AddVariable("x", out x);
    cplex.SetBounds(x, 2, 2);

    ?
    thanks
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: const

    Posted Wed April 13, 2011 12:43 PM

    Originally posted by: SystemAdmin


    Yes. Of course, you could also add the constraint x = 2 and then let the presolver figure out that the variable can be removed from the problem.
    #CPLEXOptimizers
    #DecisionOptimization