Decision Optimization

Decision Optimization

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

 View Only
  • 1.  [Wish list] More informative error message

    Posted Tue May 26, 2015 05:51 PM

    I'd like to contribute this to the CPLEX user request list (wherever it may be hiding). I just spent a couple of hours or so tracking down a bug that manifested itself with CPLEX (Java API) throwing a NullPointerException when I called IloCplex.refineConflict() (but not always, just when the stars were correctly aligned). The arguments to refineConflict were IloNumVarBound[] and double[] vectors. It turned out that the cause was that one of the bounds corresponded to a variable that had not been extracted (by virtue of not appearing in any constraint or the objective function).

    The fix was easy (use IloCplex.add() to add it to the model), but it would have been much easier to diagnose if CPLEX had thrown an IloException (preferably with a message telling me I was being naughty by including a bound for an unextracted variable) rather than a null pointer exception (whose message was itself null). The null pointer seemed to be occurring when CPLEX went looking for an index for the variable associated with the bound, for whatever that's worth.

    So my request is that, in some future version, CPLEX trap bounds of unextracted variables and throw a more informative exception (or perhaps just skip over them, since they are unlikely to be involved in a conflict if the variables never appear in the model).

    Paul

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: [Wish list] More informative error message

    Posted Wed May 27, 2015 01:56 AM

    Paul, I consider this a bug. The exception that is thrown should really be something that indicates the object was not extracted. I have filed a bug report.

    Thank you for your detailed report!


    #CPLEXOptimizers
    #DecisionOptimization