Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
3.1.1
-
None
-
None
Description
When I run this code sometimes I get NoFeasibleSolutionException, and sometimes the result is 0.37522987682323883.
Octave gives result 0.70679 and a point = {1.59032, 1.00000, 0.70679, 0.40399, 1.04004, 0.67396, 0.37868, 0.22823, 0.98909, 0.68793, 0.17021,
0.09192, 0.67501, 0.44573, 0.07829, 0.00000, 0.81316, 0.63520, 0.55634
0.40399, 0.48504, 0.45944, 0.22823, 0.22823, 0.34873, 0.32313, 0.09192,
0.09192, 0.25681, 0.23122, 0.00000, 0.00000, 1.59032
double[][] coefficients = new double[97][];
double[] value = new double[97];
Relationship[] relationship = new Relationship[97];
int i = 0;
double[] m0 =
;
coefficients[i] = m0;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m1 =
coefficients[i] = m1;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m2 = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1}
;
coefficients[i] = m2;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m3 =
;
coefficients[i] = m3;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m4 =
;
coefficients[i] = m4;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m5 =
;
coefficients[i] = m5;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m6 =
;
coefficients[i] = m6;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m7 =
;
coefficients[i] = m7;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m8 =
;
coefficients[i] = m8;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m9 =
;
coefficients[i] = m9;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m10 =
;
coefficients[i] = m10;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m11 =
;
coefficients[i] = m11;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m12 =
;
coefficients[i] = m12;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m13 =
;
coefficients[i] = m13;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m14 =
;
coefficients[i] = m14;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m15 =
;
coefficients[i] = m15;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m16 =
;
coefficients[i] = m16;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m17 =
;
coefficients[i] = m17;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m18 =
;
coefficients[i] = m18;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m19 =
;
coefficients[i] = m19;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m20 =
;
coefficients[i] = m20;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m21 =
;
coefficients[i] = m21;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m22 =
;
coefficients[i] = m22;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m23 =
;
coefficients[i] = m23;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m24 =
;
coefficients[i] = m24;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m25 =
;
coefficients[i] = m25;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m26 =
;
coefficients[i] = m26;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m27 =
;
coefficients[i] = m27;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m28 =
;
coefficients[i] = m28;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m29 =
;
coefficients[i] = m29;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m30 =
;
coefficients[i] = m30;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m31 =
;
coefficients[i] = m31;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m32 =
;
coefficients[i] = m32;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m33 =
;
coefficients[i] = m33;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m34 =
;
coefficients[i] = m34;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m35 =
;
coefficients[i] = m35;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m36 =
;
coefficients[i] = m36;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m37 =
;
coefficients[i] = m37;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m38 =
;
coefficients[i] = m38;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m39 =
;
coefficients[i] = m39;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m40 =
;
coefficients[i] = m40;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m41 =
;
coefficients[i] = m41;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m42 =
;
coefficients[i] = m42;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m43 =
;
coefficients[i] = m43;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m44 =
;
coefficients[i] = m44;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m45 =
;
coefficients[i] = m45;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m46 =
;
coefficients[i] = m46;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m47 =
;
coefficients[i] = m47;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m48 =
;
coefficients[i] = m48;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m49 =
;
coefficients[i] = m49;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m50 =
;
coefficients[i] = m50;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m51 =
;
coefficients[i] = m51;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m52 =
;
coefficients[i] = m52;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m53 =
;
coefficients[i] = m53;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m54 =
;
coefficients[i] = m54;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m55 =
;
coefficients[i] = m55;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m56 =
;
coefficients[i] = m56;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m57 =
;
coefficients[i] = m57;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m58 =
;
coefficients[i] = m58;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m59 =
;
coefficients[i] = m59;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m60 =
;
coefficients[i] = m60;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m61 =
;
coefficients[i] = m61;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m62 =
;
coefficients[i] = m62;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m63 =
;
coefficients[i] = m63;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m64 =
;
coefficients[i] = m64;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m65 =
;
coefficients[i] = m65;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m66 =
;
coefficients[i] = m66;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m67 =
;
coefficients[i] = m67;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m68 =
;
coefficients[i] = m68;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m69 =
;
coefficients[i] = m69;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m70 =
;
coefficients[i] = m70;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m71 =
;
coefficients[i] = m71;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m72 =
;
coefficients[i] = m72;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m73 =
;
coefficients[i] = m73;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m74 =
;
coefficients[i] = m74;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m75 =
;
coefficients[i] = m75;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m76 =
;
coefficients[i] = m76;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m77 =
;
coefficients[i] = m77;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m78 =
;
coefficients[i] = m78;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m79 =
;
coefficients[i] = m79;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m80 =
;
coefficients[i] = m80;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m81 =
;
coefficients[i] = m81;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m82 =
;
coefficients[i] = m82;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m83 =
;
coefficients[i] = m83;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m84 =
;
coefficients[i] = m84;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m85 =
;
coefficients[i] = m85;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m86 =
;
coefficients[i] = m86;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m87 =
;
coefficients[i] = m87;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m88 =
;
coefficients[i] = m88;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m89 =
;
coefficients[i] = m89;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m90 =
;
coefficients[i] = m90;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m91 =
;
coefficients[i] = m91;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m92 =
;
coefficients[i] = m92;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m93 =
coefficients[i] = m93;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m94 = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0}
;
coefficients[i] = m94;
relationship[i] = Relationship.GEQ;
value[i] = 0.0;
i++;
double[] m95 =
;
coefficients[i] = m95;
relationship[i] = Relationship.LEQ;
value[i] = 0.0;
i++;
double[] m96 =
;
coefficients[i] = m96;
relationship[i] = Relationship.EQ;
value[i] = 1.0;
ArrayList<LinearConstraint> constraints = new ArrayList<>(97);
for (int j = 0; j < 97; j++)
double[] fooc = new double[33];
fooc[3] = 1;
LinearObjectiveFunction foo = new LinearObjectiveFunction(fooc, 0);
SimplexSolver solver = new SimplexSolver();
LinearConstraintSet se = new LinearConstraintSet(constraints);
PointValuePair res = solver.optimize(MaxIter.unlimited(), foo, se, new NonNegativeConstraint(true));