Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Error: using empty handle

    Posted Wed August 15, 2012 09:55 AM

    Originally posted by: Ximenes


    Hi, everyone, when I ran my program compiled in Visual Studio 2010 with C++ calling Cplex, I was told an error that "using empty handle". I had no idea about it. I want to the most frequent reason that cause the error. Can you help me?
    Thank you.
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Error: using empty handle

    Posted Thu August 16, 2012 05:29 PM

    Originally posted by: SystemAdmin


    You are probably passing an empty handle (basically, a null pointer) as an argument in a function call. Look for a function argument that is uninitialized. On a different thread, this bug arose because someone passed an pointer to an array of model objects (perhaps IloNumVarArray) that was smaller than it needed to be (resulting in a bounds violation when CPLEX accessed the array).

    Paul

    Mathematicians are like Frenchmen: whenever you say something to them, they translate it into their own language, and at once it is something entirely different. (Goethe)
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Error: using empty handle

    Posted Sun August 26, 2012 09:47 AM

    Originally posted by: SystemAdmin


    One frequent issue is instantiating a subclass of IloExtractable without an env argument, i.e.,
    IloNumVar v;
    v.setLB(0);
    

    instead of
    IloNumVar v(env);
    v.setLB(0);
    

    The easiest thing to narrow down your problem is to use a debugger and figure out where exactly that problem occurs. This will most probably also tell you what instance it is that is not initialized properly.
    #CPLEXOptimizers
    #DecisionOptimization