Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Access Violation in C++ Cplex program

    Posted 08/20/12 09:26 AM

    Originally posted by: SystemAdmin


    I am using C++ with cplex on visual studio to solve a optimization problem and I the program crashes when I use a larger data set. It runs perfectly fine with a small data set but with this it crashes and I am pretty sure it is in cplex.solve() member and not my own code.

    The exception the debugger is catching is "Unhandled exception at 0x77d915de in CuttingPlane.exe: 0xC0000005: Access violation writing location 0x7ddcd000." Then when I look at the call stack it never points to one of my source files but "mlock.c". it may have to do with some multi-threading but I really have no idea.

    I am not running out of memory and it dose work without a problem with several smaller data sets. There may be too much code to post minimal code. But unless my 'couts' are failing me, which I heard can happen. It happens when on this when I call cplex.solve().

    I guess I will attach one of the source files. The main algorithm is 'bool cuttingPlaneMethod(...).
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Access Violation in C++ Cplex program

    Posted 08/20/12 09:45 AM

    Originally posted by: SystemAdmin


    I figured it out. Divide by zero and the whole world ends.
    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Access Violation in C++ Cplex program

    Posted 08/20/12 09:55 AM

    Originally posted by: SystemAdmin


    Nevermind. That isn't what was wrong. Still not working.
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Access Violation in C++ Cplex program

    Posted 08/31/12 12:36 PM

    Originally posted by: SystemAdmin


    Are you sure you are not running out of memory?
    As far as I can tell you are definitely leaking memory in function cuttingPlaneMethod(): In each iteration you instantiate IloModel, IloCplex, ... but you never call the end() method for these objects. Neither at the end of the loops nor when you exit the loop via break or return.
    Does the problem persist if you add the appropriate calls to end()?
    #CPLEXOptimizers
    #DecisionOptimization