Decision Optimization

 View Only
Expand all | Collapse all

OPL keyword dexpr - equivalent Class in C++ API???

  • 1.  OPL keyword dexpr - equivalent Class in C++ API???

    Posted Thu August 15, 2013 10:24 AM

    Originally posted by: carope


    Hey, 

    is there any equivalent Class such as IloNumVar in the C++ API for the OPL keyword dexpr? How do I have to use it? 

    I tried IloExpr for my decision expressions, but it doesn't work, because cplex uses them as constraints, which leads to infeasibility. My native model in OPL works fine with the dexpr. But is infeasible if i define the expressions as constraints as well. Thats why I need an equivalent Class or at least a hint how to define expressions in my model which won't be used as constraints.  

    Thanks for your help


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: OPL keyword dexpr - equivalent Class in C++ API???

    Posted Tue August 20, 2013 07:34 PM

    Originally posted by: EdKlotz


    I'm not clear why using IloExpr would result in infeasibility.   Make sure that you didn't inadvertently mix up your use of '=' and '=='.   But, if you want more precise classes, try IloNumExpr or IloRange.   If you still haven't resolved this, try posting a simple example that illustrates you use of dexpr in OPL correctly, and the corresponding C++ code that doesn't work for you.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: OPL keyword dexpr - equivalent Class in C++ API???

    Posted Thu August 22, 2013 04:31 AM

    Instances of IloExpr are not used as constraints by default. You must be doing something wrong. Like Ed said, maybe posting a small example of how your are using IloExpr may help.


    #CPLEXOptimizers
    #DecisionOptimization