The pair of setSomeThing function is getSomeThing.
2 #ifndef LEMON_LP_SOLVER_WRAPPER_H
3 #define LEMON_LP_SOLVER_WRAPPER_H
7 ///\brief Dijkstra algorithm.
27 //#include <lemon/list_graph.h>
28 #include <lemon/invalid.h>
29 #include <expression.h>
30 //#include <bfs_dfs.h>
32 //#include <lemon/max_flow.h>
33 //#include <augmenting_flow.h>
34 //#include <iter_map.h>
45 /// \brief A partitioned vector with iterable classes.
47 /// This class implements a container in which the data is stored in an
48 /// stl vector, the range is partitioned into sets and each set is
49 /// doubly linked in a list.
50 /// That is, each class is iterable by lemon iterators, and any member of
51 /// the vector can bo moved to an other class.
53 class IterablePartition {
57 int prev; //invalid az -1
60 std::vector<Node> nodes;
65 std::vector<Tip> tips;
67 /// The classes are indexed by integers from \c 0 to \c classNum()-1.
68 int classNum() const { return tips.size(); }
69 /// This lemon style iterator iterates through a class.
71 /// Constructor. The number of classes is to be given which is fixed
72 /// over the life of the container.
73 /// The partition classes are indexed from 0 to class_num-1.
74 IterablePartition(int class_num) {
75 for (int i=0; i<class_num; ++i) {
82 void befuz(ClassIt it, int class_id) {
83 if (tips[class_id].first==-1) {
84 if (tips[class_id].last==-1) {
85 nodes[it.i].prev=nodes[it.i].next=-1;
86 tips[class_id].first=tips[class_id].last=it.i;
89 nodes[it.i].prev=tips[class_id].last;
91 nodes[tips[class_id].last].next=it.i;
92 tips[class_id].last=it.i;
95 void kifuz(ClassIt it, int class_id) {
96 if (tips[class_id].first==it.i) {
97 if (tips[class_id].last==it.i) {
98 tips[class_id].first=tips[class_id].last=-1;
100 tips[class_id].first=nodes[it.i].next;
101 nodes[nodes[it.i].next].prev=-1;
104 if (tips[class_id].last==it.i) {
105 tips[class_id].last=nodes[it.i].prev;
106 nodes[nodes[it.i].prev].next=-1;
108 nodes[nodes[it.i].next].prev=nodes[it.i].prev;
109 nodes[nodes[it.i].prev].next=nodes[it.i].next;
114 /// A new element with data \c t is pushed into the vector and into class
116 ClassIt push_back(const T& t, int class_id) {
120 int i=nodes.size()-1;
124 /// A member is moved to an other class.
125 void set(ClassIt it, int old_class_id, int new_class_id) {
126 kifuz(it.i, old_class_id);
127 befuz(it.i, new_class_id);
129 /// Returns the data pointed by \c it.
130 T& operator[](ClassIt it) { return nodes[it.i].data; }
131 /// Returns the data pointed by \c it.
132 const T& operator[](ClassIt it) const { return nodes[it.i].data; }
135 friend class IterablePartition;
139 /// Default constructor.
141 /// This constructor constructs an iterator which points
142 /// to the member of th container indexed by the integer _i.
143 ClassIt(const int& _i) : i(_i) { }
144 /// Invalid constructor.
145 ClassIt(const Invalid&) : i(-1) { }
146 friend bool operator<(const ClassIt& x, const ClassIt& y);
147 friend std::ostream& operator<<(std::ostream& os,
150 friend bool operator<(const ClassIt& x, const ClassIt& y) {
153 friend std::ostream& operator<<(std::ostream& os,
158 /// First member of class \c class_id.
159 ClassIt& first(ClassIt& it, int class_id) const {
160 it.i=tips[class_id].first;
164 ClassIt& next(ClassIt& it) const {
165 it.i=nodes[it.i].next;
168 /// True iff the iterator is valid.
169 bool valid(const ClassIt& it) const { return it.i!=-1; }
174 \todo kellenene uj iterable structure bele, mert ez nem az igazi
175 \todo A[x,y]-t cserel. Jobboldal, baloldal csere.
176 \todo LEKERDEZESEK!!!
177 \todo DOKSI!!!! Doxygen group!!!
178 The aim of this class is to give a general surface to different
179 solvers, i.e. it makes possible to write algorithms using LP's,
180 in which the solver can be changed to an other one easily.
183 template <typename _Value>
186 /*! @name Uncategorized functions and types (public members)
194 typedef _Value Value;
196 typedef IterablePartition<int>::ClassIt RowIt;
198 typedef IterablePartition<int>::ClassIt ColIt;
201 IterablePartition<int> row_iter_map;
203 IterablePartition<int> col_iter_map;
205 std::vector<RowIt> int_row_map;
207 std::vector<ColIt> int_col_map;
209 const int VALID_CLASS;
211 const int INVALID_CLASS;
213 static const _Value INF;
216 LPSolverBase() : row_iter_map(2),
218 VALID_CLASS(0), INVALID_CLASS(1) { }
220 virtual ~LPSolverBase() { }
223 /*! @name Medium level interface (public members)
224 These functions appear in the low level and also in the high level
225 interfaces thus these each of these functions have to be implemented
226 only once in the different interfaces.
227 This means that these functions have to be reimplemented for all of the
228 different lp solvers. These are basic functions, and have the same
229 parameter lists in the low and high level interfaces.
234 //UNCATEGORIZED FUNCTIONS
237 virtual void setMinimize() = 0;
239 virtual void setMaximize() = 0;
244 virtual void solveSimplex() = 0;
246 virtual void solvePrimalSimplex() = 0;
248 virtual void solveDualSimplex() = 0;
251 //SOLUTION RETRIEVING
254 virtual _Value getObjVal() = 0;
259 virtual int rowNum() const = 0;
261 virtual int colNum() const = 0;
263 virtual int warmUp() = 0;
265 virtual void printWarmUpStatus(int i) = 0;
267 virtual int getPrimalStatus() = 0;
269 virtual void printPrimalStatus(int i) = 0;
271 virtual int getDualStatus() = 0;
273 virtual void printDualStatus(int i) = 0;
274 /// Returns the status of the slack variable assigned to row \c row_it.
275 virtual int getRowStat(const RowIt& row_it) = 0;
277 virtual void printRowStatus(int i) = 0;
278 /// Returns the status of the variable assigned to column \c col_it.
279 virtual int getColStat(const ColIt& col_it) = 0;
281 virtual void printColStatus(int i) = 0;
285 /*! @name Low level interface (protected members)
286 Problem manipulating functions in the low level interface
291 //MATRIX MANIPULATING FUNCTIONS
294 virtual int _addCol() = 0;
296 virtual int _addRow() = 0;
298 virtual void _eraseCol(int i) = 0;
300 virtual void _eraseRow(int i) = 0;
302 virtual void _setRowCoeffs(int i,
303 const std::vector<std::pair<int, _Value> >& coeffs) = 0;
305 /// This routine modifies \c coeffs only by the \c push_back method.
306 virtual void _getRowCoeffs(int i,
307 std::vector<std::pair<int, _Value> >& coeffs) = 0;
308 virtual void _setColCoeffs(int i,
309 const std::vector<std::pair<int, _Value> >& coeffs) = 0;
311 /// This routine modifies \c coeffs only by the \c push_back method.
312 virtual void _getColCoeffs(int i,
313 std::vector<std::pair<int, _Value> >& coeffs) = 0;
316 enum Bound { FREE, LOWER, UPPER, DOUBLE, FIXED };
319 /// The lower bound of a variable (column) have to be given by an
320 /// extended number of type _Value, i.e. a finite number of type
322 virtual void _setColLowerBound(int i, _Value value) = 0;
324 /// The lower bound of a variable (column) is an
325 /// extended number of type _Value, i.e. a finite number of type
327 virtual _Value _getColLowerBound(int i) = 0;
329 /// The upper bound of a variable (column) have to be given by an
330 /// extended number of type _Value, i.e. a finite number of type
332 virtual void _setColUpperBound(int i, _Value value) = 0;
334 /// The upper bound of a variable (column) is an
335 /// extended number of type _Value, i.e. a finite number of type
337 virtual _Value _getColUpperBound(int i) = 0;
339 /// The lower bound of a linear expression (row) have to be given by an
340 /// extended number of type _Value, i.e. a finite number of type
342 virtual void _setRowLowerBound(int i, _Value value) = 0;
344 /// The lower bound of a linear expression (row) is an
345 /// extended number of type _Value, i.e. a finite number of type
347 virtual _Value _getRowLowerBound(int i) = 0;
349 /// The upper bound of a linear expression (row) have to be given by an
350 /// extended number of type _Value, i.e. a finite number of type
352 virtual void _setRowUpperBound(int i, _Value value) = 0;
354 /// The upper bound of a linear expression (row) is an
355 /// extended number of type _Value, i.e. a finite number of type
357 virtual _Value _getRowUpperBound(int i) = 0;
359 virtual void _setObjCoef(int i, _Value obj_coef) = 0;
361 virtual _Value _getObjCoef(int i) = 0;
363 //SOLUTION RETRIEVING
366 virtual _Value _getPrimal(int i) = 0;
369 /*! @name High level interface (public members)
370 Problem manipulating functions in the high level interface
375 //MATRIX MANIPULATING FUNCTIONS
381 col_iter_map.first(col_it, INVALID_CLASS);
382 if (col_iter_map.valid(col_it)) { //van hasznalhato hely
383 col_iter_map.set(col_it, INVALID_CLASS, VALID_CLASS);
384 col_iter_map[col_it]=i;
385 } else { //a cucc vegere kell inzertalni mert nincs szabad hely
386 col_it=col_iter_map.push_back(i, VALID_CLASS);
388 int_col_map.push_back(col_it);
395 row_iter_map.first(row_it, INVALID_CLASS);
396 if (row_iter_map.valid(row_it)) { //van hasznalhato hely
397 row_iter_map.set(row_it, INVALID_CLASS, VALID_CLASS);
398 row_iter_map[row_it]=i;
399 } else { //a cucc vegere kell inzertalni mert nincs szabad hely
400 row_it=row_iter_map.push_back(i, VALID_CLASS);
402 int_row_map.push_back(row_it);
406 void eraseCol(const ColIt& col_it) {
407 col_iter_map.set(col_it, VALID_CLASS, INVALID_CLASS);
409 cols[1]=col_iter_map[col_it];
411 col_iter_map[col_it]=0; //glpk specifikus, de kell ez??
413 for (col_iter_map.first(it, VALID_CLASS);
414 col_iter_map.valid(it); col_iter_map.next(it)) {
415 if (col_iter_map[it]>cols[1]) --col_iter_map[it];
417 int_col_map.erase(int_col_map.begin()+cols[1]);
420 void eraseRow(const RowIt& row_it) {
421 row_iter_map.set(row_it, VALID_CLASS, INVALID_CLASS);
423 rows[1]=row_iter_map[row_it];
425 row_iter_map[row_it]=0; //glpk specifikus, de kell ez??
427 for (row_iter_map.first(it, VALID_CLASS);
428 row_iter_map.valid(it); row_iter_map.next(it)) {
429 if (row_iter_map[it]>rows[1]) --row_iter_map[it];
431 int_row_map.erase(int_row_map.begin()+rows[1]);
434 template <typename Begin, typename End>
435 void setRowCoeffs(RowIt row_it, Begin begin, End end) {
436 std::vector<std::pair<int, double> > coeffs;
437 for ( ; begin!=end; ++begin) {
438 coeffs.push_back(std::
439 make_pair(col_iter_map[begin->first], begin->second));
441 _setRowCoeffs(row_iter_map[row_it], coeffs);
444 template <typename Begin, typename End>
445 void setColCoeffs(ColIt col_it, Begin begin, End end) {
446 std::vector<std::pair<int, double> > coeffs;
447 for ( ; begin!=end; ++begin) {
448 coeffs.push_back(std::
449 make_pair(row_iter_map[begin->first], begin->second));
451 _setColCoeffs(col_iter_map[col_it], coeffs);
454 void setColLowerBound(ColIt col_it, _Value lo) {
455 _setColLowerBound(col_iter_map[col_it], lo);
458 _Value getColLowerBound(ColIt col_it) {
459 return _getColLowerBound(col_iter_map[col_it]);
462 void setColUpperBound(ColIt col_it, _Value up) {
463 _setColUpperBound(col_iter_map[col_it], up);
466 _Value getColUpperBound(ColIt col_it) {
467 return _getColUpperBound(col_iter_map[col_it]);
470 void setRowLowerBound(RowIt row_it, _Value lo) {
471 _setRowLowerBound(row_iter_map[row_it], lo);
474 _Value getRowLowerBound(RowIt row_it) {
475 return _getRowLowerBound(row_iter_map[row_it]);
478 void setRowUpperBound(RowIt row_it, _Value up) {
479 _setRowUpperBound(row_iter_map[row_it], up);
482 _Value getRowUpperBound(RowIt row_it) {
483 return _getRowUpperBound(row_iter_map[row_it]);
486 void setObjCoef(const ColIt& col_it, _Value obj_coef) {
487 _setObjCoef(col_iter_map[col_it], obj_coef);
490 _Value getObjCoef(const ColIt& col_it) {
491 return _getObjCoef(col_iter_map[col_it]);
494 //SOLUTION RETRIEVING FUNCTIONS
497 _Value getPrimal(const ColIt& col_it) {
498 return _getPrimal(col_iter_map[col_it]);
503 /*! @name User friend interface
504 Problem manipulating functions in the user friend interface
511 typedef Expr<ColIt, _Value> Expression;
513 typedef Expr<RowIt, _Value> DualExpression;
515 //MATRIX MANIPULATING FUNCTIONS
518 void setRowCoeffs(RowIt row_it, const Expression& expr) {
519 std::vector<std::pair<int, _Value> > row_coeffs;
520 for(typename Expression::Data::const_iterator i=expr.data.begin();
521 i!=expr.data.end(); ++i) {
522 row_coeffs.push_back(std::make_pair
523 (col_iter_map[(*i).first], (*i).second));
525 _setRowCoeffs(row_iter_map[row_it], row_coeffs);
528 /// This routine modifies \c expr by only adding to it.
529 void getRowCoeffs(RowIt row_it, Expression& expr) {
530 std::vector<std::pair<int, _Value> > row_coeffs;
531 _getRowCoeffs(row_iter_map[row_it], row_coeffs);
532 for(typename std::vector<std::pair<int, _Value> >::const_iterator
533 i=row_coeffs.begin(); i!=row_coeffs.end(); ++i) {
534 expr+= (*i).second*int_col_map[(*i).first];
538 void setColCoeffs(ColIt col_it, const DualExpression& expr) {
539 std::vector<std::pair<int, _Value> > col_coeffs;
540 for(typename DualExpression::Data::const_iterator i=expr.data.begin();
541 i!=expr.data.end(); ++i) {
542 col_coeffs.push_back(std::make_pair
543 (row_iter_map[(*i).first], (*i).second));
545 _setColCoeffs(col_iter_map[col_it], col_coeffs);
548 /// This routine modifies \c expr by only adding to it.
549 void getColCoeffs(ColIt col_it, DualExpression& expr) {
550 std::vector<std::pair<int, _Value> > col_coeffs;
551 _getColCoeffs(col_iter_map[col_it], col_coeffs);
552 for(typename std::vector<std::pair<int, _Value> >::const_iterator
553 i=col_coeffs.begin(); i!=col_coeffs.end(); ++i) {
554 expr+= (*i).second*int_row_map[(*i).first];
558 /// \bug ez igy nem jo
559 void setObjCoeffs(const Expression& expr) {
560 for(typename Expression::Data::const_iterator i=expr.data.begin();
561 i!=expr.data.end(); ++i) {
562 setObjCoef((*i).first, (*i).second);
566 /// This routine modifies \c expr by only adding to it.
567 void getObjCoeffs(Expression& expr) {
568 /// FIXME not yet implemented
573 template <typename _Value>
574 const _Value LPSolverBase<_Value>::INF=std::numeric_limits<_Value>::infinity();
577 /// \brief Wrapper for GLPK solver
579 /// This class implements a lemon wrapper for GLPK.
580 class LPGLPK : public LPSolverBase<double> {
582 typedef LPSolverBase<double> Parent;
591 lp(lpx_create_prob()) {
592 int_row_map.push_back(RowIt());
593 int_col_map.push_back(ColIt());
594 lpx_set_int_parm(lp, LPX_K_DUAL, 1);
601 //MATRIX INDEPEDENT MANIPULATING FUNCTIONS
605 lpx_set_obj_dir(lp, LPX_MIN);
609 lpx_set_obj_dir(lp, LPX_MAX);
612 //LOW LEVEL INTERFACE, MATRIX MANIPULATING FUNCTIONS
617 int i=lpx_add_cols(lp, 1);
618 _setColLowerBound(i, -INF);
619 _setColUpperBound(i, INF);
624 int i=lpx_add_rows(lp, 1);
628 virtual void _setRowCoeffs(int i,
629 const std::vector<std::pair<int, double> >& coeffs) {
630 int mem_length=1+colNum();
631 int* indices = new int[mem_length];
632 double* doubles = new double[mem_length];
634 for (std::vector<std::pair<int, double> >::
635 const_iterator it=coeffs.begin(); it!=coeffs.end(); ++it) {
637 indices[length]=it->first;
638 doubles[length]=it->second;
640 lpx_set_mat_row(lp, i, length, indices, doubles);
645 virtual void _getRowCoeffs(int i,
646 std::vector<std::pair<int, double> >& coeffs) {
647 int mem_length=1+colNum();
648 int* indices = new int[mem_length];
649 double* doubles = new double[mem_length];
650 int length=lpx_get_mat_row(lp, i, indices, doubles);
651 for (int i=1; i<=length; ++i) {
652 coeffs.push_back(std::make_pair(indices[i], doubles[i]));
658 virtual void _setColCoeffs(int i,
659 const std::vector<std::pair<int, double> >& coeffs) {
660 int mem_length=1+rowNum();
661 int* indices = new int[mem_length];
662 double* doubles = new double[mem_length];
664 for (std::vector<std::pair<int, double> >::
665 const_iterator it=coeffs.begin(); it!=coeffs.end(); ++it) {
667 indices[length]=it->first;
668 doubles[length]=it->second;
670 lpx_set_mat_col(lp, i, length, indices, doubles);
675 virtual void _getColCoeffs(int i,
676 std::vector<std::pair<int, double> >& coeffs) {
677 int mem_length=1+rowNum();
678 int* indices = new int[mem_length];
679 double* doubles = new double[mem_length];
680 int length=lpx_get_mat_col(lp, i, indices, doubles);
681 for (int i=1; i<=length; ++i) {
682 coeffs.push_back(std::make_pair(indices[i], doubles[i]));
688 virtual void _eraseCol(int i) {
691 lpx_del_cols(lp, 1, cols);
693 virtual void _eraseRow(int i) {
696 lpx_del_rows(lp, 1, rows);
698 virtual void _setColLowerBound(int i, double lo) {
702 int b=lpx_get_col_type(lp, i);
703 double up=lpx_get_col_ub(lp, i);
708 lpx_set_col_bnds(lp, i, LPX_FR, lo, up);
714 lpx_set_col_bnds(lp, i, LPX_UP, lo, up);
723 lpx_set_col_bnds(lp, i, LPX_LO, lo, up);
729 lpx_set_col_bnds(lp, i, LPX_FX, lo, up);
731 lpx_set_col_bnds(lp, i, LPX_DB, lo, up);
738 virtual double _getColLowerBound(int i) {
739 int b=lpx_get_col_type(lp, i);
744 return lpx_get_col_lb(lp, i);
749 return lpx_get_col_lb(lp, i);
755 virtual void _setColUpperBound(int i, double up) {
759 int b=lpx_get_col_type(lp, i);
760 double lo=lpx_get_col_lb(lp, i);
767 lpx_set_col_bnds(lp, i, LPX_FR, lo, up);
771 lpx_set_col_bnds(lp, i, LPX_LO, lo, up);
779 lpx_set_col_bnds(lp, i, LPX_UP, lo, up);
782 lpx_set_col_bnds(lp, i, LPX_FX, lo, up);
784 lpx_set_col_bnds(lp, i, LPX_DB, lo, up);
787 lpx_set_col_bnds(lp, i, LPX_UP, lo, up);
792 lpx_set_col_bnds(lp, i, LPX_FX, lo, up);
794 lpx_set_col_bnds(lp, i, LPX_DB, lo, up);
801 virtual double _getColUpperBound(int i) {
802 int b=lpx_get_col_type(lp, i);
810 return lpx_get_col_ub(lp, i);
816 virtual void _setRowLowerBound(int i, double lo) {
820 int b=lpx_get_row_type(lp, i);
821 double up=lpx_get_row_ub(lp, i);
826 lpx_set_row_bnds(lp, i, LPX_FR, lo, up);
832 lpx_set_row_bnds(lp, i, LPX_UP, lo, up);
841 lpx_set_row_bnds(lp, i, LPX_LO, lo, up);
847 lpx_set_row_bnds(lp, i, LPX_FX, lo, up);
849 lpx_set_row_bnds(lp, i, LPX_DB, lo, up);
856 virtual double _getRowLowerBound(int i) {
857 int b=lpx_get_row_type(lp, i);
862 return lpx_get_row_lb(lp, i);
867 return lpx_get_row_lb(lp, i);
873 virtual void _setRowUpperBound(int i, double up) {
877 int b=lpx_get_row_type(lp, i);
878 double lo=lpx_get_row_lb(lp, i);
885 lpx_set_row_bnds(lp, i, LPX_FR, lo, up);
889 lpx_set_row_bnds(lp, i, LPX_LO, lo, up);
897 lpx_set_row_bnds(lp, i, LPX_UP, lo, up);
900 lpx_set_row_bnds(lp, i, LPX_FX, lo, up);
902 lpx_set_row_bnds(lp, i, LPX_DB, lo, up);
905 lpx_set_row_bnds(lp, i, LPX_UP, lo, up);
910 lpx_set_row_bnds(lp, i, LPX_FX, lo, up);
912 lpx_set_row_bnds(lp, i, LPX_DB, lo, up);
919 virtual double _getRowUpperBound(int i) {
920 int b=lpx_get_row_type(lp, i);
928 return lpx_get_row_ub(lp, i);
935 virtual double _getObjCoef(int i) {
936 return lpx_get_obj_coef(lp, i);
939 virtual void _setObjCoef(int i, double obj_coef) {
940 lpx_set_obj_coef(lp, i, obj_coef);
944 void solveSimplex() { lpx_simplex(lp); }
946 void solvePrimalSimplex() { lpx_simplex(lp); }
948 void solveDualSimplex() { lpx_simplex(lp); }
951 virtual double _getPrimal(int i) {
952 return lpx_get_col_prim(lp, i);
956 double getObjVal() { return lpx_get_obj_val(lp); }
958 int rowNum() const { return lpx_get_num_rows(lp); }
960 int colNum() const { return lpx_get_num_cols(lp); }
962 int warmUp() { return lpx_warm_up(lp); }
964 void printWarmUpStatus(int i) {
966 case LPX_E_OK: cout << "LPX_E_OK" << endl; break;
967 case LPX_E_EMPTY: cout << "LPX_E_EMPTY" << endl; break;
968 case LPX_E_BADB: cout << "LPX_E_BADB" << endl; break;
969 case LPX_E_SING: cout << "LPX_E_SING" << endl; break;
973 int getPrimalStatus() { return lpx_get_prim_stat(lp); }
975 void printPrimalStatus(int i) {
977 case LPX_P_UNDEF: cout << "LPX_P_UNDEF" << endl; break;
978 case LPX_P_FEAS: cout << "LPX_P_FEAS" << endl; break;
979 case LPX_P_INFEAS: cout << "LPX_P_INFEAS" << endl; break;
980 case LPX_P_NOFEAS: cout << "LPX_P_NOFEAS" << endl; break;
984 int getDualStatus() { return lpx_get_dual_stat(lp); }
986 void printDualStatus(int i) {
988 case LPX_D_UNDEF: cout << "LPX_D_UNDEF" << endl; break;
989 case LPX_D_FEAS: cout << "LPX_D_FEAS" << endl; break;
990 case LPX_D_INFEAS: cout << "LPX_D_INFEAS" << endl; break;
991 case LPX_D_NOFEAS: cout << "LPX_D_NOFEAS" << endl; break;
994 /// Returns the status of the slack variable assigned to row \c row_it.
995 int getRowStat(const RowIt& row_it) {
996 return lpx_get_row_stat(lp, row_iter_map[row_it]);
999 void printRowStatus(int i) {
1001 case LPX_BS: cout << "LPX_BS" << endl; break;
1002 case LPX_NL: cout << "LPX_NL" << endl; break;
1003 case LPX_NU: cout << "LPX_NU" << endl; break;
1004 case LPX_NF: cout << "LPX_NF" << endl; break;
1005 case LPX_NS: cout << "LPX_NS" << endl; break;
1008 /// Returns the status of the variable assigned to column \c col_it.
1009 int getColStat(const ColIt& col_it) {
1010 return lpx_get_col_stat(lp, col_iter_map[col_it]);
1013 void printColStatus(int i) {
1015 case LPX_BS: cout << "LPX_BS" << endl; break;
1016 case LPX_NL: cout << "LPX_NL" << endl; break;
1017 case LPX_NU: cout << "LPX_NU" << endl; break;
1018 case LPX_NF: cout << "LPX_NF" << endl; break;
1019 case LPX_NS: cout << "LPX_NS" << endl; break;
1028 #endif //LEMON_LP_SOLVER_WRAPPER_H