29 #define STABLE 1e-3 // the sparsest row/column may only have a pivot of size STABLE*maxEntry
33 #ifdef ENABLE_CONSISTENCY_CHECKS
93 if (base.SPxLP::upper(n) >=
infinity)
95 if (base.SPxLP::lower(n) <= -
infinity)
102 if (base.SPxLP::lower(n) <= -
infinity)
104 else if (base.SPxLP::lower(n) >= base.SPxLP::upper(n) - base.
epsilon())
172 for(i = 0; i < base.
nRows(); ++i)
179 for(i = 0; i < base.
nCols(); ++i)
190 while(k < pref.
size())
192 if (rowWeight[row[i]] < colWeight[col[j]])
194 pref[k++] = base.
rId(row[i++]);
196 if (i >= base.
nRows())
197 while (k < pref.
size())
198 pref[k++] = base.
cId(col[j++]);
202 pref[k++] = base.
cId(col[j++]);
204 if (j >= base.
nCols())
205 while (k < pref.
size())
206 pref[k++] = base.
rId(row[i++]);
209 assert(i == base.
nRows());
210 assert(j == base.
nCols());
250 for(i = 0; i < base.
dim(); ++i)
266 int dim = base.
dim();
269 for (; i >= 0 && i < pref.size(); i += stepi)
278 int idx = vec.
index(0);
291 int minRowEntries = base.
nRows();
294 for (j = vec.
size(); --j >= 0;)
297 int k = vec.
index(j);
302 minRowEntries = nRowEntries;
313 std::cout <<
"DWEIST01 r" << base.
number(pref[i]);
315 std::cout <<
"DWEIST02 c" << base.
number(pref[i]);
326 for (j = vec.
size(); --j >= 0;)
329 int k = vec.
index(j);
344 for (i += stepi; i >= 0 && i < pref.size(); i += stepi)
356 for (i += stepi; i >= 0 && i < pref.size(); i += stepi)
390 for (i = pvec.
dim() - 1; i >= 0; --i)
408 std::cout <<
"changed basis\n";
412 std::cout <<
"nothing changed\n";
433 for (i = 0; i < base.
nCols(); i++)
441 for (i = 0; i < base.
nRows(); i++)
459 if (base.
rep() * base.
type() > 0)
462 const Real bx = 1.0 / maxabs;
464 const Real c_fixed = 1e+5;
465 const Real r_fixed = 0;
466 const Real c_dbl_bounded = 1e+1;
467 const Real r_dbl_bounded = 0;
468 const Real c_bounded = 1e+1;
469 const Real r_bounded = 0;
470 const Real c_free = -1e+4;
471 const Real r_free = -1e+5;
473 for (i = base.
nCols() - 1; i >= 0; i--)
476 Real x = ax * obj[i];
477 Real u = bx * up [i];
478 Real l = bx * low[i];
482 if (
spxAbs(low[i] - up[i]) < eps)
486 colWeight[i] = c_dbl_bounded + l - u + n;
522 for (i = base.
nRows() - 1; i >= 0; i--)
526 if (
spxAbs(lhs[i] - rhs[i]) < eps)
532 Real u = bx * rhs[i];
533 Real l = bx * lhs[i];
560 assert(base.
rep() * base.
type() < 0);
563 const Real bx = 1e-2 / maxabs;
564 const Real nne = 1e-4 * bx;
565 const Real c_fixed = 1e+5;
566 const Real r_fixed = 1e+4;
567 const Real c_dbl_bounded = 1;
568 const Real r_dbl_bounded = 0;
569 const Real c_bounded = 0;
570 const Real r_bounded = 0;
571 const Real c_free = -1e+4;
572 const Real r_free = -1e+5;
574 for (i = base.
nCols() - 1; i >= 0; i--)
577 Real x = ax * obj[i];
578 Real u = bx * up [i];
579 Real l = bx * low[i];
583 if (
spxAbs(low[i] - up[i]) < eps)
589 colWeight[i] = c_dbl_bounded + x - u + n;
594 colWeight[i] = c_dbl_bounded - x + l + n;
616 for (i = base.
nRows() - 1; i >= 0; i--)
620 Real u = bx * len1 * rhs[i];
621 Real l = bx * len1 * lhs[i];
626 if (
spxAbs(lhs[i] - rhs[i]) < eps)
632 rowWeight[i] = r_dbl_bounded + x - u + n;
637 rowWeight[i] = r_dbl_bounded - x + l + n;
663 for(i = 0; i < base.
nCols(); i++)
664 std::cout <<
"C i= " << i
665 <<
" up= " <<
colUp[i]
668 for(i = 0; i < base.
nRows(); i++)
669 std::cout <<
"R i= " << i