Scippy

SoPlex

Sequential object-oriented simPlex

changesoplex.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-2018 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 #include <assert.h>
17 #include <iostream>
18 
19 #include "soplex/spxdefines.h"
20 #include "soplex/spxsolver.h"
21 #include "soplex/spxpricer.h"
22 #include "soplex/spxratiotester.h"
23 #include "soplex/exceptions.h"
24 
25 namespace soplex
26 {
27 
29 {
30 
31  if( n > 0 )
32  {
34 
35  unInit();
36  reDim();
37 
40  }
41 
42  /* we must not assert consistency here, since addedCols() might be still necessary to obtain a consistent basis */
43 }
44 
46 {
47 
48  if( n > 0 )
49  {
51 
52  unInit();
53  reDim();
54 
57  }
58 
59  /* we must not assert consistency here, since addedRows() might be still necessary to obtain a consistent basis */
60 }
61 
63 {
64 
66 
67  unInit();
68 
70  {
71  removedRow(i);
72  switch (SPxBasis::status())
73  {
74  case SPxBasis::DUAL:
77  break;
78  case SPxBasis::OPTIMAL:
80  break;
81  default:
82  break;
83  }
84  }
85 }
86 
87 void SPxSolver::doRemoveRows(int perm[])
88 {
89 
90  SPxLP::doRemoveRows(perm);
91 
92  unInit();
93 
95  {
96  removedRows(perm);
97  switch (SPxBasis::status())
98  {
99  case SPxBasis::DUAL:
102  break;
103  case SPxBasis::OPTIMAL:
105  break;
106  default:
107  break;
108  }
109  }
110 }
111 
113 {
115 
117 
118  unInit();
119 
121  {
122  removedCol(i);
123  switch (SPxBasis::status())
124  {
125  case SPxBasis::PRIMAL:
126  case SPxBasis::UNBOUNDED:
128  break;
129  case SPxBasis::OPTIMAL:
131  break;
132  default:
133  break;
134  }
135  }
136 }
137 
138 void SPxSolver::doRemoveCols(int perm[])
139 {
141 
142  SPxLP::doRemoveCols(perm);
143 
144  unInit();
145 
147  {
148  removedCols(perm);
149  switch (SPxBasis::status())
150  {
151  case SPxBasis::PRIMAL:
152  case SPxBasis::UNBOUNDED:
154  break;
155  case SPxBasis::OPTIMAL:
157  break;
158  default:
159  break;
160  }
161  }
162 }
163 
164 void SPxSolver::changeObj(const Vector& newObj, bool scale)
165 {
167 
168  SPxLP::changeObj(newObj, scale);
169 
170  /**@todo Factorization remains valid, we do not need a reDim()
171  * pricing vectors should be recomputed.
172  */
173  unInit();
174 }
175 
176 void SPxSolver::changeObj(int i, const Real& newVal, bool scale)
177 {
179 
180  SPxLP::changeObj(i, newVal, scale);
181 
182 
183  /**@todo Factorization remains valid, we do not need a reDim()
184  * pricing vectors should be recomputed.
185  */
186  unInit();
187 }
188 
189 void SPxSolver::changeMaxObj(const Vector& newObj, bool scale)
190 {
192 
193  SPxLP::changeMaxObj(newObj, scale);
194 
195  /**@todo Factorization remains valid, we do not need a reDim()
196  * pricing vectors should be recomputed.
197  */
198  unInit();
199 }
200 
201 void SPxSolver::changeMaxObj(int i, const Real& newVal, bool scale)
202 {
204 
205  SPxLP::changeMaxObj(i, newVal, scale);
206 
207  /**@todo Factorization remains valid, we do not need a reDim()
208  * pricing vectors should be recomputed.
209  */
210  unInit();
211 }
212 
213 void SPxSolver::changeRowObj(const Vector& newObj, bool scale)
214 {
216 
217  SPxLP::changeRowObj(newObj, scale);
218 
219  /**@todo Factorization remains valid, we do not need a reDim()
220  * pricing vectors should be recomputed.
221  */
222  unInit();
223 }
224 
225 void SPxSolver::changeRowObj(int i, const Real& newVal, bool scale)
226 {
228 
229  SPxLP::changeRowObj(i, newVal, scale);
230 
231  /**@todo Factorization remains valid, we do not need a reDim()
232  * pricing vectors should be recomputed.
233  */
234  unInit();
235 }
236 
237 void SPxSolver::changeLowerStatus(int i, Real newLower, Real oldLower)
238 {
240  Real currUpper = upper(i);
241  Real objChange = 0.0;
242 
243  MSG_DEBUG( std::cout << "DCHANG01 changeLowerStatus(): col " << i
244  << "[" << newLower << ":" << currUpper << "] " << stat; )
245 
246  switch (stat)
247  {
249  if (newLower <= -infinity)
250  {
251  if (currUpper >= infinity)
252  {
253  stat = SPxBasis::Desc::P_FREE;
254  if( m_nonbasicValueUpToDate && rep() == COLUMN )
255  objChange = -theLCbound[i] * oldLower;
256  }
257  else
258  {
260  if( m_nonbasicValueUpToDate && rep() == COLUMN )
261  objChange = (theUCbound[i] * currUpper) - (theLCbound[i] * oldLower);
262  }
263  }
264  else if( EQ(newLower, currUpper) )
265  {
267  if( m_nonbasicValueUpToDate && rep() == COLUMN )
268  objChange = maxObj(i) * (newLower - oldLower);
269  }
270  else if( m_nonbasicValueUpToDate && rep() == COLUMN )
271  objChange = theLCbound[i] * (newLower - oldLower);
272  break;
274  if( EQ(newLower, currUpper) )
276  break;
278  if (newLower > -infinity)
279  {
281  if( m_nonbasicValueUpToDate && rep() == COLUMN )
282  objChange = theLCbound[i] * newLower;
283  }
284  break;
286  if( NE(newLower, currUpper) )
287  {
289  if( isInitialized() )
290  theUCbound[i] = maxObj(i);
291  }
292  break;
298  if( rep() == ROW && theShift > 0.0 )
300  stat = dualColStatus(i);
301  break;
302  default:
303  throw SPxInternalCodeException("XCHANG01 This should never happen.");
304  }
305 
306  MSG_DEBUG( std::cout << " -> " << stat << std::endl; )
307 
308  // we only need to update the nonbasic value in column representation (see nonbasicValue() for comparison/explanation)
309  if( rep() == COLUMN )
310  updateNonbasicValue(objChange);
311 }
312 
313 void SPxSolver::changeLower(const Vector& newLower, bool scale)
314 {
315  // we better recompute the nonbasic value when changing all lower bounds
317 
318  SPxLP::changeLower(newLower, scale);
319 
321  {
322  for (int i = 0; i < newLower.dim(); ++i)
323  changeLowerStatus(i, lower(i));
324 
325  unInit();
326  }
327 }
328 
329 void SPxSolver::changeLower(int i, const Real& newLower, bool scale)
330 {
331  if( newLower != (scale ? lowerUnscaled(i) : lower(i)) )
332  {
333  Real oldLower = lower(i);
334  // This has to be done before calling changeLowerStatus() because that is calling
335  // basis.dualColStatus() which calls lower() and needs the changed value.
336  SPxLP::changeLower(i, newLower, scale);
337 
339  {
340  changeLowerStatus(i, lower(i), oldLower);
341  unInit();
342  }
343  }
344 }
345 
346 void SPxSolver::changeUpperStatus(int i, Real newUpper, Real oldUpper)
347 {
349  Real currLower = lower(i);
350  Real objChange = 0.0;
351 
352  MSG_DEBUG( std::cout << "DCHANG02 changeUpperStatus(): col " << i
353  << "[" << currLower << ":" << newUpper << "] " << stat; )
354 
355  switch (stat)
356  {
358  if (newUpper == currLower)
360  break;
362  if (newUpper >= infinity)
363  {
364  if (currLower <= -infinity)
365  {
366  stat = SPxBasis::Desc::P_FREE;
367  if( m_nonbasicValueUpToDate && rep() == COLUMN )
368  objChange = -theUCbound[i] * oldUpper;
369  }
370  else
371  {
373  if( m_nonbasicValueUpToDate && rep() == COLUMN )
374  objChange = (theLCbound[i] * currLower) - (theUCbound[i] * oldUpper);
375  }
376  }
377  else if (EQ(newUpper, currLower))
378  {
380  if( m_nonbasicValueUpToDate && rep() == COLUMN )
381  objChange = maxObj(i) * (newUpper - oldUpper);
382  }
383  else if( m_nonbasicValueUpToDate && rep() == COLUMN )
384  objChange = theUCbound[i] * (newUpper - oldUpper);
385  break;
387  if (newUpper < infinity)
388  {
390  if( m_nonbasicValueUpToDate && rep() == COLUMN )
391  objChange = theUCbound[i] * newUpper;
392  }
393  break;
395  if( NE(newUpper, currLower) )
396  {
398  if( isInitialized() )
399  theLCbound[i] = maxObj(i);
400  }
401  break;
407  if( rep() == ROW && theShift > 0.0 )
409  stat = dualColStatus(i);
410  break;
411  default:
412  throw SPxInternalCodeException("XCHANG02 This should never happen.");
413  }
414  MSG_DEBUG( std::cout << " -> " << stat << std::endl; );
415 
416  // we only need to update the nonbasic value in column representation (see nonbasicValue() for comparison/explanation)
417  if( rep() == COLUMN )
418  updateNonbasicValue(objChange);
419 }
420 
421 void SPxSolver::changeUpper(const Vector& newUpper, bool scale)
422 {
423  // we better recompute the nonbasic value when changing all upper bounds
425 
426  SPxLP::changeUpper(newUpper, scale);
427 
429  {
430  for (int i = 0; i < newUpper.dim(); ++i)
431  changeUpperStatus(i, upper(i));
432 
433  unInit();
434  }
435 }
436 
437 void SPxSolver::changeUpper(int i, const Real& newUpper, bool scale)
438 {
439  if( newUpper != (scale ? upperUnscaled(i) : upper(i)) )
440  {
441  Real oldUpper = upper(i);
442  SPxLP::changeUpper(i, newUpper, scale);
443 
445  {
446  changeUpperStatus(i, upper(i), oldUpper);
447  unInit();
448  }
449  }
450 }
451 
452 void SPxSolver::changeBounds(const Vector& newLower, const Vector& newUpper, bool scale)
453 {
454  changeLower(newLower, scale);
455  changeUpper(newUpper, scale);
456 }
457 
458 void SPxSolver::changeBounds(int i, const Real& newLower, const Real& newUpper, bool scale)
459 {
460  changeLower(i, newLower, scale);
461  changeUpper(i, newUpper, scale);
462 }
463 
464 void SPxSolver::changeLhsStatus(int i, Real newLhs, Real oldLhs)
465 {
467  Real currRhs = rhs(i);
468  Real objChange = 0.0;
469 
470  MSG_DEBUG( std::cout << "DCHANG03 changeLhsStatus() : row " << i
471  << ": " << stat; )
472  switch (stat)
473  {
475  if (newLhs <= -infinity)
476  {
477  if (currRhs >= infinity)
478  {
479  stat = SPxBasis::Desc::P_FREE;
480  if( m_nonbasicValueUpToDate && rep() == COLUMN )
481  objChange = -theURbound[i] * oldLhs;
482  }
483  else
484  {
486  if( m_nonbasicValueUpToDate && rep() == COLUMN )
487  objChange = (theLRbound[i] * currRhs) - (theURbound[i] * oldLhs);
488  }
489  }
490  else if( EQ(newLhs, currRhs) )
491  {
493  if( m_nonbasicValueUpToDate && rep() == COLUMN )
494  objChange = maxRowObj(i) * (newLhs - oldLhs);
495  }
496  else if( m_nonbasicValueUpToDate && rep() == COLUMN )
497  objChange = theURbound[i] * (newLhs - oldLhs);
498  break;
500  if( EQ(newLhs, currRhs) )
502  break;
504  if (newLhs > -infinity)
505  {
507  if( m_nonbasicValueUpToDate && rep() == COLUMN )
508  objChange = theURbound[i] * newLhs;
509  }
510  break;
512  if( NE(newLhs, currRhs) )
513  {
515  if( isInitialized() )
516  theLRbound[i] = maxRowObj(i);
517  }
518  break;
524  if( rep() == ROW && theShift > 0.0 )
526  stat = dualRowStatus(i);
527  break;
528  default:
529  throw SPxInternalCodeException("XCHANG03 This should never happen.");
530  }
531  MSG_DEBUG( std::cout << " -> " << stat << std::endl; )
532 
533  // we only need to update the nonbasic value in column representation (see nonbasicValue() for comparison/explanation)
534  if( rep() == COLUMN )
535  updateNonbasicValue(objChange);
536 }
537 
538 void SPxSolver::changeLhs(const Vector& newLhs, bool scale)
539 {
540  // we better recompute the nonbasic value when changing all lhs
542 
543  SPxLP::changeLhs(newLhs, scale);
544 
546  {
547  for (int i = 0; i < nRows(); ++i)
548  changeLhsStatus(i, lhs(i));
549 
550  unInit();
551  }
552 }
553 
554 void SPxSolver::changeLhs(int i, const Real& newLhs, bool scale)
555 {
556  if( newLhs != (scale ? lhsUnscaled(i) : lhs(i)) )
557  {
558  Real oldLhs = lhs(i);
559  SPxLP::changeLhs(i, newLhs, scale);
560 
562  {
563  changeLhsStatus(i, lhs(i), oldLhs);
564  unInit();
565  }
566  }
567 }
568 
569 void SPxSolver::changeRhsStatus(int i, Real newRhs, Real oldRhs)
570 {
572  Real currLhs = lhs(i);
573  Real objChange = 0.0;
574 
575  MSG_DEBUG( std::cout << "DCHANG04 changeRhsStatus() : row " << i
576  << ": " << stat; )
577  switch (stat)
578  {
580  if (newRhs >= infinity)
581  {
582  if (currLhs <= -infinity)
583  {
584  stat = SPxBasis::Desc::P_FREE;
585  if( m_nonbasicValueUpToDate && rep() == COLUMN )
586  objChange = -theLRbound[i] * oldRhs;
587  }
588  else
589  {
591  if( m_nonbasicValueUpToDate && rep() == COLUMN )
592  objChange = (theURbound[i] * currLhs) - (theLRbound[i] * oldRhs);
593  }
594  }
595  else if( EQ(newRhs, currLhs) )
596  {
598  if( m_nonbasicValueUpToDate && rep() == COLUMN )
599  objChange = maxRowObj(i) * (newRhs - oldRhs);
600  }
601  else if( m_nonbasicValueUpToDate && rep() == COLUMN )
602  objChange = theLRbound[i] * (newRhs - oldRhs);
603  break;
605  if( EQ(newRhs, currLhs) )
607  break;
609  if (newRhs < infinity)
610  {
612  if( m_nonbasicValueUpToDate && rep() == COLUMN )
613  objChange = theLRbound[i] * newRhs;
614  }
615  break;
617  if( NE(newRhs, currLhs) )
618  {
620  if( isInitialized() )
621  theURbound[i] = maxRowObj(i);
622  }
623  break;
629  if( rep() == ROW && theShift > 0.0 )
631  stat = dualRowStatus(i);
632  break;
633  default:
634  throw SPxInternalCodeException("XCHANG04 This should never happen.");
635  }
636  MSG_DEBUG( std::cout << " -> " << stat << std::endl; )
637 
638  // we only need to update the nonbasic value in column representation (see nonbasicValue() for comparison/explanation)
639  if( rep() == COLUMN )
640  updateNonbasicValue(objChange);
641 }
642 
643 
644 void SPxSolver::changeRhs(const Vector& newRhs, bool scale)
645 {
646  // we better recompute the nonbasic value when changing all rhs
648 
649  SPxLP::changeRhs(newRhs, scale);
650 
652  {
653  for (int i = 0; i < nRows(); ++i)
654  changeRhsStatus(i, rhs(i));
655  unInit();
656  }
657 }
658 
659 void SPxSolver::changeRhs(int i, const Real& newRhs, bool scale)
660 {
661  if( newRhs != (scale ? rhsUnscaled(i) : rhs(i)) )
662  {
663  Real oldRhs = rhs(i);
664  SPxLP::changeRhs(i, newRhs, scale);
665 
667  {
668  changeRhsStatus(i, rhs(i), oldRhs);
669  unInit();
670  }
671  }
672 }
673 
674 void SPxSolver::changeRange(const Vector& newLhs, const Vector& newRhs, bool scale)
675 {
676  // we better recompute the nonbasic value when changing all ranges
678 
679  SPxLP::changeLhs(newLhs, scale);
680  SPxLP::changeRhs(newRhs, scale);
682  {
683  for (int i = nRows() - 1; i >= 0; --i)
684  {
685  changeLhsStatus(i, lhs(i));
686  changeRhsStatus(i, rhs(i));
687  }
688  unInit();
689  }
690 }
691 
692 void SPxSolver::changeRange(int i, const Real& newLhs, const Real& newRhs, bool scale)
693 {
694  Real oldLhs = lhs(i);
695  Real oldRhs = rhs(i);
696 
697  SPxLP::changeLhs(i, newLhs, scale);
698  SPxLP::changeRhs(i, newRhs, scale);
699 
701  {
702  changeLhsStatus(i, lhs(i), oldLhs);
703  changeRhsStatus(i, rhs(i), oldRhs);
704  unInit();
705  }
706 }
707 
708 void SPxSolver::changeRow(int i, const LPRow& newRow, bool scale)
709 {
711 
712  SPxLP::changeRow(i, newRow, scale);
715  unInit();
716 }
717 
718 void SPxSolver::changeCol(int i, const LPCol& newCol, bool scale)
719 {
720  if( i < 0 )
721  return;
722 
724 
725  SPxLP::changeCol(i, newCol, scale);
728  unInit();
729 }
730 
731 void SPxSolver::changeElement(int i, int j, const Real& val, bool scale)
732 {
733  if( i < 0 || j < 0 )
734  return;
735 
737 
738  SPxLP::changeElement(i, j, val, scale);
740  SPxBasis::changedElement( i, j );
741  unInit();
742 }
743 
745 {
746 
747  SPxLP::changeSense(sns);
748  unInit();
749 }
750 } // namespace soplex
const VectorBase< R > & rhs() const
Returns right hand side vector.
Definition: spxlpbase.h:219
virtual void addedRows(int n)
virtual void changeRow(int i, const LPRow &newRow, bool scale=false)
Exception class for things that should NEVER happen.This class is derived from the SoPlex exception b...
Definition: exceptions.h:109
void addedRows(int n)
inform SPxBasis, that n new rows had been added.
Basis is dual feasible.
Definition: spxbasis.h:95
Basis is not known to be dual nor primal feasible.
Definition: spxbasis.h:94
primal variable is fixed to both bounds
Definition: spxbasis.h:190
virtual void changeLower(const Vector &newLower, bool scale=false)
primal or dual variable is undefined
Definition: spxbasis.h:195
const VectorBase< R > & upper() const
Returns upper bound vector.
Definition: spxlpbase.h:456
Desc::Status dualColStatus(int i) const
dual Status for the i&#39;th column variable of the loaded LP.
Definition: spxbasis.cpp:69
THREADLOCAL const Real infinity
Definition: spxdefines.cpp:26
void removedCols(const int perm[])
inform SPxBasis that columns in perm with negative entry were removed.
Abstract pricer base class.
virtual void reDim()
reset dimensions of vectors according to loaded LP.
Definition: spxsolver.cpp:449
Basis is optimal, i.e. dual and primal feasible.
Definition: spxbasis.h:97
Exception classes for SoPlex.
Status & rowStatus(int i)
Definition: spxbasis.h:239
R rhsUnscaled(int i) const
Returns unscaled right hand side of row number i.
virtual void changeCol(int n, const LPColBase< Real > &newCol, bool scale=false)
Replaces i &#39;th column of LP with newCol. scale determines whether the new data should be scaled...
Definition: spxlpbase.h:1638
virtual void addedCols(int newcols)
Called after the last n columns have just been added.
Definition: spxlpbase.h:2095
Abstract ratio test base class.
virtual void changeUpper(const Vector &newUpper, bool scale=false)
bool NE(Real a, Real b, Real eps=Param::epsilon())
returns true iff |a-b| > eps
Definition: spxdefines.h:382
void changedCol(int)
inform SPxBasis that a column had been changed.
virtual void addedCols(int n)
virtual void changeCol(int i, const LPCol &newCol, bool scale=false)
void changedElement(int, int)
inform SPxBasis that a matrix entry had been changed.
rowwise representation.
Definition: spxsolver.h:106
Desc::Status dualRowStatus(int i) const
dual Status for the i&#39;th row variable of the loaded LP.
Definition: spxbasis.cpp:46
void changedRow(int)
inform SPxBasis that a row had been changed.
dual variable is left free, but unset
Definition: spxbasis.h:191
int nRows() const
Returns number of rows in LP.
Definition: spxlpbase.h:151
void removedCol(int i)
inform SPxBasis that column i had been removed.
virtual void changeRhs(const Vector &newRhs, bool scale=false)
primal variable is set to its upper bound
Definition: spxbasis.h:188
virtual void changeBounds(const Vector &newLower, const Vector &newUpper, bool scale=false)
virtual void changeLhsStatus(int i, Real newLhs, Real oldLhs=0.0)
SPxSense
Optimization sense.
Definition: spxlpbase.h:97
virtual void doRemoveRow(int i)
virtual void changeRowObj(const Vector &newObj, bool scale=false)
SPxStatus status() const
returns current SPxStatus.
Definition: spxbasis.h:425
double Real
Definition: spxdefines.h:218
virtual void doRemoveRows(int perm[])
Internal helper method.
Definition: spxlpbase.h:2009
void removedRows(const int perm[])
inform SPxBasis that rows in perm with negative entry were removed.
virtual void doRemoveCols(int perm[])
#define MSG_DEBUG(x)
Definition: spxdefines.h:132
virtual void changeMaxObj(const VectorBase< Real > &newObj, bool scale=false)
Changes objective vector to newObj. scale determines whether the new data should be scaled...
Definition: spxlpbase.h:1323
virtual void unInit()
uninitialize data structures.
Definition: spxsolver.h:1838
R upperUnscaled(int i) const
Returns unscaled upper bound of column i.
virtual void changeSense(SPxSense sns)
virtual void changeElement(int i, int j, const Real &val, bool scale=false)
dual variable is set to its upper bound
Definition: spxbasis.h:192
main LP solver class
virtual void changeLhs(const Vector &newLhs, bool scale=false)
primal variable is left free, but unset
Definition: spxbasis.h:189
virtual void changeLower(const VectorBase< Real > &newLower, bool scale=false)
Changes vector of lower bounds to newLower. scale determines whether the new data should be scaled...
Definition: spxlpbase.h:1360
virtual void changeRhs(const VectorBase< Real > &newRhs, bool scale=false)
Changes right hand side vector for constraints to newRhs. scale determines whether the new data shoul...
Definition: spxlpbase.h:1502
const VectorBase< R > & lhs() const
Returns left hand side vector.
Definition: spxlpbase.h:253
bool updateNonbasicValue(Real objChange)
Definition: spxsolver.cpp:899
DVector theURbound
Upper Row Feasibility bound.
Definition: spxsolver.h:330
virtual void changeLowerStatus(int i, Real newLower, Real oldLower=0.0)
const VectorBase< R > & maxRowObj() const
Definition: spxlpbase.h:297
R lhsUnscaled(int i) const
Returns unscaled left hand side of row number i.
Status & colStatus(int i)
Definition: spxbasis.h:254
(In)equality for LPs.Class LPRowBase provides constraints for linear programs in the form where a is...
Definition: lprowbase.h:45
virtual void changeRow(int n, const LPRowBase< Real > &newRow, bool scale=false)
Replaces i &#39;th row of LP with newRow. scale determines whether the new data should be scaled...
Definition: spxlpbase.h:1593
virtual void changeRhsStatus(int i, Real newRhs, Real oldRhs=0.0)
virtual void changeUpper(const VectorBase< Real > &newUpper, bool scale=false)
Changes vector of upper bounds to newUpper. scale determines whether the new data should be scaled...
Definition: spxlpbase.h:1397
virtual void changeMaxObj(const Vector &newObj, bool scale=false)
Debugging, floating point type and parameter definitions.
bool EQ(Real a, Real b, Real eps=Param::epsilon())
returns true iff |a-b| <= eps
Definition: spxdefines.h:376
virtual void changeObj(const VectorBase< Real > &newObj, bool scale=false)
Changes objective vector to newObj. scale determines whether the new data should be scaled...
Definition: spxlpbase.h:1291
DVector theLRbound
Lower Row Feasibility bound.
Definition: spxsolver.h:331
DVector theUCbound
Upper Column Feasibility bound.
Definition: spxsolver.h:332
bool isInitialized() const
has the internal data been initialized?
Definition: spxsolver.h:1829
int dim() const
Dimension of vector.
Definition: vectorbase.h:215
virtual void doRemoveCols(int perm[])
Internal helper method.
Definition: spxlpbase.h:2069
Everything should be within this namespace.
virtual void changeRange(const Vector &newLhs, const Vector &newRhs, bool scale=false)
R lowerUnscaled(int i) const
Returns unscaled lower bound of column i.
primal variable is set to its lower bound
Definition: spxbasis.h:187
bool m_nonbasicValueUpToDate
true, if the stored objValue is up to date
Definition: spxsolver.h:257
const VectorBase< R > & maxObj() const
Returns objective vector for maximization problem.
Definition: spxlpbase.h:429
DVector theLCbound
Lower Column Feasibility bound.
Definition: spxsolver.h:333
virtual void changeRowObj(const VectorBase< Real > &newRowObj, bool scale=false)
Changes row objective function vector to newRowObj. scale determines whether the new data should be s...
Definition: spxlpbase.h:1562
virtual void changeUpperStatus(int i, Real newUpper, Real oldLower=0.0)
void removedRow(int i)
inform SPxBasis that row i had been removed.
dual variable is set to its lower bound
Definition: spxbasis.h:193
virtual void changeSense(SPxSense sns)
Changes optimization sense to sns.
Definition: spxlpbase.h:1763
Real theShift
sum of all shifts applied to any bound.
Definition: spxsolver.h:266
virtual void doRemoveCol(int i)
virtual void changeElement(int i, int j, const Real &val, bool scale=false)
Changes LP element (i, j) to val. scale determines whether the new data should be scaled...
Definition: spxlpbase.h:1683
virtual void changeLhs(const VectorBase< Real > &newLhs, bool scale=false)
Changes left hand side vector for constraints to newLhs. scale determines whether the new data should...
Definition: spxlpbase.h:1465
dual variable has two bounds
Definition: spxbasis.h:194
virtual void doRemoveRow(int j)
Internal helper method.
Definition: spxlpbase.h:1974
virtual void doRemoveRows(int perm[])
virtual void addedRows(int newrows)
Called after the last n rows have just been added.
Definition: spxlpbase.h:2091
void forceRecompNonbasicValue()
Definition: spxsolver.h:651
virtual void doRemoveCol(int j)
Internal helper method.
Definition: spxlpbase.h:2030
Status
Status of a variable.
Definition: spxbasis.h:185
virtual void changeObj(const Vector &newObj, bool scale=false)
scale determines whether the new data needs to be scaled according to the existing LP (persistent sca...
LP has been proven to be primal unbounded.
Definition: spxbasis.h:98
const VectorBase< R > & lower() const
Returns (internal and possibly scaled) lower bound vector.
Definition: spxlpbase.h:483
LP column.Class LPColBase provides a datatype for storing the column of an LP a the form similar to ...
Definition: lpcolbase.h:45
const Desc & desc() const
Definition: spxbasis.h:463
Representation rep() const
return the current basis representation.
Definition: spxsolver.h:487
columnwise representation.
Definition: spxsolver.h:107
Basis is primal feasible.
Definition: spxbasis.h:96
void setBasisStatus(SPxBasis::SPxStatus stat)
set the lp solver&#39;s basis status.
Definition: spxsolver.h:2029
void addedCols(int n)
inform SPxBasis that n new columns had been added.
LP has been proven to be primal infeasible.
Definition: spxbasis.h:99
No Problem has been loaded to the basis.
Definition: spxbasis.h:92