Scippy

SoPlex

Sequential object-oriented simPlex

lpcolsetbase.h
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 /**@file lpcolsetbase.h
17  * @brief Set of LP columns.
18  */
19 #ifndef _LPCOLSETBASE_H_
20 #define _LPCOLSETBASE_H_
21 
22 #include <assert.h>
23 
24 #include "soplex/spxdefines.h"
25 #include "soplex/basevectors.h"
26 #include "soplex/datakey.h"
27 #include "soplex/lpcolbase.h"
28 
29 namespace soplex
30 {
31 /**@brief Set of LP columns.
32  * @ingroup Algebra
33  *
34  * Class LPColSetBase implements a set of \ref LPColBase "LPColBase%s". Unless for memory limitations, any number of LPColBase%s may be
35  * #add%ed to an LPColSetBase. Single or multiple LPColBase%s may be #add%ed to an LPColSetBase, where each method add() comes with
36  * two different signatures. One with and one without a parameter, used for returning the \ref DataKey "DataKeys"
37  * assigned to the new LPColBase%s by the set. See DataKey for a more detailed description of the concept of keys. For the
38  * concept of renumbering LPColBase%s within an LPColSetBase after removal of some LPColBase%s, see DataSet.
39  *
40  * @see DataSet, DataKey
41  */
42 template < class R >
43 class LPColSetBase : protected SVSetBase<R>
44 {
45  template < class S > friend class LPColSetBase;
46 
47 private:
48 
49  // ------------------------------------------------------------------------------------------------------------------
50  /**@name Data */
51  //@{
52 
53  DVectorBase<R> low; ///< vector of lower bounds.
54  DVectorBase<R> up; ///< vector of upper bounds.
55  DVectorBase<R> object; ///< vector of objective coefficients.
56 
57  //@}
58 
59 protected:
60 
61  DataArray < int > scaleExp; ///< column scaling factors (stored as bitshift)
62 
63  // ------------------------------------------------------------------------------------------------------------------
64  /**@name Protected helpers */
65  //@{
66 
67  /// Returns the complete SVSetBase.
68  const SVSetBase<R>* colSet() const
69  {
70  return this;
71  }
72 
73  //@}
74 
75 public:
76 
77  // ------------------------------------------------------------------------------------------------------------------
78  /**@name Inquiry */
79  //@{
80 
81  /// Returns the number of LPColBase%s currently in LPColSetBase.
82  int num() const
83  {
84  return SVSetBase<R>::num();
85  }
86 
87  /// Returns maximum number of LPColBase%s currently fitting into LPColSetBase.
88  int max() const
89  {
90  return SVSetBase<R>::max();
91  }
92 
93  ///
94  const VectorBase<R>& maxObj() const
95  {
96  return object;
97  }
98 
99  /// Returns vector of objective values w.r.t. maximization.
101  {
102  return object;
103  }
104 
105  ///
106  const R& maxObj(int i) const
107  {
108  return object[i];
109  }
110 
111  /// Returns objective value (w.r.t. maximization) of \p i 'th LPColBase in LPColSetBase.
112  R& maxObj_w(int i)
113  {
114  return object[i];
115  }
116 
117  ///
118  const R& maxObj(const DataKey& k) const
119  {
120  return object[number(k)];
121  }
122 
123  /// Returns objective value (w.r.t. maximization) of LPColBase with DataKey \p k in LPColSetBase.
124  R& maxObj_w(const DataKey& k)
125  {
126  return object[number(k)];
127  }
128 
129  ///
130  const VectorBase<R>& lower() const
131  {
132  return low;
133  }
134 
135  /// Returns vector of lower bound values.
137  {
138  return low;
139  }
140 
141  ///
142  const R& lower(int i) const
143  {
144  return low[i];
145  }
146 
147  /// Returns lower bound of \p i 'th LPColBase in LPColSetBase.
148  R& lower_w(int i)
149  {
150  return low[i];
151  }
152 
153  ///
154  const R& lower(const DataKey& k) const
155  {
156  return low[number(k)];
157  }
158 
159  /// Returns lower bound of LPColBase with DataKey \p k in LPColSetBase.
160  R& lower_w(const DataKey& k)
161  {
162  return low[number(k)];
163  }
164 
165  ///
166  const VectorBase<R>& upper() const
167  {
168  return up;
169  }
170 
171  /// Returns vector of upper bound values.
173  {
174  return up;
175  }
176 
177  ///
178  const R& upper(int i) const
179  {
180  return up[i];
181  }
182 
183  /// Returns upper bound of \p i 'th LPColBase in LPColSetBase.
184  R& upper_w(int i)
185  {
186  return up[i];
187  }
188 
189  ///
190  const R& upper(const DataKey& k) const
191  {
192  return up[number(k)];
193  }
194 
195  /// Returns upper bound of LPColBase with DataKey \p k in LPColSetBase.
196  R& upper_w(const DataKey& k)
197  {
198  return up[number(k)];
199  }
200 
201  ///
203  {
204  return SVSetBase<R>::operator[](i);
205  }
206 
207  /// Returns colVector of \p i 'th LPColBase in LPColSetBase.
208  const SVectorBase<R>& colVector(int i) const
209  {
210  return SVSetBase<R>::operator[](i);
211  }
212 
213  /// Returns writeable colVector of LPColBase with DataKey \p k in LPColSetBase.
215  {
216  return SVSetBase<R>::operator[](k);
217  }
218 
219  /// Returns colVector of LPColBase with DataKey \p k in LPColSetBase.
220  const SVectorBase<R>& colVector(const DataKey& k) const
221  {
222  return SVSetBase<R>::operator[](k);
223  }
224 
225  /// Returns DataKey of \p i 'th LPColBase in LPColSetBase.
226  DataKey key(int i) const
227  {
228  return SVSetBase<R>::key(i);
229  }
230 
231  /// Returns number of LPColBase with DataKey \p k in LPColSetBase.
232  int number(const DataKey& k) const
233  {
234  return SVSetBase<R>::number(k);
235  }
236 
237  /// Does DataKey \p k belong to LPColSetBase ?
238  bool has(const DataKey& k) const
239  {
240  return SVSetBase<R>::has(k);
241  }
242 
243  //@}
244 
245  // ------------------------------------------------------------------------------------------------------------------
246  /**@name Extension
247  *
248  * All extension methods come with two signatures, one of which providing a parameter to return the assigned
249  * DataKey(s). See DataSet for a more detailed description. All extension methods are designed to automatically
250  * reallocate memory if required.
251  */
252  //@{
253 
254  ///
255  void add(const LPColBase<R>& pcol)
256  {
257  DataKey k;
258  add(k, pcol);
259  }
260 
261  /// Adds p pcol to LPColSetBase.
262  void add(DataKey& pkey, const LPColBase<R>& pcol)
263  {
264  add(pkey, pcol.obj(), pcol.lower(), pcol.colVector(), pcol.upper());
265  }
266 
267  ///
268  void add(const R& pobj, const R& plower, const SVectorBase<R>& pcolVector, const R& pupper,
269  const int& pscaleExp = 0)
270  {
271  DataKey k;
272  add(k, pobj, plower, pcolVector, pupper, pscaleExp);
273  }
274 
275  /// Adds LPColBase consisting of objective value \p obj, lower bound \p lower, column vector \p colVector and upper bound \p upper to LPColSetBase.
276  void add(DataKey& newkey, const R& obj, const R& newlower, const SVectorBase<R>& newcolVector,
277  const R& newupper, const int& newscaleExp = 0)
278  {
279  SVSetBase<R>::add(newkey, newcolVector);
280 
281  if(num() > low.dim())
282  {
283  low.reDim(num());
284  up.reDim(num());
285  object.reDim(num());
286  scaleExp.reSize(num());
287  }
288 
289  low[num() - 1] = newlower;
290  up[num() - 1] = newupper;
291  object[num() - 1] = obj;
292  scaleExp[num() - 1] = newscaleExp;
293  }
294 
295  /// Adds LPColBase consisting of left hand side \p lhs, column vector \p colVector, and right hand side \p rhs to LPColSetBase.
296  template < class S >
297  void add(const S* obj, const S* lowerValue, const S* colValues, const int* colIndices, int colSize,
298  const S* upperValue)
299  {
300  DataKey k;
301  add(k, obj, lowerValue, colValues, colIndices, colSize, upperValue);
302  }
303 
304  /// Adds LPColBase consisting of left hand side \p lhs, column vector \p colVector, and right hand side \p rhs to
305  /// LPColSetBase, with DataKey \p key.
306  template < class S >
307  void add(DataKey& newkey, const S* objValue, const S* lowerValue, const S* colValues,
308  const int* colIndices, int colSize, const S* upperValue)
309  {
310  SVSetBase<R>::add(newkey, colValues, colIndices, colSize);
311 
312  if(num() > low.dim())
313  {
314  low.reDim(num());
315  up.reDim(num());
316  object.reDim(num());
317  }
318 
319  low[num() - 1] = *lowerValue;
320  up[num() - 1] = *upperValue;
321  object[num() - 1] = *objValue;
322  }
323 
324  ///
325  void add(const LPColSetBase<R>& newset)
326  {
327  int i = num();
328 
329  SVSetBase<R>::add(newset);
330 
331  if(num() > low.dim())
332  {
333  low.reDim(num());
334  up.reDim(num());
335  object.reDim(num());
336  scaleExp.reSize(num());
337  }
338 
339  for(int j = 0; i < num(); ++i, ++j)
340  {
341  low[i] = newset.lower(j);
342  up[i] = newset.upper(j);
343  object[i] = newset.maxObj(j);
344  scaleExp[i] = newset.scaleExp[j];
345  }
346  }
347 
348  /// Adds all LPColBase%s of \p set to LPColSetBase.
349  void add(DataKey keys[], const LPColSetBase<R>& newset)
350  {
351  int i = num();
352 
353  add(newset);
354 
355  for(int j = 0; i < num(); ++i, ++j)
356  keys[j] = key(i);
357  }
358 
359  /// Extends column \p n to fit \p newmax nonzeros.
360  void xtend(int n, int newmax)
361  {
362  SVSetBase<R>::xtend(colVector_w(n), newmax);
363  }
364 
365  /// Extends column with DataKey \p key to fit \p newmax nonzeros.
366  void xtend(const DataKey& pkey, int pnewmax)
367  {
368  SVSetBase<R>::xtend(colVector_w(pkey), pnewmax);
369  }
370 
371  ///
372  void add2(const DataKey& k, int n, const int idx[], const R val[])
373  {
374  SVSetBase<R>::add2(colVector_w(k), n, idx, val);
375  }
376 
377  /// Adds \p n nonzero (\p idx, \p val)-pairs to \p i 'th colVector.
378  void add2(int i, int n, const int idx[], const R val[])
379  {
380  SVSetBase<R>::add2(colVector_w(i), n, idx, val);
381  }
382 
383  /// Adds \p n nonzero (\p idx, \p val)-pairs to \p i 'th colVector.
384  template < class S >
385  void add2(int i, int n, const int idx[], const S val[])
386  {
387  SVSetBase<R>::add2(colVector_w(i), n, idx, val);
388  }
389 
390  ///
391  SVectorBase<R>& create(int pnonzeros = 0, const R& pobj = 1, const R& plw = 0, const R& pupp = 1,
392  const int& pscaleExp = 0)
393  {
394  DataKey k;
395  return create(k, pnonzeros, pobj, plw, pupp, pscaleExp);
396  }
397 
398  /// Creates new LPColBase with specified arguments and returns a reference to its column vector.
399  SVectorBase<R>& create(DataKey& newkey, int nonzeros = 0, const R& obj = 1, const R& newlow = 0,
400  const R& newup = 1, const int& newscaleExp = 0)
401  {
402  if(num() + 1 > low.dim())
403  {
404  low.reDim(num() + 1);
405  up.reDim(num() + 1);
406  object.reDim(num() + 1);
407  scaleExp.reSize(num() + 1);
408  }
409 
410  low[num()] = newlow;
411  up[num()] = newup;
412  object[num()] = obj;
413  scaleExp[num()] = newscaleExp;
414 
415  return *SVSetBase<R>::create(newkey, nonzeros);
416  }
417 
418  //@}
419 
420 
421  // ------------------------------------------------------------------------------------------------------------------
422  /**@name Shrinking
423  *
424  * See DataSet for a description of the renumbering of the remaining LPColBase%s in a LPColSetBase after the call of
425  * a removal method.
426  */
427  //@{
428 
429  /// Removes \p i 'th LPColBase.
430  void remove(int i)
431  {
433  low[i] = low[num()];
434  up[i] = up[num()];
435  object[i] = object[num()];
436  scaleExp[i] = scaleExp[num()];
437  low.reDim(num());
438  up.reDim(num());
439  object.reDim(num());
440  scaleExp.reSize(num());
441  }
442 
443  /// Removes LPColBase with DataKey \p k.
444  void remove(const DataKey& k)
445  {
446  remove(number(k));
447  }
448 
449  /// Removes multiple elements.
450  void remove(int perm[])
451  {
452  int n = num();
453 
454  SVSetBase<R>::remove(perm);
455 
456  for(int i = 0; i < n; ++i)
457  {
458  if(perm[i] >= 0 && perm[i] != i)
459  {
460  low[perm[i]] = low[i];
461  up[perm[i]] = up[i];
462  object[perm[i]] = object[i];
463  scaleExp[perm[i]] = scaleExp[i];
464  }
465  }
466 
467  low.reDim(num());
468  up.reDim(num());
469  object.reDim(num());
470  scaleExp.reSize(num());
471  }
472 
473  /// Removes LPColBase%s with numbers \p nums, where \p n is the length of the array \p nums
474  void remove(const int nums[], int n)
475  {
476  DataArray < int > perm(num());
477  remove(nums, n, perm.get_ptr());
478  }
479 
480  /// Removes LPColBase%s with numbers \p nums, where \p n is the length of the array \p nums, and stores the index permutation in array \p perm.
481  void remove(const int nums[], int n, int* perm)
482  {
483  SVSetBase<R>::remove(nums, n, perm);
484 
485  int j = num();
486 
487  for(int i = 0; i < j; ++i)
488  {
489  if(perm[i] >= 0 && perm[i] != i)
490  {
491  low[perm[i]] = low[i];
492  up[perm[i]] = up[i];
493  object[perm[i]] = object[i];
494  scaleExp[perm[i]] = scaleExp[i];
495  }
496  }
497 
498  low.reDim(num());
499  up.reDim(num());
500  object.reDim(num());
501  scaleExp.reSize(num());
502  }
503 
504  /// Removes all LPColBase%s from the set.
505  void clear()
506  {
508  low.reDim(num());
509  up.reDim(num());
510  object.reDim(num());
511  scaleExp.clear();
512  }
513 
514  //@}
515 
516  // ------------------------------------------------------------------------------------------------------------------
517  /**@name Memory Management
518  * See SVSet for a description of the memory management methods.
519  */
520  //@{
521 
522  /// Reallocates memory to be able to store \p newmax LPColBase%s.
523  void reMax(int newmax = 0)
524  {
525  SVSetBase<R>::reMax(newmax);
526  up.reSize(max());
527  low.reSize(max());
528  object.reSize(max());
529  scaleExp.reSize(max());
530  }
531 
532  /// Returns used nonzero memory.
533  int memSize() const
534  {
535  return SVSetBase<R>::memSize();
536  }
537 
538  /// Returns length of nonzero memory.
539  int memMax() const
540  {
541  return SVSetBase<R>::memMax();
542  }
543 
544  /// Resets length of nonzero memory.
545  void memRemax(int newmax)
546  {
547  SVSetBase<R>::memRemax(newmax);
548  }
549 
550  /// Garbage collection in nonzero memory.
551  void memPack()
552  {
554  }
555 
556  //@}
557 
558  // ------------------------------------------------------------------------------------------------------------------
559  /**@name Miscellaneous */
560  //@{
561 
562  /// Checks consistency.
563  bool isConsistent() const
564  {
565 #ifdef ENABLE_CONSISTENCY_CHECKS
566 
567  if(low.dim() != object.dim())
568  return MSGinconsistent("LPColSetBase");
569 
570  if(low.dim() != up.dim())
571  return MSGinconsistent("LPColSetBase");
572 
573  if(low.dim() != num())
574  return MSGinconsistent("LPColSetBase");
575 
576  return low.isConsistent() && up.isConsistent() && SVSetBase<R>::isConsistent();
577 #else
578  return true;
579 #endif
580  }
581 
582  //@}
583 
584  // ------------------------------------------------------------------------------------------------------------------
585  /**@name Constructors / Destructors */
586  //@{
587 
588  /// Default constructor.
589  /** The user can specify the initial maximum number of columns \p max and the initial maximum number of nonzero
590  * entries \p memmax. If these parameters are omitted, a default size is used. However, one can add an arbitrary
591  * number of columns to the LPColSetBase, which may result in automated memory realllocation.
592  */
593  explicit
594  LPColSetBase<R>(int pmax = -1, int pmemmax = -1)
595  : SVSetBase<R>(pmax, pmemmax), low(0), up(0), object(0), scaleExp(0)
596  {
597  assert(isConsistent());
598  }
599 
600  /// Assignment operator.
602  {
603  if(this != &rs)
604  {
606  low = rs.low;
607  up = rs.up;
608  object = rs.object;
609  scaleExp = rs.scaleExp;
610 
611  assert(isConsistent());
612  }
613 
614  return *this;
615  }
616 
617  /// Assignment operator.
618  template < class S >
620  {
621  if(this != (const LPColSetBase<R>*)(&rs))
622  {
624  low = rs.low;
625  up = rs.up;
626  object = rs.object;
627  scaleExp = rs.scaleExp;
628 
629  assert(isConsistent());
630  }
631 
632  return *this;
633  }
634 
635  /// Copy constructor.
637  : SVSetBase<R>(rs)
638  , low(rs.low)
639  , up(rs.up)
640  , object(rs.object)
641  , scaleExp(rs.scaleExp)
642  {
643  assert(isConsistent());
644  }
645 
646  /// Copy constructor.
647  template < class S >
649  : SVSetBase<R>(rs)
650  , low(rs.low)
651  , up(rs.up)
652  , object(rs.object)
653  , scaleExp(rs.scaleExp)
654  {
655  assert(isConsistent());
656  }
657 
658  /// Destructor.
659  virtual ~LPColSetBase<R>()
660  {}
661 
662  //@}
663 };
664 
665 } // namespace soplex
666 #endif // _LPCOLSETBASE_H_
SVectorBase< R > & create(int pnonzeros=0, const R &pobj=1, const R &plw=0, const R &pupp=1, const int &pscaleExp=0)
Definition: lpcolsetbase.h:391
void memRemax(int newmax)
Resets length of nonzero memory.
Definition: lpcolsetbase.h:545
void add(const S *obj, const S *lowerValue, const S *colValues, const int *colIndices, int colSize, const S *upperValue)
Adds LPColBase consisting of left hand side lhs, column vector colVector, and right hand side rhs to ...
Definition: lpcolsetbase.h:297
R & upper_w(const DataKey &k)
Returns upper bound of LPColBase with DataKey k in LPColSetBase.
Definition: lpcolsetbase.h:196
void reDim(int newdim, const bool setZero=true)
Resets DVectorBase&#39;s dimension to newdim.
Definition: dvectorbase.h:253
R & maxObj_w(const DataKey &k)
Returns objective value (w.r.t. maximization) of LPColBase with DataKey k in LPColSetBase.
Definition: lpcolsetbase.h:124
const VectorBase< R > & lower() const
Definition: lpcolsetbase.h:130
bool isConsistent() const
Consistency check.
Definition: dvectorbase.h:307
SVSetBase< R > & operator=(const SVSetBase< R > &rhs)
Assignment operator.
Definition: svsetbase.h:988
Entry identifier class for items of a DataSet.
void reMax(int newmax=0)
Resets maximum number of SVectorBases.
Definition: svsetbase.h:933
Dynamic dense vectors.Class DVectorBase is a derived class of VectorBase adding automatic memory mana...
Definition: dvectorbase.h:48
Dense vector.Class VectorBase provides dense linear algebra vectors. It does not provide memory manag...
Definition: dsvectorbase.h:28
SVectorBase< R > & colVector_w(const DataKey &k)
Returns writeable colVector of LPColBase with DataKey k in LPColSetBase.
Definition: lpcolsetbase.h:214
T * get_ptr()
get a C pointer to the data.
Definition: dataarray.h:110
DataKey key(int i) const
Returns DataKey of i &#39;th LPColBase in LPColSetBase.
Definition: lpcolsetbase.h:226
const R & lower(const DataKey &k) const
Definition: lpcolsetbase.h:154
void memPack()
Garbage collection in nonzero memory.
Definition: lpcolsetbase.h:551
int memSize() const
Returns used nonzero memory.
Definition: lpcolsetbase.h:533
int number(const DataKey &k) const
Gets vector number of DataKey.
Definition: svsetbase.h:783
void add(const LPColBase< R > &pcol)
Definition: lpcolsetbase.h:255
R obj() const
Gets objective value.
Definition: lpcolbase.h:113
void clear()
remove all elements.
Definition: dataarray.h:208
int memSize() const
Used nonzero memory.
Definition: svsetbase.h:819
SVectorBase< R > * create(int idxmax=0)
Creates new SVectorBase in set.
Definition: svsetbase.h:437
VectorBase< R > & maxObj_w()
Returns vector of objective values w.r.t. maximization.
Definition: lpcolsetbase.h:100
VectorBase< R > & lower_w()
Returns vector of lower bound values.
Definition: lpcolsetbase.h:136
const VectorBase< R > & maxObj() const
Definition: lpcolsetbase.h:94
VectorBase< R > & upper_w()
Returns vector of upper bound values.
Definition: lpcolsetbase.h:172
DataArray< int > scaleExp
column scaling factors (stored as bitshift)
Definition: lpcolsetbase.h:61
Entry identifier class for items of a DataSet.Every item in a DataSet is assigned a DataKey by which ...
Definition: datakey.h:46
DataKey key(int n) const
Gets DataKey of vector number.
Definition: svsetbase.h:771
DVectorBase< R > object
vector of objective coefficients.
Definition: lpcolsetbase.h:55
bool isConsistent() const
Checks consistency.
Definition: lpcolsetbase.h:563
R lower() const
Gets lower bound.
Definition: lpcolbase.h:137
int number(const DataKey &k) const
Returns number of LPColBase with DataKey k in LPColSetBase.
Definition: lpcolsetbase.h:232
const SVectorBase< R > & colVector() const
Gets constraint column vector.
Definition: lpcolbase.h:148
void add2(int i, int n, const int idx[], const S val[])
Adds n nonzero (idx, val)-pairs to i &#39;th colVector.
Definition: lpcolsetbase.h:385
void reSize(int newsize)
Resets DVectorBase&#39;s memory size to newsize.
Definition: dvectorbase.h:270
const R & maxObj(int i) const
Definition: lpcolsetbase.h:106
void add(const SVectorBase< R > &svec)
Adds svec to the set.
Definition: svsetbase.h:313
bool has(const DataKey &k) const
Does DataKey k belong to LPColSetBase ?
Definition: lpcolsetbase.h:238
SVectorBase< R > & colVector_w(int i)
Definition: lpcolsetbase.h:202
int memMax() const
Length of nonzero memory.
Definition: svsetbase.h:825
SVectorBase< R > & operator[](int n)
Gets SVectorBase by number, writeable.
Definition: svsetbase.h:729
R & maxObj_w(int i)
Returns objective value (w.r.t. maximization) of i &#39;th LPColBase in LPColSetBase. ...
Definition: lpcolsetbase.h:112
bool has(const DataKey &k) const
True iff SVSetBase contains a SVectorBase for DataKey k.
Definition: svsetbase.h:795
bool isConsistent() const
Consistency check.
Definition: svsetbase.h:939
const SVectorBase< R > & colVector(const DataKey &k) const
Returns colVector of LPColBase with DataKey k in LPColSetBase.
Definition: lpcolsetbase.h:220
void add(DataKey &pkey, const LPColBase< R > &pcol)
Adds p pcol to LPColSetBase.
Definition: lpcolsetbase.h:262
DVectorBase< R > up
vector of upper bounds.
Definition: lpcolsetbase.h:54
void add(DataKey &newkey, const S *objValue, const S *lowerValue, const S *colValues, const int *colIndices, int colSize, const S *upperValue)
Adds LPColBase consisting of left hand side lhs, column vector colVector, and right hand side rhs to ...
Definition: lpcolsetbase.h:307
LPColSetBase< R > & operator=(const LPColSetBase< R > &rs)
Assignment operator.
Definition: lpcolsetbase.h:601
int max() const
Returns maximum number of LPColBases currently fitting into LPColSetBase.
Definition: lpcolsetbase.h:88
void memRemax(int newmax)
Reset length of nonzero memory.
Definition: svsetbase.h:831
void memPack()
Garbage collection in nonzero memory.
Definition: svsetbase.h:883
const R & upper(int i) const
Definition: lpcolsetbase.h:178
Debugging, floating point type and parameter definitions.
void add(DataKey keys[], const LPColSetBase< R > &newset)
Adds all LPColBases of set to LPColSetBase.
Definition: lpcolsetbase.h:349
const R & maxObj(const DataKey &k) const
Definition: lpcolsetbase.h:118
Collection of dense, sparse, and semi-sparse vectors.
int dim() const
Dimension of vector.
Definition: vectorbase.h:217
Everything should be within this namespace.
void add(const LPColSetBase< R > &newset)
Definition: lpcolsetbase.h:325
const R & upper(const DataKey &k) const
Definition: lpcolsetbase.h:190
DVectorBase< R > low
vector of lower bounds.
Definition: lpcolsetbase.h:53
Set of LP columns.Class LPColSetBase implements a set of LPColBase%s. Unless for memory limitations...
Definition: lpcolsetbase.h:43
SVectorBase< R > & create(DataKey &newkey, int nonzeros=0, const R &obj=1, const R &newlow=0, const R &newup=1, const int &newscaleExp=0)
Creates new LPColBase with specified arguments and returns a reference to its column vector...
Definition: lpcolsetbase.h:399
R upper() const
Gets upper bound.
Definition: lpcolbase.h:125
const R & lower(int i) const
Definition: lpcolsetbase.h:142
int memMax() const
Returns length of nonzero memory.
Definition: lpcolsetbase.h:539
R & lower_w(const DataKey &k)
Returns lower bound of LPColBase with DataKey k in LPColSetBase.
Definition: lpcolsetbase.h:160
LPColSetBase< R > & operator=(const LPColSetBase< S > &rs)
Assignment operator.
Definition: lpcolsetbase.h:619
void xtend(const DataKey &pkey, int pnewmax)
Extends column with DataKey key to fit newmax nonzeros.
Definition: lpcolsetbase.h:366
void add2(SVectorBase< R > &svec, int idx, R val)
Adds nonzero (idx, val) to svec of this SVSetBase.
Definition: svsetbase.h:566
void xtend(int n, int newmax)
Extends column n to fit newmax nonzeros.
Definition: lpcolsetbase.h:360
const VectorBase< R > & upper() const
Definition: lpcolsetbase.h:166
LP column.
R & lower_w(int i)
Returns lower bound of i &#39;th LPColBase in LPColSetBase.
Definition: lpcolsetbase.h:148
void add(DataKey &newkey, const R &obj, const R &newlower, const SVectorBase< R > &newcolVector, const R &newupper, const int &newscaleExp=0)
Adds LPColBase consisting of objective value obj, lower bound lower, column vector colVector and uppe...
Definition: lpcolsetbase.h:276
void xtend(SVectorBase< R > &svec, int newmax)
Extends svec to fit newmax nonzeros.
Definition: svsetbase.h:484
void add(const R &pobj, const R &plower, const SVectorBase< R > &pcolVector, const R &pupper, const int &pscaleExp=0)
Definition: lpcolsetbase.h:268
R & upper_w(int i)
Returns upper bound of i &#39;th LPColBase in LPColSetBase.
Definition: lpcolsetbase.h:184
void remove(const DataKey &removekey)
Removes the vector with key removekey from the set.
Definition: svsetbase.h:606
Sparse vectors.Class SVectorBase provides packed sparse vectors. Such are a sparse vectors...
Definition: dvectorbase.h:31
void add2(int i, int n, const int idx[], const R val[])
Adds n nonzero (idx, val)-pairs to i &#39;th colVector.
Definition: lpcolsetbase.h:378
void add2(const DataKey &k, int n, const int idx[], const R val[])
Definition: lpcolsetbase.h:372
const SVSetBase< R > * colSet() const
Returns the complete SVSetBase.
Definition: lpcolsetbase.h:68
#define MSGinconsistent(name)
Definition: spxdefines.h:126
const SVectorBase< R > & colVector(int i) const
Returns colVector of i &#39;th LPColBase in LPColSetBase.
Definition: lpcolsetbase.h:208
void clear()
Removes all LPColBases from the set.
Definition: lpcolsetbase.h:505
int max() const
Current maximum number of SVectorBases.
Definition: svsetbase.h:765
void reMax(int newmax=0)
Reallocates memory to be able to store newmax LPColBases.
Definition: lpcolsetbase.h:523
void reSize(int newsize)
reset size to newsize.
Definition: dataarray.h:226
int num() const
Current number of SVectorBases.
Definition: svsetbase.h:759
int num() const
Returns the number of LPColBases currently in LPColSetBase.
Definition: lpcolsetbase.h:82
LP column.Class LPColBase provides a datatype for storing the column of an LP a the form similar to ...
Definition: lpcolbase.h:45
Sparse vector set.Class SVSetBase provides a set of sparse vectors SVectorBase. All SVectorBases in a...
Definition: ssvectorbase.h:34
void clear()
Removes all elements.
Definition: classarray.h:202