Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Max and Min constraints in Java application!

    Posted 07/14/09 04:28 PM

    Originally posted by: SystemAdmin


    [julieyu said:]

    Dear All,

    I am a new user of Ilog Cplex. The user manual of Cplex9.0 just tells us to use 'IloMax' and 'IloMin' in C++ to get the logical maximum Max(X,Y) and minimum Min(X,Y) .

    I use this 'IloMin' in Java just like C++ in the user manual. But there is error: 'The method IloMax(double) is undefined'.

    Anyone can tell me how to get the logical maximum or minimum in Java?

    Thank you !

    Julie
    #DecisionOptimization
    #MathematicalProgramming-General


  • 2.  Re: Max and Min constraints in Java application!

    Posted 07/14/09 08:13 PM

    Originally posted by: SystemAdmin


    [prubin said:]

    It depends on what you are trying to do.  If you are just working with ordinary double precision Java variables, Math.max is probably the right way to go.  If your arguments include instances of IloNumExpr or IloIntExpr, then something like this should work:

    IloCplex cp = new IloCplex();  // this will eventually be your model
    // ...
    IloNumExpr expr;
    double z;
    // ... do something with expr and z ...
    IloNumExpr q = cp.max(expr, z);

    /Paul
    #DecisionOptimization
    #MathematicalProgramming-General


  • 3.  Re: Max and Min constraints in Java application!

    Posted 07/14/09 08:37 PM

    Originally posted by: SystemAdmin


    [julieyu said:]

    Thank you soooooo  much~
    #DecisionOptimization
    #MathematicalProgramming-General