34 #ifdef ENABLE_CONSISTENCY_CHECKS
94 if (base.SPxLP::upper(n) >=
infinity)
96 if (base.SPxLP::lower(n) <= -
infinity)
103 if (base.SPxLP::lower(n) <= -
infinity)
105 else if (base.SPxLP::lower(n) >= base.SPxLP::upper(n) - base.
epsilon())
173 for(i = 0; i < base.
nRows(); ++i)
180 for(i = 0; i < base.
nCols(); ++i)
191 while(k < pref.
size())
193 if (rowWeight[row[i]] < colWeight[col[j]])
195 pref[k++] = base.
rId(row[i++]);
197 if (i >= base.
nRows())
198 while (k < pref.
size())
199 pref[k++] = base.
cId(col[j++]);
203 pref[k++] = base.
cId(col[j++]);
205 if (j >= base.
nCols())
206 while (k < pref.
size())
207 pref[k++] = base.
rId(row[i++]);
210 assert(i == base.
nRows());
211 assert(j == base.
nCols());
266 int dim = base.
dim();
269 for (; i >= 0 && i < pref.size(); i += deltai)
276 if (bVec.
size() == 1)
278 int idx = bVec.
index(0);
290 int best = base.
nRows();
292 for (j = bVec.
size(); --j >= 0;)
295 int k = bVec.
index(j);
322 for (j = bVec.
size(); --j >= 0;)
325 int k = bVec.
index(j);
339 for (i += deltai; i >= 0 && i < pref.size(); i += deltai)
350 for (i += deltai; i >= 0 && i < pref.size(); i += deltai)
384 for (i = pvec.
dim() - 1; i >= 0; --i)
402 std::cout <<
"changed basis\n";
406 std::cout <<
"nothing changed\n";
418 const Vector& low = bse.SPxLP::lower();
419 const Vector& up = bse.SPxLP::upper();
427 for (i = 0; i < bse.
nCols(); i++)
429 if ((up[i] <
infinity) && (fabs(up[i]) > maxabs))
430 maxabs = fabs(up[i]);
432 if ((low[i] > -
infinity) && (fabs(low[i]) > maxabs))
433 maxabs = fabs(low[i]);
435 for (i = 0; i < bse.
nRows(); i++)
437 if ((rhs[i] <
infinity) && (fabs(rhs[i]) > maxabs))
438 maxabs = fabs(rhs[i]);
440 if ((lhs[i] > -
infinity) && (fabs(lhs[i]) > maxabs))
441 maxabs = fabs(lhs[i]);
453 if (bse.
rep() * bse.
type() > 0)
456 const Real bx = 1.0 / maxabs;
457 const Real nne = ax / lhs.
dim();
458 const Real c_fixed = 1e+5;
459 const Real r_fixed = 0;
460 const Real c_dbl_bounded = 1e+1;
461 const Real r_dbl_bounded = 0;
462 const Real c_bounded = 1e+1;
463 const Real r_bounded = 0;
464 const Real c_free = -1e+4;
465 const Real r_free = -1e+5;
467 for (i = bse.
nCols() - 1; i >= 0; i--)
470 Real x = ax * obj[i];
471 Real u = bx * up [i];
472 Real l = bx * low[i];
476 if (fabs(low[i] - up[i]) < base.
epsilon())
480 colWeight[i] = c_dbl_bounded + l - u + n;
516 for (i = bse.
nRows() - 1; i >= 0; i--)
520 if (fabs(lhs[i] - rhs[i]) < base.
epsilon())
526 Real u = bx * rhs[i];
527 Real l = bx * lhs[i];
554 assert(bse.
rep() * bse.
type() < 0);
557 const Real bx = 1e-2 / maxabs;
558 const Real nne = 1e-4 * bx;
559 const Real c_fixed = 1e+5;
560 const Real r_fixed = 1e+4;
561 const Real c_dbl_bounded = 1;
562 const Real r_dbl_bounded = 0;
563 const Real c_bounded = 0;
564 const Real r_bounded = 0;
565 const Real c_free = -1e+4;
566 const Real r_free = -1e+5;
568 for (i = bse.
nCols() - 1; i >= 0; i--)
571 Real x = ax * obj[i];
572 Real u = bx * up [i];
573 Real l = bx * low[i];
577 if (fabs(low[i] - up[i]) < base.
epsilon())
583 colWeight[i] = c_dbl_bounded + x - u + n;
588 colWeight[i] = c_dbl_bounded - x + l + n;
610 for (i = bse.
nRows() - 1; i >= 0; i--)
614 Real u = bx * len1 * rhs[i];
615 Real l = bx * len1 * lhs[i];
620 if (fabs(lhs[i] - rhs[i]) < base.
epsilon())
626 rowWeight[i] = r_dbl_bounded + x - u + n;
631 rowWeight[i] = r_dbl_bounded - x + l + n;
657 for(i = 0; i < bse.
nCols(); i++)
659 <<
" up= " <<
colUp[i]
662 for(i = 0; i < bse.
nRows(); i++)