Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

How can I use the function setBounds with the struct map

  • 1.  How can I use the function setBounds with the struct map

    Posted 01/02/19 02:08 PM

    Originally posted by: lbr33


    Hi,

     

    How can I use the cplex function setBounds when I have the struct:  map<int,IloRangeArray>  constraints_r3 ?

     

    I tried something like:

    constraints_r3.find(p)->second.setBounds(-IloInfinity, newValue);

     

    but it didn't work.

     

    Thank you.


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: How can I use the function setBounds with the struct map

    Posted 01/03/19 10:09 AM

    Originally posted by: Lessi


     

    Normally, it works, You create a constraint and then add the constraint to your map/vector. Just make sure your constraints exist in the map while querying setBounds.

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: How can I use the function setBounds with the struct map

    Posted 01/04/19 03:05 AM

    What does "not work" mean exactly? Note that your code will fail at runtime if p is not contained in constraints_r3. Can you assert that find() returns something else than end()?


    #CPLEXOptimizers
    #DecisionOptimization