Scippy

SoPlex

Sequential object-oriented simPlex

spxweightst.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-2019 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 //#define TEST 1
17 
18 #include <assert.h>
19 #include <iostream>
20 
21 #include "soplex/spxdefines.h"
22 #include "soplex/spxweightst.h"
23 #include "soplex/svset.h"
24 #include "soplex/sorter.h"
25 
26 namespace soplex
27 {
28 #define EPS 1e-6
29 #define STABLE 1e-3 // the sparsest row/column may only have a pivot of size STABLE*maxEntry
30 
32 {
33 #ifdef ENABLE_CONSISTENCY_CHECKS
34  return rowWeight.isConsistent()
37  && colUp.isConsistent();
38  // && SPxStarter::isConsistent(); // not yet implemented
39 #else
40  return true;
41 #endif
42 }
43 
44 /* Generating the Starting Basis
45  The generation of a starting basis works as follows: After setting up the
46  preference arrays #weight# and #coWeight#, #Id#s are selected to be dual in
47  a greedy manner. Initially, the first #Id# is taken. Then the next #Id# is
48  checked wheter its vector is linearly dependend of the vectors of the #Id#s
49  allready selected. If not, it is added to them. This is iterated until a
50  full matrix has been constructed.
51 
52  Testing for linear independence is done very much along the lines of LU
53  factorization. A vector is taken, and updated with all previous L-vectors.
54  Then the maximal absolut element is selected as pivot element for computing
55  the L-vector. This is stored for further processing.
56  */
57 
58 /*
59  The following two functions set the status of |id| to primal or dual,
60  respectively.
61  */
63  SPxBasis::Desc& desc,
64  const SPxSolver& base,
65  const SPxId& id)
66 {
67  if(id.isSPxRowId())
68  {
69  int n = base.number(SPxRowId(id));
70 
71  if(base.rhs(n) >= infinity)
72  {
73  if(base.lhs(n) <= -infinity)
75  else
77  }
78  else
79  {
80  if(base.lhs(n) <= -infinity)
82  else if(base.lhs(n) >= base.rhs(n) - base.epsilon())
84  else if(rowRight[n])
86  else
88  }
89  }
90  else
91  {
92  int n = base.number(SPxColId(id));
93 
94  if(base.SPxLP::upper(n) >= infinity)
95  {
96  if(base.SPxLP::lower(n) <= -infinity)
98  else
100  }
101  else
102  {
103  if(base.SPxLP::lower(n) <= -infinity)
105  else if(base.SPxLP::lower(n) >= base.SPxLP::upper(n) - base.epsilon())
107  else if(colUp[n])
109  else
111  }
112  }
113 }
114 
115 // ----------------------------------------------------------------
116 static void setDualStatus(
117  SPxBasis::Desc& desc,
118  const SPxSolver& base,
119  const SPxId& id)
120 {
121  if(id.isSPxRowId())
122  {
123  int n = base.number(SPxRowId(id));
124  desc.rowStatus(n) = base.basis().dualRowStatus(n);
125  }
126  else
127  {
128  int n = base.number(SPxColId(id));
129  desc.colStatus(n) = base.basis().dualColStatus(n);
130  }
131 }
132 // ----------------------------------------------------------------
133 
134 /// Compare class for row weights, used for sorting.
135 struct Compare
136 {
137 public:
138  /// constructor
139  Compare() : weight(0) {}
140  // const SPxSolver* base; ///< the solver
141  const Real* weight; ///< the weights to compare
142 
143  /// compares the weights
144  Real operator()(int i1, int i2) const
145  {
146  return weight[i1] - weight[i2];
147  }
148 };
149 
150 // ----------------------------------------------------------------
151 /**
152  The following method initializes \p pref such that it contains the
153  set of \ref soplex::SPxId "SPxIds" ordered following \p rowWeight and
154  \p colWeight. For the sorting we take the following approach: first
155  we sort the rows, then the columns. Finally we perform a mergesort
156  of both.
157  */
158 static void initPrefs(
159  DataArray<SPxId>& pref,
160  const SPxSolver& base,
161  const DataArray<Real>& rowWeight,
162  const DataArray<Real>& colWeight)
163 {
164  DataArray<int> row(base.nRows());
165  DataArray<int> col(base.nCols());
166  int i;
167  int j;
168  int k;
169 
170  Compare compare;
171  // compare.base = &base;
172 
173  for(i = 0; i < base.nRows(); ++i)
174  row[i] = i;
175 
176  compare.weight = rowWeight.get_const_ptr();
177 
178  SPxQuicksort(row.get_ptr(), row.size(), compare); // Sort rows
179 
180  for(i = 0; i < base.nCols(); ++i)
181  col[i] = i;
182 
183  compare.weight = colWeight.get_const_ptr();
184 
185  SPxQuicksort(col.get_ptr(), col.size(), compare); // Sort column
186 
187  i = 0;
188  j = 0;
189  k = 0;
190 
191  while(k < pref.size()) // merge sort
192  {
193  if(rowWeight[row[i]] < colWeight[col[j]])
194  {
195  pref[k++] = base.rId(row[i++]);
196 
197  if(i >= base.nRows())
198  while(k < pref.size())
199  pref[k++] = base.cId(col[j++]);
200  }
201  else
202  {
203  pref[k++] = base.cId(col[j++]);
204 
205  if(j >= base.nCols())
206  while(k < pref.size())
207  pref[k++] = base.rId(row[i++]);
208  }
209  }
210 
211  assert(i == base.nRows());
212  assert(j == base.nCols());
213 }
214 
215 // ----------------------------------------------------------------
217 {
218  SPxId tmpId;
219 
220  forbidden.reSize(base.dim());
221  rowWeight.reSize(base.nRows());
222  colWeight.reSize(base.nCols());
223  rowRight.reSize(base.nRows());
224  colUp.reSize(base.nCols());
225 
226  if(base.rep() == SPxSolver::COLUMN)
227  {
228  weight = &colWeight;
229  coWeight = &rowWeight;
230  }
231  else
232  {
233  weight = &rowWeight;
234  coWeight = &colWeight;
235  }
236 
237  assert(weight->size() == base.coDim());
238  assert(coWeight->size() == base.dim());
239 
240  setupWeights(base);
241 
242  SPxBasis::Desc desc(base);
243  // desc.reSize(base.nRows(), base.nCols());
244 
245  DataArray < SPxId > pref(base.nRows() + base.nCols());
246  initPrefs(pref, base, rowWeight, colWeight);
247 
248  int i;
249  int stepi;
250  int j;
251  int sel;
252 
253  for(i = 0; i < base.dim(); ++i)
254  forbidden[i] = 0;
255 
256  if(base.rep() == SPxSolver::COLUMN)
257  {
258  // in COLUMN rep we scan from beginning to end
259  i = 0;
260  stepi = 1;
261  }
262  else
263  {
264  // in ROW rep we scan from end to beginning
265  i = pref.size() - 1;
266  stepi = -1;
267  }
268 
269  int dim = base.dim();
270  Real maxEntry = 0;
271 
272  for(; i >= 0 && i < pref.size(); i += stepi)
273  {
274  tmpId = pref[i];
275  const SVector& vec = base.vector(tmpId);
276  sel = -1;
277 
278  // column or row singleton ?
279  if(vec.size() == 1)
280  {
281  int idx = vec.index(0);
282 
283  if(forbidden[idx] < 2)
284  {
285  sel = idx;
286  dim += (forbidden[idx] > 0) ? 1 : 0;
287  }
288  }
289  else
290  {
291  maxEntry = vec.maxAbs();
292 
293  // initialize the nonzero counter
294  int minRowEntries = base.nRows();
295 
296  // find a stable index with a sparse row/column
297  for(j = vec.size(); --j >= 0;)
298  {
299  Real x = vec.value(j);
300  int k = vec.index(j);
301  int nRowEntries = base.coVector(k).size();
302 
303  if(!forbidden[k] && (spxAbs(x) > STABLE * maxEntry) && (nRowEntries < minRowEntries))
304  {
305  minRowEntries = nRowEntries;
306  sel = k;
307  }
308  }
309  }
310 
311  // we found a valid index
312  if(sel >= 0)
313  {
314  MSG_DEBUG(
315 
316  if(pref[i].type() == SPxId::ROW_ID)
317  std::cout << "DWEIST01 r" << base.number(pref[i]);
318  else
319  std::cout << "DWEIST02 c" << base.number(pref[i]);
320  )
321 
322  forbidden[sel] = 2;
323 
324  // put current column/row into basis
325  if(base.rep() == SPxSolver::COLUMN)
326  setDualStatus(desc, base, pref[i]);
327  else
328  setPrimalStatus(desc, base, pref[i]);
329 
330  for(j = vec.size(); --j >= 0;)
331  {
332  Real x = vec.value(j);
333  int k = vec.index(j);
334 
335  if(!forbidden[k] && (x > EPS * maxEntry || -x > EPS * maxEntry))
336  {
337  forbidden[k] = 1;
338  --dim;
339  }
340  }
341 
342  if(--dim == 0)
343  {
344  //@ for(++i; i < pref.size(); ++i)
345  if(base.rep() == SPxSolver::COLUMN)
346  {
347  // set all remaining indeces to nonbasic status
348  for(i += stepi; i >= 0 && i < pref.size(); i += stepi)
349  setPrimalStatus(desc, base, pref[i]);
350 
351  // fill up the basis wherever linear independence is assured
352  for(i = forbidden.size(); --i >= 0;)
353  {
354  if(forbidden[i] < 2)
355  setDualStatus(desc, base, base.coId(i));
356  }
357  }
358  else
359  {
360  for(i += stepi; i >= 0 && i < pref.size(); i += stepi)
361  setDualStatus(desc, base, pref[i]);
362 
363  for(i = forbidden.size(); --i >= 0;)
364  {
365  if(forbidden[i] < 2)
366  setPrimalStatus(desc, base, base.coId(i));
367  }
368  }
369 
370  break;
371  }
372  }
373  // sel == -1
374  else if(base.rep() == SPxSolver::COLUMN)
375  setPrimalStatus(desc, base, pref[i]);
376  else
377  setDualStatus(desc, base, pref[i]);
378 
379 #ifndef NDEBUG
380  {
381  int n, m;
382 
383  for(n = 0, m = forbidden.size(); n < forbidden.size(); ++n)
384  m -= (forbidden[n] != 0) ? 1 : 0;
385 
386  assert(m == dim);
387  }
388 #endif // NDEBUG
389  }
390 
391  assert(dim == 0);
392 
393  base.loadBasis(desc);
394 #ifdef TEST
395  base.init();
396 
397  int changed = 0;
398  const Vector& pvec = base.pVec();
399 
400  for(i = pvec.dim() - 1; i >= 0; --i)
401  {
403  && base.lower(i) > -infinity && pvec[i] > base.maxObj(i))
404  {
405  changed = 1;
407  }
408  else if(desc.colStatus(i) == SPxBasis::Desc::P_ON_LOWER
409  && base.upper(i) < infinity && pvec[i] < base.maxObj(i))
410  {
411  changed = 1;
413  }
414  }
415 
416  if(changed)
417  {
418  std::cout << "changed basis\n";
419  base.loadBasis(desc);
420  }
421  else
422  std::cout << "nothing changed\n";
423 
424 #endif // TEST
425 }
426 
427 // ----------------------------------------------------------------
428 
429 /* Computation of Weights
430  */
432 {
433  const Vector& obj = base.maxObj();
434  const Vector& low = base.lower();
435  const Vector& up = base.upper();
436  const Vector& rhs = base.rhs();
437  const Vector& lhs = base.lhs();
438  int i;
439 
440  Real eps = base.epsilon();
441  Real maxabs = 1.0;
442 
443  // find absolut biggest entry in bounds and left-/right hand side
444  for(i = 0; i < base.nCols(); i++)
445  {
446  if((up[i] < infinity) && (spxAbs(up[i]) > maxabs))
447  maxabs = spxAbs(up[i]);
448 
449  if((low[i] > -infinity) && (spxAbs(low[i]) > maxabs))
450  maxabs = spxAbs(low[i]);
451  }
452 
453  for(i = 0; i < base.nRows(); i++)
454  {
455  if((rhs[i] < infinity) && (spxAbs(rhs[i]) > maxabs))
456  maxabs = spxAbs(rhs[i]);
457 
458  if((lhs[i] > -infinity) && (spxAbs(lhs[i]) > maxabs))
459  maxabs = spxAbs(lhs[i]);
460  }
461 
462  /**@todo The comments are wrong. The first is for dual simplex and
463  * the secound for primal one. Is anything else wrong?
464  * Also the values are nearly the same for both cases.
465  * Should this be ? Changed the values for
466  * r_fixed to 0 because of maros-r7. It is not clear why
467  * this makes a difference because all constraints in that
468  * instance are of equality type.
469  * Why is rowRight sometimes not set?
470  */
471  if(base.rep() * base.type() > 0) // primal simplex
472  {
473  const Real ax = 1e-3 / obj.maxAbs();
474  const Real bx = 1.0 / maxabs;
475  const Real nne = ax / base.nRows(); // 1e-4 * ax;
476  const Real c_fixed = 1e+5;
477  const Real r_fixed = 0; // TK20010103: was 1e+4 (maros-r7)
478  const Real c_dbl_bounded = 1e+1;
479  const Real r_dbl_bounded = 0;
480  const Real c_bounded = 1e+1;
481  const Real r_bounded = 0;
482  const Real c_free = -1e+4;
483  const Real r_free = -1e+5;
484 
485  for(i = base.nCols() - 1; i >= 0; i--)
486  {
487  Real n = nne * (base.colVector(i).size() - 1); // very small value that is zero for col singletons
488  Real x = ax * obj[i]; // this is at most 1e-3, probably a lot smaller
489  Real u = bx * up [i]; // this is at most 1, probably a lot smaller
490  Real l = bx * low[i]; // this is at most 1, probably a lot smaller
491 
492  if(up[i] < infinity)
493  {
494  if(spxAbs(low[i] - up[i]) < eps)
495  colWeight[i] = c_fixed + n + spxAbs(x);
496  else if(low[i] > -infinity)
497  {
498  colWeight[i] = c_dbl_bounded + l - u + n;
499 
500  l = spxAbs(l);
501  u = spxAbs(u);
502 
503  if(u < l)
504  {
505  colUp[i] = true;
506  colWeight[i] += x;
507  }
508  else
509  {
510  colUp[i] = false;
511  colWeight[i] -= x;
512  }
513  }
514  else
515  {
516  colWeight[i] = c_bounded - u + x + n;
517  colUp[i] = true;
518  }
519  }
520  else
521  {
522  if(low[i] > -infinity)
523  {
524  colWeight[i] = c_bounded + l + n - x;
525  colUp[i] = false;
526  }
527  else
528  {
529  colWeight[i] = c_free + n - spxAbs(x);
530  }
531  }
532  }
533 
534  for(i = base.nRows() - 1; i >= 0; i--)
535  {
536  if(rhs[i] < infinity)
537  {
538  if(spxAbs(lhs[i] - rhs[i]) < eps)
539  {
540  rowWeight[i] = r_fixed;
541  }
542  else if(lhs[i] > -infinity)
543  {
544  Real u = bx * rhs[i];
545  Real l = bx * lhs[i];
546 
547  rowWeight[i] = r_dbl_bounded + l - u;
548  rowRight[i] = spxAbs(u) < spxAbs(l);
549  }
550  else
551  {
552  rowWeight[i] = r_bounded - bx * rhs[i];
553  rowRight[i] = true;
554  }
555  }
556  else
557  {
558  if(lhs[i] > -infinity)
559  {
560  rowWeight[i] = r_bounded + bx * lhs[i];
561  rowRight[i] = false;
562  }
563  else
564  {
565  rowWeight[i] = r_free;
566  }
567  }
568  }
569  }
570  else
571  {
572  assert(base.rep() * base.type() < 0); // dual simplex
573 
574  const Real ax = 1.0 / obj.maxAbs();
575  const Real bx = 1e-2 / maxabs;
576  const Real nne = 1e-4 * bx;
577  const Real c_fixed = 1e+5;
578  const Real r_fixed = 1e+4;
579  const Real c_dbl_bounded = 1;
580  const Real r_dbl_bounded = 0;
581  const Real c_bounded = 0;
582  const Real r_bounded = 0;
583  const Real c_free = -1e+4;
584  const Real r_free = -1e+5;
585 
586  for(i = base.nCols() - 1; i >= 0; i--)
587  {
588  Real n = nne * (base.colVector(i).size() - 1);
589  Real x = ax * obj[i];
590  Real u = bx * up [i];
591  Real l = bx * low[i];
592 
593  if(up[i] < infinity)
594  {
595  if(spxAbs(low[i] - up[i]) < eps)
596  colWeight[i] = c_fixed + n + spxAbs(x);
597  else if(low[i] > -infinity)
598  {
599  if(x > 0)
600  {
601  colWeight[i] = c_dbl_bounded + x - u + n;
602  colUp[i] = true;
603  }
604  else
605  {
606  colWeight[i] = c_dbl_bounded - x + l + n;
607  colUp[i] = false;
608  }
609  }
610  else
611  {
612  colWeight[i] = c_bounded - u + x + n;
613  colUp[i] = true;
614  }
615  }
616  else
617  {
618  if(low[i] > -infinity)
619  {
620  colWeight[i] = c_bounded - x + l + n;
621  colUp[i] = false;
622  }
623  else
624  colWeight[i] = c_free + n - spxAbs(x);
625  }
626  }
627 
628  for(i = base.nRows() - 1; i >= 0; i--)
629  {
630  const Real len1 = 1; // (base.rowVector(i).length() + base.epsilon());
631  Real n = 0; // nne * (base.rowVector(i).size() - 1);
632  Real u = bx * len1 * rhs[i];
633  Real l = bx * len1 * lhs[i];
634  Real x = ax * len1 * (obj * base.rowVector(i));
635 
636  if(rhs[i] < infinity)
637  {
638  if(spxAbs(lhs[i] - rhs[i]) < eps)
639  rowWeight[i] = r_fixed + n + spxAbs(x);
640  else if(lhs[i] > -infinity)
641  {
642  if(x > 0)
643  {
644  rowWeight[i] = r_dbl_bounded + x - u + n;
645  rowRight[i] = true;
646  }
647  else
648  {
649  rowWeight[i] = r_dbl_bounded - x + l + n;
650  rowRight[i] = false;
651  }
652  }
653  else
654  {
655  rowWeight[i] = r_bounded - u + n + x;
656  rowRight[i] = true;
657  }
658  }
659  else
660  {
661  if(lhs[i] > -infinity)
662  {
663  rowWeight[i] = r_bounded + l + n - x;
664  rowRight[i] = false;
665  }
666  else
667  {
668  rowWeight[i] = r_free + n - spxAbs(x);
669  }
670  }
671  }
672  }
673 
674  MSG_DEBUG(
675  {
676  for(i = 0; i < base.nCols(); i++)
677  std::cout << "C i= " << i
678  << " up= " << colUp[i]
679  << " w= " << colWeight[i]
680  << std::endl;
681  for(i = 0; i < base.nRows(); i++)
682  std::cout << "R i= " << i
683  << " rr= " << rowRight[i]
684  << " w= " << rowWeight[i]
685  << std::endl;
686  })
687 }
688 } // namespace soplex
const VectorBase< R > & rhs() const
Returns right hand side vector.
Definition: spxlpbase.h:221
Rational spxAbs(const Rational &r)
Absolute.
Definition: rational.cpp:4102
SPxId coId(int i) const
id of i &#39;th covector.
Definition: spxsolver.h:1117
DataArray< Real > * weight
Definition: spxweightst.h:66
SPxRowId rId(int n) const
Returns the row identifier for row n.
Definition: spxlpbase.h:567
Safe arrays of data objects.Class DataArray provides safe arrays of Data Objects. For general C++ obj...
Definition: dataarray.h:63
bool isConsistent() const
consistency check
Definition: dataarray.h:298
const SVector & coVector(int i) const
i &#39;th covector of LP.
Definition: spxsolver.h:1201
primal variable is fixed to both bounds
Definition: spxbasis.h:190
const VectorBase< R > & upper() const
Returns upper bound vector.
Definition: spxlpbase.h:461
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
R maxAbs() const
Maximum absolute value, i.e., infinity norm.
Definition: svectorbase.h:475
static void initPrefs(DataArray< SPxId > &pref, const SPxSolver &base, const DataArray< Real > &rowWeight, const DataArray< Real > &colWeight)
int size() const
Number of used indices.
Definition: svectorbase.h:153
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:527
int dim() const
dimension of basis matrix.
Definition: spxsolver.h:1075
R & value(int n)
Reference to value of n &#39;th nonzero.
Definition: svectorbase.h:253
Ids for LP columns.Class SPxColId provides DataKeys for the column indices of an SPxLP.
Definition: spxid.h:36
Compare class for row weights, used for sorting.
Desc::Status dualRowStatus(int i) const
dual Status for the i&#39;th row variable of the loaded LP.
Definition: spxbasis.cpp:46
DataArray< Real > rowWeight
weight value for LP rows.
Definition: spxweightst.h:84
SPxColId cId(int n) const
Returns the column identifier for column n.
Definition: spxlpbase.h:573
virtual void setupWeights(SPxSolver &base)
sets up variable weights.
int nRows() const
Returns number of rows in LP.
Definition: spxlpbase.h:152
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
double Real
Definition: spxdefines.h:218
#define MSG_DEBUG(x)
Definition: spxdefines.h:132
int & index(int n)
Reference to index of n &#39;th nonzero.
Definition: svectorbase.h:235
#define EPS
Definition: spxweightst.cpp:28
void generate(SPxSolver &base)
generates start basis for loaded basis.
const T * get_const_ptr() const
get a const C pointer to the data.
Definition: dataarray.h:115
primal variable is left free, but unset
Definition: spxbasis.h:189
const VectorBase< R > & lhs() const
Returns left hand side vector.
Definition: spxlpbase.h:255
Basis descriptor.
Definition: spxbasis.h:104
void SPxQuicksort(T *keys, int end, COMPARATOR &compare, int start=0, bool type=true)
Generic QuickSort implementation.
Definition: sorter.h:74
row identifier.
Definition: spxid.h:97
Status & colStatus(int i)
Definition: spxbasis.h:254
Generic QuickSort implementation.
Real epsilon() const
values are considered to be 0.
Definition: spxsolver.h:784
Debugging, floating point type and parameter definitions.
virtual void loadBasis(const SPxBasis::Desc &)
set a start basis.
Definition: spxsolver.cpp:98
Sequential object-oriented SimPlex.SPxSolver is an LP solver class using the revised Simplex algorith...
Definition: spxsolver.h:85
UpdateVector & pVec() const
pricing vector.
Definition: spxsolver.h:1478
Real operator()(int i1, int i2) const
compares the weights
int dim() const
Dimension of vector.
Definition: vectorbase.h:217
Everything should be within this namespace.
Weighted start basis.
primal variable is set to its lower bound
Definition: spxbasis.h:187
const VectorBase< R > & maxObj() const
Returns objective vector for maximization problem.
Definition: spxlpbase.h:434
const SVectorBase< R > & rowVector(int i) const
Gets row vector of row i.
Definition: spxlpbase.h:206
const Real * weight
the weights to compare
int size() const
return nr. of elements.
Definition: dataarray.h:214
Type type() const
return current Type.
Definition: spxsolver.h:512
int coDim() const
codimension.
Definition: spxsolver.h:1080
Set of sparse vectors.
const SVectorBase< R > & colVector(int i) const
Returns column vector of column i.
Definition: spxlpbase.h:377
int nCols() const
Returns number of columns in LP.
Definition: spxlpbase.h:158
virtual void init()
intialize data structures.
Definition: spxsolver.cpp:319
DataArray< Real > * coWeight
Definition: spxweightst.h:68
Ids for LP rows.Class SPxRowId provides DataKeys for the row indices of an SPxLP. ...
Definition: spxid.h:55
const SVector & vector(int i) const
i &#39;th vector.
Definition: spxsolver.h:1157
static void setDualStatus(SPxBasis::Desc &desc, const SPxSolver &base, const SPxId &id)
R maxAbs() const
Maximum absolute value, i.e., infinity norm.
Definition: vectorbase.h:357
DataArray< Real > colWeight
weight value for LP columns.
Definition: spxweightst.h:86
const SPxBasis & basis() const
Return current basis.
Definition: spxsolver.h:1761
DataArray< int > forbidden
Definition: spxweightst.h:64
Compare()
constructor
void setPrimalStatus(SPxBasis::Desc &, const SPxSolver &, const SPxId &)
Definition: spxweightst.cpp:62
void reSize(int newsize)
reset size to newsize.
Definition: dataarray.h:226
#define STABLE
Definition: spxweightst.cpp:29
const VectorBase< R > & lower() const
Returns (internal and possibly scaled) lower bound vector.
Definition: spxlpbase.h:488
DataArray< bool > colUp
set primal variable to upper bound.
Definition: spxweightst.h:90
virtual bool isConsistent() const
consistency check.
Definition: spxweightst.cpp:31
Representation rep() const
return the current basis representation.
Definition: spxsolver.h:506
columnwise representation.
Definition: spxsolver.h:108
DataArray< bool > rowRight
set variable to rhs?.
Definition: spxweightst.h:88