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