Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

IloCplex::Exception problem

  • 1.  IloCplex::Exception problem

    Posted Tue February 02, 2016 04:18 AM

    Originally posted by: Nawel


    Hello,

    I'm trying to solve a MIP problem using Cplex 12.6.  I get an IloCplex Exception in a particular situation. I tried to reproduce the issue with the following simple code (attached in this post).

    The excustion aborted with this message: 

    Error :CPLEX Error  9023:  Unknown error code.

    terminate called after throwing an instance of 'IloCplex::Exception' 

    Aborted (core dumped)

    Can you help me find out the source of the problem ?

     


     

     

     

     


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: IloCplex::Exception problem

    Posted Tue February 02, 2016 04:50 AM

    To find the source of your problem you could run your program through a debugger and have it stop once an exception is thrown. That should point you to the offending line of code.

    In general, you should wrap your program into a try/catch block like this:

    try {
        // Your code here
        ...
    }
    catch (IloException &e) {
        std::cerr << e << std::endl;
        throw e;
    }
    

    This will print out the exception message before the program dies. In most cases the exception message gives a very good hint about what is going wrong.
     


    #CPLEXOptimizers
    #DecisionOptimization