Scippy

SoPlex

Sequential object-oriented simPlex

leave.cpp
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the class library */
4 /* SoPlex --- the Sequential object-oriented simPlex. */
5 /* */
6 /* Copyright (C) 1996-2016 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SoPlex is distributed under the terms of the ZIB Academic Licence. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SoPlex; see the file COPYING. If not email to soplex@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /* Updating the Basis for Leaving Variables
17  */
18 #include <assert.h>
19 #include <stdio.h>
20 
21 #include "spxdefines.h"
22 #include "spxpricer.h"
23 #include "spxsolver.h"
24 #include "spxratiotester.h"
25 #include "spxout.h"
26 #include "exceptions.h"
27 
28 namespace soplex
29 {
30 static const Real reject_leave_tol = 1e-10; // = LOWSTAB as defined in spxfastrt.cpp
31 
32 /*
33  Vector |fTest| gives the feasibility test of all basic variables. For its
34  computation |fVec|, |theUBbound| and |theLBbound| must be setup correctly.
35  Values of |fTest| $<0$ represent infeasible variables, which are eligible
36  for leaving the basis in the simplex loop.
37  */
39 {
40 
41  assert(type() == LEAVE);
42 
43  Real theeps = entertol();
44  m_pricingViolUpToDate = true;
46  m_pricingViol = 0;
47  m_pricingViolCo = 0;
49  int ninfeasibilities = 0;
50  int sparsitythreshold = (int) (sparsePricingFactor * dim());
51 
52  for( int i = 0; i < dim(); ++i )
53  {
54  theCoTest[i] = ((*theFvec)[i] > theUBbound[i])
55  ? theUBbound[i] - (*theFvec)[i]
56  : (*theFvec)[i] - theLBbound[i];
57 
58  if( remainingRoundsLeave == 0 )
59  {
60  if( theCoTest[i] < -theeps )
61  {
65  ++ninfeasibilities;
66  }
67  else
69  if( ninfeasibilities > sparsitythreshold )
70  {
71  MSG_INFO2( (*spxout), (*spxout) << " --- using dense pricing"
72  << std::endl; )
74  sparsePricingLeave = false;
75  ninfeasibilities = 0;
76  }
77  }
78  else if( theCoTest[i] < -theeps )
80  }
81 
82  if( ninfeasibilities == 0 && !sparsePricingLeave )
83  {
85  }
86  else if( ninfeasibilities <= sparsitythreshold && !sparsePricingLeave )
87  {
88  MSG_INFO2( (*spxout),
89  std::streamsize prec = spxout->precision();
90  if( hyperPricingLeave )
91  (*spxout) << " --- using hypersparse pricing, ";
92  else
93  (*spxout) << " --- using sparse pricing, ";
94  (*spxout) << "sparsity: "
95  << std::setw(6) << std::fixed << std::setprecision(4)
96  << (Real) ninfeasibilities/dim()
97  << std::scientific << std::setprecision(int(prec))
98  << std::endl;
99  )
100  sparsePricingLeave = true;
101  }
102 }
103 
105 {
106  const IdxSet& idx = theFvec->idx();
107  Vector& ftest = theCoTest; // |== fTest()|
108  assert(&ftest == &fTest());
109 
110  assert(type() == LEAVE);
111 
112  updateViols.clear();
113  Real theeps = entertol();
114  for (int j = idx.size() - 1; j >= 0; --j)
115  {
116  int i = idx.index(j);
117 
118  if( m_pricingViolUpToDate && ftest[i] < -theeps )
119  m_pricingViol += ftest[i];
120 
121  ftest[i] = ((*theFvec)[i] > theUBbound[i])
122  ? theUBbound[i] - (*theFvec)[i]
123  : (*theFvec)[i] - theLBbound[i];
124 
125 
126  if( sparsePricingLeave && ftest[i] < -theeps )
127  {
128  assert(remainingRoundsLeave == 0);
130  m_pricingViol -= ftest[i];
132  {
133  // this can cause problems - we cannot keep on adding indeces to infeasibilities,
134  // because they are not deleted in hyper mode...
135 // if( !hyperPricingLeave )
138  }
139  if( hyperPricingLeave )
140  updateViols.addIdx(i);
141  }
142  else if( m_pricingViolUpToDate && ftest[i] < -theeps )
143  m_pricingViol -= ftest[i];
144 
145  }
146  // if boundflips were performed, we need to update these indices as well
147  if( boundflips > 0 )
148  {
149  Real eps = epsilon();
150  for( int j = 0; j < solveVector3->size(); ++j )
151  {
152  if( spxAbs(solveVector3->value(j)) > eps )
153  {
154  int i = solveVector3->index(j);
155 
156  if( m_pricingViolUpToDate && ftest[i] < -theeps )
157  m_pricingViol += ftest[i];
158 
159  ftest[i] = ((*theFvec)[i] > theUBbound[i]) ? theUBbound[i] - (*theFvec)[i] : (*theFvec)[i] - theLBbound[i];
160 
161  if( sparsePricingLeave && ftest[i] < -theeps )
162  {
163  assert(remainingRoundsLeave == 0);
165  m_pricingViol -= ftest[i];
166  if( !isInfeasible[i] )
167  {
169  isInfeasible[i] = true;
170  }
171  }
172  else if( m_pricingViolUpToDate && ftest[i] < -theeps )
173  m_pricingViol -= ftest[i];
174  }
175  }
176  }
177 }
178 
179 
180 /* compute statistics on leaving variable
181  Compute a set of statistical values on the variable selected for leaving the
182  basis.
183  */
185  int leaveIdx,
186  SPxBasis::Desc::Status& leaveStat,
187  SPxId& leaveId,
188  Real& leaveMax,
189  Real& leavebound,
190  int& leaveNum,
191  Real& objChange)
192 {
193  SPxBasis::Desc& ds = desc();
194  leaveId = baseId(leaveIdx);
195 
196  if (leaveId.isSPxRowId())
197  {
198  leaveNum = number(SPxRowId(leaveId));
199  leaveStat = ds.rowStatus(leaveNum);
200 
201  assert(isBasic(leaveStat));
202  switch (leaveStat)
203  {
205  assert( rep() == ROW );
206  ds.rowStatus(leaveNum) = dualRowStatus(leaveNum);
207  leavebound = 0;
208  leaveMax = -infinity;
209  break;
211  assert( rep() == ROW );
212  ds.rowStatus(leaveNum) = dualRowStatus(leaveNum);
213  leavebound = 0;
214  leaveMax = infinity;
215  break;
217  assert( rep() == ROW );
218  throw SPxInternalCodeException("XLEAVE01 This should never happen.");
220  assert( rep() == COLUMN );
221  ds.rowStatus(leaveNum) = SPxBasis::Desc::P_FIXED;
222  assert(lhs(leaveNum) == rhs(leaveNum));
223  leavebound = -rhs(leaveNum);
224  if ((*theFvec)[leaveIdx] < theLBbound[leaveIdx])
225  leaveMax = infinity;
226  else
227  leaveMax = -infinity;
228  break;
230  assert( rep() == COLUMN );
231  ds.rowStatus(leaveNum) = SPxBasis::Desc::P_ON_UPPER;
232  leavebound = -rhs(leaveNum); // slack !!
233  leaveMax = infinity;
234  objChange += theLRbound[leaveNum] * rhs(leaveNum);
235  break;
237  assert( rep() == COLUMN );
238  ds.rowStatus(leaveNum) = SPxBasis::Desc::P_ON_LOWER;
239  leavebound = -lhs(leaveNum); // slack !!
240  leaveMax = -infinity;
241  objChange += theURbound[leaveNum] * lhs(leaveNum);
242  break;
244  assert( rep() == COLUMN );
245  if ((*theFvec)[leaveIdx] > theLBbound[leaveIdx])
246  {
247  ds.rowStatus(leaveNum) = SPxBasis::Desc::P_ON_LOWER;
248  theLRbound[leaveNum] = -infinity;
249  leavebound = -lhs(leaveNum); // slack !!
250  leaveMax = -infinity;
251  objChange += theURbound[leaveNum] * lhs(leaveNum);
252  }
253  else
254  {
255  ds.rowStatus(leaveNum) = SPxBasis::Desc::P_ON_UPPER;
256  theURbound[leaveNum] = infinity;
257  leavebound = -rhs(leaveNum); // slack !!
258  leaveMax = infinity;
259  objChange += theLRbound[leaveNum] * rhs(leaveNum);
260  }
261  break;
262 
263  default:
264  throw SPxInternalCodeException("XLEAVE02 This should never happen.");
265  }
266  MSG_DEBUG( std::cout << "DLEAVE51 SPxSolver::getLeaveVals() : row " << leaveNum
267  << ": " << leaveStat
268  << " -> " << ds.rowStatus(leaveNum)
269  << " objChange: " << objChange
270  << std::endl; )
271  }
272 
273  else
274  {
275  assert(leaveId.isSPxColId());
276  leaveNum = number(SPxColId(leaveId));
277  leaveStat = ds.colStatus(leaveNum);
278 
279  assert(isBasic(leaveStat));
280  switch (leaveStat)
281  {
283  assert( rep() == ROW );
284  ds.colStatus(leaveNum) = dualColStatus(leaveNum);
285  leavebound = 0;
286  leaveMax = -infinity;
287  break;
289  assert( rep() == ROW );
290  ds.colStatus(leaveNum) = dualColStatus(leaveNum);
291  leavebound = 0;
292  leaveMax = infinity;
293  break;
295  assert( rep() == ROW );
296  ds.colStatus(leaveNum) = dualColStatus(leaveNum);
297  if ((*theFvec)[leaveIdx] < theLBbound[leaveIdx])
298  {
299  leavebound = theLBbound[leaveIdx];
300  leaveMax = -infinity;
301  }
302  else
303  {
304  leavebound = theUBbound[leaveIdx];
305  leaveMax = infinity;
306  }
307  break;
308 
310  assert( rep() == COLUMN );
311  assert(SPxLP::upper(leaveNum) == SPxLP::lower(leaveNum));
312  ds.colStatus(leaveNum) = SPxBasis::Desc::P_FIXED;
313  leavebound = SPxLP::upper(leaveNum);
314  objChange += maxObj(leaveNum) * leavebound;
315  if ((*theFvec)[leaveIdx] < theLBbound[leaveIdx])
316  leaveMax = infinity;
317  else
318  leaveMax = -infinity;
319  break;
321  assert( rep() == COLUMN );
322  ds.colStatus(leaveNum) = SPxBasis::Desc::P_ON_UPPER;
323  leavebound = SPxLP::upper(leaveNum);
324  objChange += theUCbound[leaveNum] * leavebound;
325  leaveMax = -infinity;
326  break;
328  assert( rep() == COLUMN );
329  ds.colStatus(leaveNum) = SPxBasis::Desc::P_ON_LOWER;
330  leavebound = SPxLP::lower(leaveNum);
331  objChange += theLCbound[leaveNum] * leavebound;
332  leaveMax = infinity;
333  break;
335  assert( rep() == COLUMN );
336  if ((*theFvec)[leaveIdx] > theUBbound[leaveIdx])
337  {
338  leaveMax = -infinity;
339  leavebound = SPxLP::upper(leaveNum);
340  objChange += theUCbound[leaveNum] * leavebound;
341  theLCbound[leaveNum] = -infinity;
342  ds.colStatus(leaveNum) = SPxBasis::Desc::P_ON_UPPER;
343  }
344  else
345  {
346  leaveMax = infinity;
347  leavebound = SPxLP::lower(leaveNum);
348  objChange += theLCbound[leaveNum] * leavebound;
349  theUCbound[leaveNum] = infinity;
350  ds.colStatus(leaveNum) = SPxBasis::Desc::P_ON_LOWER;
351  }
352  break;
353  default:
354  throw SPxInternalCodeException("XLEAVE03 This should never happen.");
355  }
356  MSG_DEBUG( std::cout << "DLEAVE52 SPxSolver::getLeaveVals() : col " << leaveNum
357  << ": " << leaveStat
358  << " -> " << ds.colStatus(leaveNum)
359  << " objChange: " << objChange
360  << std::endl; )
361  }
362 }
363 
365  Real leaveMax,
366  SPxId enterId,
367  Real& enterBound,
368  Real& newUBbound,
369  Real& newLBbound,
370  Real& newCoPrhs,
371  Real& objChange
372 )
373 {
374  SPxBasis::Desc& ds = desc();
375 
376  enterBound = 0;
377  if (enterId.isSPxRowId())
378  {
379  int idx = number(SPxRowId(enterId));
380  SPxBasis::Desc::Status enterStat = ds.rowStatus(idx);
381 
382  switch (enterStat)
383  {
385  assert(rep() == ROW);
386  if (thePvec->delta()[idx] * leaveMax < 0)
387  newCoPrhs = theLRbound[idx];
388  else
389  newCoPrhs = theURbound[idx];
390  newUBbound = infinity;
391  newLBbound = -infinity;
393  break;
395  assert(rep() == ROW);
396  newUBbound = 0;
397  newLBbound = -infinity;
399  newCoPrhs = theLRbound[idx];
400  break;
402  assert(rep() == ROW);
403  newUBbound = infinity;
404  newLBbound = 0;
406  newCoPrhs = theURbound[idx];
407  break;
409  assert(rep() == ROW);
410  if (leaveMax * thePvec->delta()[idx] < 0)
411  {
412  newUBbound = 0;
413  newLBbound = -infinity;
415  newCoPrhs = theLRbound[idx];
416  }
417  else
418  {
419  newUBbound = infinity;
420  newLBbound = 0;
422  newCoPrhs = theURbound[idx];
423  }
424  break;
425 
427  assert(rep() == COLUMN);
428  ds.rowStatus(idx) = dualRowStatus(idx);
429  if (lhs(idx) > -infinity)
430  theURbound[idx] = theLRbound[idx];
431  newCoPrhs = theLRbound[idx]; // slack !!
432  newUBbound = -lhs(idx);
433  newLBbound = -rhs(idx);
434  enterBound = -rhs(idx);
435  objChange -= newCoPrhs * rhs(idx);
436  break;
438  assert(rep() == COLUMN);
439  ds.rowStatus(idx) = dualRowStatus(idx);
440  if (rhs(idx) < infinity)
441  theLRbound[idx] = theURbound[idx];
442  newCoPrhs = theURbound[idx]; // slack !!
443  newLBbound = -rhs(idx);
444  newUBbound = -lhs(idx);
445  enterBound = -lhs(idx);
446  objChange -= newCoPrhs * lhs(idx);
447  break;
449  assert(rep() == COLUMN);
450 #if 1
451  throw SPxInternalCodeException("XLEAVE04 This should never happen.");
452 #else
453  MSG_ERROR( std::cerr << "ELEAVE53 ERROR: not yet debugged!" << std::endl; )
454  ds.rowStatus(idx) = dualRowStatus(idx);
455  newCoPrhs = theURbound[idx]; // slack !!
456  newUBbound = infinity;
457  newLBbound = -infinity;
458  enterBound = 0;
459 #endif
460  break;
462  assert(rep() == COLUMN);
463  MSG_ERROR( std::cerr << "ELEAVE54 "
464  << "ERROR! Tried to put a fixed row variable into the basis: "
465  << "idx=" << idx
466  << ", lhs=" << lhs(idx)
467  << ", rhs=" << rhs(idx) << std::endl; )
468  throw SPxInternalCodeException("XLEAVE05 This should never happen.");
469 
470  default:
471  throw SPxInternalCodeException("XLEAVE06 This should never happen.");
472  }
473  MSG_DEBUG( std::cout << "DLEAVE55 SPxSolver::getLeaveVals2(): row " << idx
474  << ": " << enterStat
475  << " -> " << ds.rowStatus(idx)
476  << " objChange: " << objChange
477  << std::endl; )
478  }
479 
480  else
481  {
482  assert(enterId.isSPxColId());
483  int idx = number(SPxColId(enterId));
484  SPxBasis::Desc::Status enterStat = ds.colStatus(idx);
485 
486  switch (enterStat)
487  {
489  assert(rep() == ROW);
490  newUBbound = 0;
491  newLBbound = -infinity;
493  newCoPrhs = theLCbound[idx];
494  break;
496  assert(rep() == ROW);
497  newUBbound = infinity;
498  newLBbound = 0;
500  newCoPrhs = theUCbound[idx];
501  break;
503  assert(rep() == ROW);
504  newUBbound = infinity;
505  newLBbound = -infinity;
506  newCoPrhs = theLCbound[idx];
508  break;
510  assert(rep() == ROW);
511  if (leaveMax * theCoPvec->delta()[idx] < 0)
512  {
513  newUBbound = 0;
514  newLBbound = -infinity;
516  newCoPrhs = theLCbound[idx];
517  }
518  else
519  {
520  newUBbound = infinity;
521  newLBbound = 0;
523  newCoPrhs = theUCbound[idx];
524  }
525  break;
526 
528  assert(rep() == COLUMN);
529  ds.colStatus(idx) = dualColStatus(idx);
530  if (SPxLP::lower(idx) > -infinity)
531  theLCbound[idx] = theUCbound[idx];
532  newCoPrhs = theUCbound[idx];
533  newUBbound = SPxLP::upper(idx);
534  newLBbound = SPxLP::lower(idx);
535  enterBound = SPxLP::upper(idx);
536  objChange -= newCoPrhs * enterBound;
537  break;
539  assert(rep() == COLUMN);
540  ds.colStatus(idx) = dualColStatus(idx);
541  if (SPxLP::upper(idx) < infinity)
542  theUCbound[idx] = theLCbound[idx];
543  newCoPrhs = theLCbound[idx];
544  newUBbound = SPxLP::upper(idx);
545  newLBbound = SPxLP::lower(idx);
546  enterBound = SPxLP::lower(idx);
547  objChange -= newCoPrhs * enterBound;
548  break;
550  assert(rep() == COLUMN);
551  ds.colStatus(idx) = dualColStatus(idx);
552  if (thePvec->delta()[idx] * leaveMax > 0)
553  newCoPrhs = theUCbound[idx];
554  else
555  newCoPrhs = theLCbound[idx];
556  newUBbound = SPxLP::upper(idx);
557  newLBbound = SPxLP::lower(idx);
558  enterBound = 0;
559  break;
561  assert(rep() == COLUMN);
562  MSG_ERROR( std::cerr << "ELEAVE56 "
563  << "ERROR! Tried to put a fixed column variable into the basis. "
564  << "idx=" << idx
565  << ", lower=" << lower(idx)
566  << ", upper=" << upper(idx) << std::endl; )
567  throw SPxInternalCodeException("XLEAVE07 This should never happen.");
568  default:
569  throw SPxInternalCodeException("XLEAVE08 This should never happen.");
570  }
571 
572  MSG_DEBUG( std::cout << "DLEAVE57 SPxSolver::getLeaveVals2(): col " << idx
573  << ": " << enterStat
574  << " -> " << ds.colStatus(idx)
575  << " objChange: " << objChange
576  << std::endl; )
577  }
578 
579 }
580 
582  int leaveNum,
583  SPxId leaveId,
584  SPxBasis::Desc::Status leaveStat,
585  const SVector* //newVec
586 )
587 {
588  SPxBasis::Desc& ds = desc();
589  if (leaveId.isSPxRowId())
590  {
591  MSG_DEBUG( std::cout << "DLEAVE58 rejectLeave() : row " << leaveNum
592  << ": " << ds.rowStatus(leaveNum)
593  << " -> " << leaveStat << std::endl; )
594 
595  if (leaveStat == SPxBasis::Desc::D_ON_BOTH)
596  {
597  if (ds.rowStatus(leaveNum) == SPxBasis::Desc::P_ON_LOWER)
598  theLRbound[leaveNum] = theURbound[leaveNum];
599  else
600  theURbound[leaveNum] = theLRbound[leaveNum];
601  }
602  ds.rowStatus(leaveNum) = leaveStat;
603  }
604  else
605  {
606  MSG_DEBUG( std::cout << "DLEAVE59 rejectLeave() : col " << leaveNum
607  << ": " << ds.colStatus(leaveNum)
608  << " -> " << leaveStat << std::endl; )
609 
610  if (leaveStat == SPxBasis::Desc::D_ON_BOTH)
611  {
612  if (ds.colStatus(leaveNum) == SPxBasis::Desc::P_ON_UPPER)
613  theLCbound[leaveNum] = theUCbound[leaveNum];
614  else
615  theUCbound[leaveNum] = theLCbound[leaveNum];
616  }
617  ds.colStatus(leaveNum) = leaveStat;
618  }
619 }
620 
621 
623 {
624  Real sign = (direction > 0 ? 1.0 : -1.0);
625 
626  primalRay.clear();
628 
629  for( int i = 0; i < coPvec().delta().size(); ++i )
630  primalRay.add(coPvec().delta().index(i), sign * coPvec().delta().value(i));
631 }
632 
634 {
635  Real sign = (direction > 0 ? -1.0 : 1.0);
636 
637  dualFarkas.clear();
639 
640  for( int i = 0; i < coPvec().delta().size(); ++i )
641  dualFarkas.add(coPvec().delta().index(i), sign * coPvec().delta().value(i));
642 }
643 
644 bool SPxSolver::leave(int leaveIdx)
645 {
646  assert(leaveIdx < dim() && leaveIdx >= 0);
647  assert(type() == LEAVE);
648  assert(initialized);
649 
650  bool instable = instableLeave;
651  assert(!instable || instableLeaveNum >= 0);
652 
653  /*
654  Before performing the actual basis update, we must determine, how this
655  is to be accomplished.
656  When using steepest edge pricing this solve is already performed by the pricer
657  */
658  if (theCoPvec->delta().isSetup() && theCoPvec->delta().size() == 0)
659  {
660  coSolve(theCoPvec->delta(), unitVecs[leaveIdx]);
661  }
662 #ifdef ENABLE_ADDITIONAL_CHECKS
663  else
664  {
665  SSVector tmp(dim(), epsilon());
666  tmp.clear();
667  coSolve(tmp, unitVecs[leaveIdx]);
668  tmp -= theCoPvec->delta();
669  if (tmp.length() > leavetol()) {
670  // This happens very frequently and does usually not hurt, so print
671  // these warnings only with verbose level INFO2 and higher.
672  MSG_INFO2( (*spxout), (*spxout) << "WLEAVE60 iteration=" << basis().iteration()
673  << ": coPvec.delta error = " << tmp.length()
674  << std::endl; )
675  }
676  }
677 #endif // ENABLE_ADDITIONAL_CHECKS
678 
679  setupPupdate();
680 
681  assert(thePvec->isConsistent());
682  assert(theCoPvec->isConsistent());
683 
684  SPxBasis::Desc::Status leaveStat; // status of leaving var
685  SPxId leaveId; // id of leaving var
686  SPxId none; // invalid id used if leave fails
687  Real leaveMax; // maximium lambda of leaving var
688  Real leavebound; // current fVec value of leaving var
689  int leaveNum; // number of leaveId in bounds
690  Real objChange = 0.0; // amount of change in the objective function
691 
692  getLeaveVals(leaveIdx, leaveStat, leaveId, leaveMax, leavebound, leaveNum, objChange);
693 
694  if (m_numCycle > m_maxCycle)
695  {
696  if (leaveMax > 0)
697  perturbMaxLeave();
698  else
699  perturbMinLeave();
700  //@ m_numCycle /= 2;
701  // perturbation invalidates the currently stored nonbasic value
703  }
704  //@ testBounds();
705 
706  Real enterVal = leaveMax;
707  boundflips = 0;
708  Real oldShift = theShift;
709  SPxId enterId = theratiotester->selectEnter(enterVal, leaveIdx);
710  if (NE(theShift, oldShift))
711  {
712  MSG_DEBUG( std::cout << "DLEAVE71 trigger recomputation of nonbasic value due to shifts in ratiotest" << std::endl; )
714  }
715 
716  assert(!enterId.isValid() || !isBasic(enterId));
717 
718  instableLeaveNum = -1;
719  instableLeave = false;
720 
721  /*
722  No variable could be selected to enter the basis and even the leaving
723  variable is unbounded.
724  */
725  if (!enterId.isValid())
726  {
727  /* the following line originally was below in "rejecting leave" case;
728  we need it in the unbounded/infeasible case, too, to have the
729  correct basis size */
730  rejectLeave(leaveNum, leaveId, leaveStat);
731  change(-1, none, 0);
732  objChange = 0.0; // the nonbasicValue is not supposed to be updated in this case
733 
734  if (NE(enterVal, leaveMax))
735  {
736  MSG_DEBUG( std::cout << "DLEAVE61 rejecting leave A (leaveIdx=" << leaveIdx
737  << ", theCoTest=" << theCoTest[leaveIdx] << ")"
738  << std::endl; )
739 
740  /* In the LEAVE algorithm, when for a selected leaving variable we find only
741  an instable entering variable, then the basis change is not conducted.
742  Instead, we save the leaving variable's index in instableLeaveNum and scale
743  theCoTest[leaveIdx] down by some factor, hoping to find a different leaving
744  variable with a stable entering variable.
745  If this fails, however, and no more leaving variable is found, we have to
746  perform the instable basis change using instableLeaveNum. In this (and only
747  in this) case, the flag instableLeave is set to true.
748 
749  enterVal != leaveMax is the case that selectEnter has found only an instable entering
750  variable. We store this leaving variable for later -- if we are not already in the
751  instable case: then we continue and conclude unboundedness/infeasibility */
752  if (!instable)
753  {
754  instableLeaveNum = leaveIdx;
755 
756  // Note: These changes do not survive a refactorization
757  instableLeaveVal = theCoTest[leaveIdx];
758  theCoTest[leaveIdx] = instableLeaveVal / 10.0;
759 
760  return true;
761  }
762  }
763 
764  if (lastUpdate() > 1)
765  {
766  MSG_INFO3( (*spxout), (*spxout) << "ILEAVE01 factorization triggered in "
767  << "leave() for feasibility test" << std::endl; )
768  factorize();
769 
770  /* after a factorization, the leaving column/row might not be infeasible or suboptimal anymore, hence we do
771  * not try to call leave(leaveIdx), but rather return to the main solving loop and call the pricer again
772  */
773  return true;
774  }
775 
776  /* do not exit with status infeasible or unbounded if there is only a very small violation */
777  if (spxAbs(enterVal) < leavetol())
778  {
779  MSG_INFO3( (*spxout), (*spxout) << "ILEAVE11 clean up step to reduce numerical errors" << std::endl; )
780 
781  computeFrhs();
783  computeFtest();
784 
785  return true;
786  }
787  MSG_INFO3( (*spxout), (*spxout) << "ILEAVE02 unboundedness/infeasibility found "
788  << "in leave()" << std::endl; )
789 
790  if (rep() != COLUMN)
791  {
792  computePrimalray4Row(enterVal);
794  }
795  else
796  {
797  computeDualfarkas4Col(enterVal);
799  }
800  return false;
801  }
802  else
803  {
804  /*
805  If an entering variable has been found, a regular basis update is to
806  be performed.
807  */
808  if (enterId != baseId(leaveIdx))
809  {
810  const SVector& newVector = *enterVector(enterId);
811  // update feasibility vectors
812  if( solveVector2 != NULL && solveVector3 != NULL )
813  {
814  assert(solveVector2->isConsistent());
815  assert(solveVector2rhs->isSetup());
816  assert(solveVector3->isConsistent());
817  assert(solveVector3rhs->isSetup());
818  assert(boundflips > 0);
820  *solveVector2,
821  *solveVector3,
822  newVector,
824  *solveVector3rhs);
825 
826  // perform update of basic solution
827  primVec -= (*solveVector3);
828  MSG_INFO3( (*spxout), (*spxout) << "ILBFRT02 "
829  << "breakpoints passed / bounds flipped = " << boundflips
830  << std::endl; )
832  }
833  else if( solveVector2 != NULL )
834  {
835  assert(solveVector2->isConsistent());
836  assert(solveVector2rhs->isSetup());
837 
839  *solveVector2,
840  newVector,
841  *solveVector2rhs);
842  }
843  else if( solveVector3 != NULL )
844  {
845  assert(solveVector3->isConsistent());
846  assert(solveVector3rhs->isSetup());
847  assert(boundflips > 0);
849  *solveVector3,
850  newVector,
851  *solveVector3rhs);
852 
853  // perform update of basic solution
854  primVec -= (*solveVector3);
855  MSG_INFO3( (*spxout), (*spxout) << "ILBFRT02 "
856  << "breakpoints passed / bounds flipped = " << boundflips
857  << std::endl; )
859  }
860  else
861  SPxBasis::solve4update (theFvec->delta(), newVector);
862 
863 #ifdef ENABLE_ADDITIONAL_CHECKS
864  {
865  SSVector tmp(dim(), epsilon());
866  SPxBasis::solve(tmp, newVector);
867  tmp -= fVec().delta();
868  if (tmp.length() > entertol()) {
869  // This happens very frequently and does usually not hurt, so print
870  // these warnings only with verbose level INFO2 and higher.
871  MSG_INFO2( (*spxout), (*spxout) << "WLEAVE62\t(" << tmp.length() << ")\n"; )
872  }
873  }
874 #endif // ENABLE_ADDITIONAL_CHECKS
875 
876 
877  if (spxAbs(theFvec->delta()[leaveIdx]) < reject_leave_tol)
878  {
879  if (instable)
880  {
881  /* We are in the case that for all leaving variables only instable entering
882  variables were found: Thus, above we already accepted such an instable
883  entering variable. Now even this seems to be impossible, thus we conclude
884  unboundedness/infeasibility. */
885  MSG_INFO3( (*spxout), (*spxout) << "ILEAVE03 unboundedness/infeasibility found "
886  << "in leave()" << std::endl; )
887 
888  rejectLeave(leaveNum, leaveId, leaveStat);
889  change(-1, none, 0);
890  objChange = 0.0; // the nonbasicValue is not supposed to be updated in this case
891 
892  /**@todo if shift() is not zero we must not conclude unboundedness */
893  if (rep() == ROW)
894  {
895  computePrimalray4Row(enterVal);
897  }
898  else
899  {
900  computeDualfarkas4Col(enterVal);
902  }
903 
904  return false;
905  }
906  else
907  {
908  theFvec->delta().clear();
909  rejectLeave(leaveNum, leaveId, leaveStat, &newVector);
910  change(-1, none, 0);
911  objChange = 0.0; // the nonbasicValue is not supposed to be updated in this case
912 
913  MSG_DEBUG( std::cout << "DLEAVE63 rejecting leave B (leaveIdx=" << leaveIdx
914  << ", theCoTest=" << theCoTest[leaveIdx]
915  << ")" << std::endl; )
916 
917  // Note: These changes do not survive a refactorization
918  theCoTest[leaveIdx] *= 0.01;
919 
920  return true;
921  }
922  }
923 
924  // process leaving variable
925  if (leavebound > epsilon() || leavebound < -epsilon())
926  theFrhs->multAdd(-leavebound, baseVec(leaveIdx));
927 
928  // process entering variable
929  Real enterBound;
930  Real newUBbound;
931  Real newLBbound;
932  Real newCoPrhs;
933 
934  try
935  {
936  getLeaveVals2(leaveMax, enterId, enterBound, newUBbound, newLBbound, newCoPrhs, objChange);
937  }
938  catch( const SPxException& F )
939  {
940  rejectLeave(leaveNum, leaveId, leaveStat);
941  change(-1, none, 0);
942  objChange = 0.0; // the nonbasicValue is not supposed to be updated in this case
943  throw F;
944  }
945 
946  theUBbound[leaveIdx] = newUBbound;
947  theLBbound[leaveIdx] = newLBbound;
948  (*theCoPrhs)[leaveIdx] = newCoPrhs;
949 
950  if (enterBound > epsilon() || enterBound < -epsilon())
951  theFrhs->multAdd(enterBound, newVector);
952 
953  // update pricing vectors
954  theCoPvec->value() = enterVal;
955  thePvec->value() = enterVal;
956  if (enterVal > epsilon() || enterVal < -epsilon())
957  doPupdate();
958 
959  // update feasibility vector
960  theFvec->value() = -((*theFvec)[leaveIdx] - leavebound)
961  / theFvec->delta()[leaveIdx];
962  theFvec->update();
963  (*theFvec)[leaveIdx] = enterBound - theFvec->value();
964  updateFtest();
965 
966  // update objective funtion value
967  updateNonbasicValue(objChange);
968 
969  // change basis matrix
970  change(leaveIdx, enterId, &newVector, &(theFvec->delta()));
971  }
972 
973  /*
974  No entering vector has been selected from the basis. However, if the
975  shift amount for |coPvec| is bounded, we are in the case, that the
976  entering variable is moved from one bound to its other, before any of
977  the basis feasibility variables reaches their bound. This may only
978  happen in primal/columnwise case with upper and lower bounds on
979  variables.
980  */
981  else
982  {
983  // @todo update obj function value here!!!
984  assert(rep() == ROW);
985  SPxBasis::Desc& ds = desc();
986 
987  change(leaveIdx, none, 0);
988 
989  if (leaveStat == SPxBasis::Desc::P_ON_UPPER)
990  {
991  if (leaveId.isSPxRowId())
992  {
993  ds.rowStatus(leaveNum) = SPxBasis::Desc::P_ON_LOWER;
994  (*theCoPrhs)[leaveIdx] = theLRbound[leaveNum];
995  }
996  else
997  {
998  ds.colStatus(leaveNum) = SPxBasis::Desc::P_ON_LOWER;
999  (*theCoPrhs)[leaveIdx] = theLCbound[leaveNum];
1000  }
1001  theUBbound[leaveIdx] = 0;
1002  theLBbound[leaveIdx] = -infinity;
1003  }
1004  else
1005  {
1006  assert( leaveStat == SPxBasis::Desc::P_ON_LOWER );
1007  if (leaveId.isSPxRowId())
1008  {
1009  ds.rowStatus(leaveNum) = SPxBasis::Desc::P_ON_UPPER;
1010  (*theCoPrhs)[leaveIdx] = theURbound[leaveNum];
1011  }
1012  else
1013  {
1014  ds.colStatus(leaveNum) = SPxBasis::Desc::P_ON_UPPER;
1015  (*theCoPrhs)[leaveIdx] = theUCbound[leaveNum];
1016  }
1017  theUBbound[leaveIdx] = infinity;
1018  theLBbound[leaveIdx] = 0;
1019  }
1020 
1021  // update copricing vector
1022  theCoPvec->value() = enterVal;
1023  thePvec->value() = enterVal;
1024  if (enterVal > epsilon() || enterVal < -epsilon())
1025  doPupdate();
1026 
1027  // update feasibility vectors
1028  theFvec->value() = 0;
1029  assert(theCoTest[leaveIdx] < 0.0);
1030  m_pricingViol += theCoTest[leaveIdx];
1031  theCoTest[leaveIdx] *= -1;
1032  }
1033 
1034  if ((leaveMax > entertol() && enterVal <= entertol()) || (leaveMax < -entertol() && enterVal >= -entertol()))
1035  {
1036  if ((theUBbound[leaveIdx] < infinity || theLBbound[leaveIdx] > -infinity)
1037  && leaveStat != SPxBasis::Desc::P_FREE
1038  && leaveStat != SPxBasis::Desc::D_FREE)
1039  m_numCycle++;
1040  }
1041  else
1042  m_numCycle /= 2;
1043 
1044 #ifdef ENABLE_ADDITIONAL_CHECKS
1045  {
1046  DVector tmp = fVec();
1047  multBaseWith(tmp);
1048  tmp -= fRhs();
1049  if (tmp.length() > entertol())
1050  {
1051  // This happens very frequently and does usually not hurt, so print
1052  // these warnings only with verbose level INFO2 and higher.
1053  MSG_INFO2( (*spxout), (*spxout) << "WLEAVE64\t" << basis().iteration()
1054  << ": fVec error = " << tmp.length() << std::endl; )
1055  SPxBasis::solve(tmp, fRhs());
1056  tmp -= fVec();
1057  MSG_INFO2( (*spxout), (*spxout) << "WLEAVE65\t(" << tmp.length() << ")\n"; )
1058  }
1059  }
1060 #endif // ENABLE_ADDITIONAL_CHECKS
1061 
1062  return true;
1063  }
1064 }
1065 } // namespace soplex
void computeFtest()
compute basis feasibility test vector.
Definition: leave.cpp:38
Rational spxAbs(const Rational &r)
Absolute.
Definition: rational.cpp:3925
int dim() const
dimension of basis matrix.
Definition: spxsolver.h:936
bool isSPxRowId() const
is id a row id?
Definition: spxid.h:160
Desc::Status dualRowStatus(int i) const
dual Status for the i&#39;th row variable of the loaded LP.
Definition: spxbasis.cpp:46
Exception class for things that should NEVER happen.This class is derived from the SoPlex exception b...
Definition: exceptions.h:109
Representation rep() const
return the current basis representation.
Definition: spxsolver.h:406
virtual void rejectLeave(int leaveNum, SPxId leaveId, SPxBasis::Desc::Status leaveStat, const SVector *newVec=0)
Definition: leave.cpp:581
const IdxSet & idx() const
nonzero indices of update vector
Definition: updatevector.h:133
void coSolve(Vector &x, const Vector &rhs)
Cosolves linear system with basis matrix.
Definition: spxbasis.h:678
primal variable is fixed to both bounds
Definition: spxbasis.h:190
UpdateVector primVec
primal vector
Definition: spxsolver.h:291
const VectorBase< Real > & maxObj() const
Returns objective vector for maximization problem.
Definition: spxlpbase.h:384
int boundflips
number of performed bound flips
Definition: spxsolver.h:337
DIdxSet updateViols
store indices that were changed in the previous iteration and must be checked in hyper pricing ...
Definition: spxsolver.h:363
SPxOut * spxout
message handler
Definition: spxsolver.h:384
bool sparsePricingLeave
These values enable or disable sparse pricing.
Definition: spxsolver.h:374
bool isValid() const
returns TRUE iff the id is a valid column or row identifier.
Definition: spxid.h:150
int iteration() const
returns number of basis changes since last load().
Definition: spxbasis.h:539
DVector theCoTest
Definition: spxsolver.h:327
const Vector & fTest() const
Violations of fVec.
Definition: spxsolver.h:1246
Abstract pricer base class.
SSVector * solveVector3
when 3 systems are to be solved at a time; typically reserved for bound flipping ratio test (basic so...
Definition: spxsolver.h:250
bool isSPxColId() const
is id a column id?
Definition: spxid.h:165
void updateFtest()
update basis feasibility test vector.
Definition: leave.cpp:104
int size() const
Returns number of elements.
Definition: classarray.h:208
void computePrimalray4Row(Real direction)
Definition: leave.cpp:622
Exception classes for SoPlex.
Status & rowStatus(int i)
Definition: spxbasis.h:239
int number(const SPxRowId &id) const
Returns the row number of the row with identifier id.
Definition: spxlpbase.h:450
Abstract ratio test base class.
virtual void perturbMaxLeave(void)
perturb nonbasic bounds.
Definition: spxshift.cpp:458
int m_maxCycle
maximum steps before cycling is detected.
Definition: spxsolver.h:244
DataArray< int > isInfeasible
0: index not violated, 1: index violated, 2: index violated and among candidate list ...
Definition: spxsolver.h:370
bool NE(Real a, Real b, Real eps=Param::epsilon())
returns true iff |a-b| > eps
Definition: spxdefines.h:377
void clear()
removes all indices.
Definition: idxset.h:184
UpdateVector & fVec() const
feasibility vector.
Definition: spxsolver.h:1184
const VectorBase< Real > & lower() const
Returns lower bound vector.
Definition: spxlpbase.h:420
Real sparsePricingFactor
enable sparse pricing when viols < factor * dim()
Definition: spxsolver.h:277
bool isConsistent() const
consistency check.
Definition: ssvectorbase.h:589
SSVector * solveVector2rhs
when 2 systems are to be solved at a time; typically for speepest edge weights
Definition: spxsolver.h:249
Ids for LP columns.Class SPxColId provides DataKeys for the column indices of an SPxLP.
Definition: spxid.h:36
bool leave(int i)
Definition: leave.cpp:644
int sign(const Rational &r)
Sign function; returns 1 if r > 0, 0 if r = 0, and -1 if r < 0.
Definition: rational.cpp:3938
virtual void doPupdate(void)
Definition: spxvecs.cpp:526
const VectorBase< Real > & upper() const
Returns upper bound vector.
Definition: spxlpbase.h:402
virtual Real value()
current objective value.
Definition: spxsolver.cpp:863
rowwise representation.
Definition: spxsolver.h:107
Real delta() const
guaranteed primal and dual bound violation for optimal solution, returning the maximum of feastol() a...
Definition: spxsolver.h:705
dual variable is left free, but unset
Definition: spxbasis.h:191
Wrapper for different output streams and verbosity levels.
void add(const SVectorBase< S > &vec)
Append nonzeros of sv.
Definition: dsvectorbase.h:216
int index(int n) const
access n &#39;th index.
Definition: idxset.h:118
const Vector & fRhs() const
right-hand side vector for fVec
Definition: spxsolver.h:1197
primal variable is set to its upper bound
Definition: spxbasis.h:188
Generic Ids for LP rows or columns.Both SPxColIds and SPxRowIds may be treated uniformly as SPxIds: ...
Definition: spxid.h:85
int remainingRoundsLeave
number of dense rounds/refactorizations until sparsePricing is enabled again
Definition: spxsolver.h:380
int m_numCycle
actual number of degenerate steps so far.
Definition: spxsolver.h:245
Leaving Simplex.
Definition: spxsolver.h:143
UpdateVector & coPvec() const
copricing vector.
Definition: spxsolver.h:1259
SSVector * solveVector3rhs
when 3 systems are to be solved at a time; typically reserved for bound flipping ratio test (basic so...
Definition: spxsolver.h:251
bool m_pricingViolCoUpToDate
true, if the stored violation in coDim is up to date
Definition: spxsolver.h:238
double Real
SOPLEX_DEBUG.
Definition: spxdefines.h:200
#define MSG_INFO2(spxout, x)
Prints out message x if the verbosity level is at least SPxOut::INFO2.
Definition: spxdefines.h:115
DVector * theFrhs
Definition: spxsolver.h:309
int index(int n) const
Returns index of the n &#39;th nonzero element.
Definition: ssvectorbase.h:174
#define MSG_DEBUG(x)
Definition: spxdefines.h:127
virtual const SVector * enterVector(const SPxId &p_id)
Get pointer to the id &#39;th vector.
Definition: spxsolver.h:1751
Real m_pricingViol
maximal feasibility violation of current solution
Definition: spxsolver.h:235
Desc::Status dualColStatus(int i) const
dual Status for the i&#39;th column variable of the loaded LP.
Definition: spxbasis.cpp:69
UpdateVector * thePvec
Definition: spxsolver.h:314
void update()
Perform the update.
Definition: updatevector.h:147
int size() const
returns the number of used indices.
Definition: idxset.h:124
const SPxBasis & basis() const
Return current basis.
Definition: spxsolver.h:1616
dual variable is set to its upper bound
Definition: spxbasis.h:192
DVector theLBbound
Lower Basic Feasibility bound.
Definition: spxsolver.h:307
main LP solver class
virtual void setupPupdate(void)
Definition: spxvecs.cpp:506
void addIdx(int i)
adds index i to the index set
Definition: didxset.h:75
primal variable is left free, but unset
Definition: spxbasis.h:189
#define MSG_ERROR(x)
Prints out message x if the verbosity level is at least SPxOut::ERROR.
Definition: spxdefines.h:109
void clear()
Clears vector.
Definition: ssvectorbase.h:572
bool updateNonbasicValue(Real objChange)
Definition: spxsolver.cpp:886
Basis descriptor.
Definition: spxbasis.h:104
DVector theURbound
Upper Row Feasibility bound.
Definition: spxsolver.h:296
virtual void getLeaveVals2(Real leaveMax, SPxId enterId, Real &enterBound, Real &newUBbound, Real &newLBbound, Real &newCoPrhs, Real &objChange)
Definition: leave.cpp:364
Type type() const
return current Type.
Definition: spxsolver.h:412
Real entertol() const
feasibility tolerance maintained by ratio test during ENTER algorithm.
Definition: spxsolver.h:675
Real length() const
Floating point approximation of euclidian norm (without any approximation guarantee).
Definition: ssvectorbase.h:520
Status & colStatus(int i)
Definition: spxbasis.h:254
SPxId & baseId(int i)
Definition: spxbasis.h:497
DVector theUBbound
Upper Basic Feasibility bound.
Definition: spxsolver.h:306
virtual void change(int i, SPxId &id, const SVector *enterVec, const SSVector *eta=0)
performs basis update.
Definition: spxbasis.cpp:715
Real m_pricingViolCo
maximal feasibility violation of current solution in coDim
Definition: spxsolver.h:237
Real length() const
Floating point approximation of euclidian norm (without any approximation guarantee).
Definition: vectorbase.h:356
void computeDualfarkas4Col(Real direction)
Definition: leave.cpp:633
Debugging, floating point type and parameter definitions.
bool isSetup() const
Returns setup status.
Definition: ssvectorbase.h:120
int totalboundflips
total number of bound flips
Definition: spxsolver.h:338
virtual void getLeaveVals(int i, SPxBasis::Desc::Status &leaveStat, SPxId &leaveId, Real &leaveMax, Real &leavebound, int &leaveNum, Real &objChange)
Definition: leave.cpp:184
SSVector * solveVector2
when 2 systems are to be solved at a time; typically for speepest edge weights
Definition: spxsolver.h:248
DIdxSet infeasibilities
Definition: spxsolver.h:357
DVector theLRbound
Lower Row Feasibility bound.
Definition: spxsolver.h:297
DVector theUCbound
Upper Column Feasibility bound.
Definition: spxsolver.h:298
static const Real reject_leave_tol
Definition: leave.cpp:30
VectorBase< R > & multAdd(const S &x, const VectorBase< T > &vec)
Addition of scaled vector.
Definition: vectorbase.h:369
Exception base class.This class implements a base class for our SoPlex exceptions We provide a what()...
Definition: exceptions.h:32
const VectorBase< Real > & lhs() const
Returns left hand side vector.
Definition: spxlpbase.h:242
Everything should be within this namespace.
void clear()
Remove all indices.
Definition: svectorbase.h:396
UpdateVector * theFvec
Definition: spxsolver.h:310
int lastUpdate() const
returns number of basis changes since last refactorization.
Definition: spxbasis.h:533
void solve4update(SSVector &x, const SVector &rhs)
solves linear system with basis matrix.
Definition: spxbasis.h:628
primal variable is set to its lower bound
Definition: spxbasis.h:187
DVector theLCbound
Lower Column Feasibility bound.
Definition: spxsolver.h:299
Real & value()
update multiplicator , writeable
Definition: updatevector.h:111
Vector & multBaseWith(Vector &x) const
Basis-vector product.
Definition: spxbasis.cpp:931
void computeFrhs()
compute feasibility vector from scratch.
Definition: spxvecs.cpp:42
virtual void perturbMinLeave(void)
Definition: spxshift.cpp:445
std::streamsize precision() const
Definition: spxout.h:138
SPxRatioTester * theratiotester
Definition: spxsolver.h:341
Real epsilon() const
values are considered to be 0.
Definition: spxsolver.h:670
#define DENSEROUNDS
Definition: spxsolver.h:40
dual variable is set to its lower bound
Definition: spxbasis.h:193
DSVector primalRay
stores primal ray in case of unboundedness
Definition: spxsolver.h:330
Real theShift
sum of all shifts applied to any bound.
Definition: spxsolver.h:242
const Real infinity
Definition: spxdefines.cpp:26
const SVector & baseVec(int i) const
returns the i&#39;th basic vector.
Definition: spxbasis.h:508
const VectorBase< Real > & rhs() const
Returns right hand side vector.
Definition: spxlpbase.h:224
bool isBasic(SPxBasis::Desc::Status stat) const
does stat describe a basic index ?
Definition: spxsolver.h:1124
virtual SPxId selectEnter(Real &val, int leaveIdx)=0
selects variable Id to enter the basis.
DSVector dualFarkas
stores dual farkas proof in case of infeasibility
Definition: spxsolver.h:331
Array< UnitVector > unitVecs
array of unit vectors
Definition: spxsolver.h:286
dual variable has two bounds
Definition: spxbasis.h:194
Ids for LP rows.Class SPxRowId provides DataKeys for the row indices of an SPxLP. ...
Definition: spxid.h:55
bool initialized
true, if all vectors are setup.
Definition: spxsolver.h:246
const Desc & desc() const
Definition: spxbasis.h:457
void forceRecompNonbasicValue()
Definition: spxsolver.h:545
void solve(Vector &x, const Vector &rhs)
Definition: spxbasis.h:605
SSVector & delta()
update vector , writeable
Definition: updatevector.h:122
#define MSG_INFO3(spxout, x)
Prints out message x if the verbosity level is at least SPxOut::INFO3.
Definition: spxdefines.h:117
bool m_pricingViolUpToDate
true, if the stored violation is up to date
Definition: spxsolver.h:236
R value(int n) const
Returns value of the n &#39;th nonzero element.
Definition: ssvectorbase.h:182
UpdateVector * theCoPvec
Definition: spxsolver.h:313
Status
Status of a variable.
Definition: spxbasis.h:185
LP has been proven to be primal unbounded.
Definition: spxbasis.h:98
bool hyperPricingLeave
true if hyper sparse pricing is turned on in the leaving Simplex
Definition: spxsolver.h:377
Real leavetol() const
feasibility tolerance maintained by ratio test during LEAVE algorithm.
Definition: spxsolver.h:682
bool isConsistent() const
Set of indices.Class IdxSet provides a set of indices. At construction it must be given an array of i...
Definition: idxset.h:56
columnwise representation.
Definition: spxsolver.h:108
int size() const
Returns the number of nonzeros.
Definition: ssvectorbase.h:199
virtual void factorize()
Factorize basis matrix.
Definition: spxsolver.cpp:525
void setBasisStatus(SPxBasis::SPxStatus stat)
set the lp solver&#39;s basis status.
Definition: spxsolver.h:1905
void setMax(int newmax=1)
Reset nonzero memory to >= newmax.
Definition: dsvectorbase.h:248
LP has been proven to be primal infeasible.
Definition: spxbasis.h:99