Decision Optimization

Decision Optimization

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


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
  • 1.  Floating Point + Segmentation Violation Issue in the CPLEX 12.4 API?!

    Posted 04/13/12 01:13 AM

    Originally posted by: BerkUstun


    I've been running into a very weird bug with a MEX file that I wrote to solve Stochastic Programming problems in MATLAB using the C Callable library. I've isolated the issue to the following LP:

    min c*x1 -0.15*x2

    s.t. x1 + x2 > d
    x1 > -10

    0 < x1 < Inf
    0 < x2 < Inf

    Where

    c = -1.403480672873446
    d = -7.382541092522398

    Issue #1:

    When I solve this LP using either the Callable Library or the MATLAB API, I obtain the following value for the slack variables:

    http://1.30348067287345 0.10000000000000

    However, I am almost certain that the second slack variable should be 0.

    Issue #2:

    When I solve this LP using the Callable Library, I occasionally run into segmentation violations (every 1 out of 20 tries).

    In such cases, when I try to obtain the solution using

    
    status = CPXsolution (env, lp, &lpstat, &objval, NULL, slacks, NULL, NULL);
    


    the slacks[1] (i.e. the second element of slacks) does not refer to a double precision floating number, but some other kind of data type.

    Issue #3:

    Related to Issue #2. Setting up and solving this LP in MATLAB 2012a does not solve the problem. Actually, I end up receiving a segmentation violation once every 20/30 times I do this. In such cases, MATLAB crashes.
    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Floating Point + Segmentation Violation Issue in the CPLEX 12.4 API?!

    Posted 04/13/12 02:13 AM

    Originally posted by: BerkUstun


    Some other comments and questions:

    • This issue still arises in CPLEX 12.3

    • If there is no fix for this problem, then is there a way to "flag" such an event as the code is running? Note that the obj value and lpstat parameters are actually OK for this problem (i.e. I get the correct objective value and lpstat = 1)

    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Floating Point + Segmentation Violation Issue in the CPLEX 12.4 API?!

    Posted 04/13/12 05:36 AM

    Originally posted by: SystemAdmin


    Could you attach a SAV file of the offending LP (CPXwriteprob(env, lp, "bug.sav", NULL)). That would make it easier to analyze the issue.
    Also, it looks to me as if your problem is unbounded since (x1=Inf, x2=0) is a feasible solution with objective function value -Inf. Is that expected or did I miss anything?
    Was the 'status' returned by CPXsolution() 0 when you observe the non-floating point value for the second slack value?
    #CPLEXOptimizers
    #DecisionOptimization


  • 4.  Re: Floating Point + Segmentation Violation Issue in the CPLEX 12.4 API?!

    Posted 04/13/12 03:02 PM

    Originally posted by: BerkUstun


    Sorry there was a typo in the original formulation. The issue still stands, but the correct formulation should be:

    min c*x1 -0.15*x2

    s.t. -x1 - x2 > d
    -x1 > -10

    0 < x1 < Inf
    0 < x2 < Inf

    Where

    c = -1.403480672873446
    d = -7.382541092522398

    I'm attaching a SAV file with the issue.
    #CPLEXOptimizers
    #DecisionOptimization


  • 5.  Re: Floating Point + Segmentation Violation Issue in the CPLEX 12.4 API?!

    Posted 04/13/12 07:09 PM

    Originally posted by: BerkUstun


    Update: There is no issue. Sorry for the trouble. I found a bug on the MATLAB side of things.
    #CPLEXOptimizers
    #DecisionOptimization