COIN-OR::LEMON - Graph Library

source: lemon-0.x/lemon/lp_glpk.cc

Last change on this file was 2622:fa2877651022, checked in by Balazs Dezso, 12 years ago

Fix _setCoeff

File size: 14.9 KB
RevLine 
[1261]1/* -*- C++ -*-
2 *
[1956]3 * This file is a part of LEMON, a generic C++ optimization library
4 *
[2553]5 * Copyright (C) 2003-2008
[1956]6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
[1359]7 * (Egervary Research Group on Combinatorial Optimization, EGRES).
[1261]8 *
9 * Permission to use, modify and distribute this software is granted
10 * provided that this copyright notice appears in all copies. For
11 * precise terms see the accompanying LICENSE file.
12 *
13 * This software is provided "AS IS" with no warranty of any kind,
14 * express or implied, and with no claim as to its suitability for any
15 * purpose.
16 *
17 */
18
19///\file
20///\brief Implementation of the LEMON-GLPK lp solver interface.
21
[1305]22#include <lemon/lp_glpk.h>
[1473]23//#include <iostream>
[2441]24
25#if GLP_MAJOR_VERSION > 4 || (GLP_MAJOR_VERSION == 4 && GLP_MINOR_VERSION > 15)
26#define LEMON_glp(func) (glp_##func)
27#define LEMON_lpx(func) (lpx_##func)
28
29#define LEMON_GLP(def) (GLP_##def)
30#define LEMON_LPX(def) (LPX_##def)
31
32#else
33
34#define LEMON_glp(func) (lpx_##func)
35#define LEMON_lpx(func) (lpx_##func)
36
37#define LEMON_GLP(def) (LPX_##def)
38#define LEMON_LPX(def) (LPX_##def)
39
40#endif
41
[1261]42namespace lemon {
43
[2363]44  LpGlpk::LpGlpk() : Parent() {
[2441]45    solved = false;
[2363]46    rows = _lp_bits::LpId(1);
47    cols = _lp_bits::LpId(1);
[2441]48    lp = LEMON_glp(create_prob)();
49    LEMON_glp(create_index)(lp);
50    LEMON_lpx(set_int_parm)(lp, LEMON_LPX(K_DUAL), 1);
[1321]51    messageLevel(0);
52  }
53 
[2363]54  LpGlpk::LpGlpk(const LpGlpk &glp) : Parent() {
[2441]55    solved = false;
[2363]56    rows = _lp_bits::LpId(1);
57    cols = _lp_bits::LpId(1);
[2441]58    lp = LEMON_glp(create_prob)();
59    LEMON_glp(create_index)(lp);
[2363]60    ///\todo control function for this:
[2441]61    LEMON_lpx(set_int_parm)(lp, LEMON_LPX(K_DUAL), 1);
[2321]62    messageLevel(0);
63    //Coefficient matrix, row bounds
[2441]64    LEMON_glp(add_rows)(lp, LEMON_glp(get_num_rows)(glp.lp));
65    LEMON_glp(add_cols)(lp, LEMON_glp(get_num_cols)(glp.lp));
[2321]66    int len;
[2591]67    std::vector<int> ind(1+LEMON_glp(get_num_cols)(glp.lp));
68    std::vector<Value> val(1+LEMON_glp(get_num_cols)(glp.lp));
[2441]69    for (int i=1;i<=LEMON_glp(get_num_rows)(glp.lp);++i)
[2321]70      {
[2591]71        len=LEMON_glp(get_mat_row)(glp.lp,i,&*ind.begin(),&*val.begin());
72        LEMON_glp(set_mat_row)(lp, i,len,&*ind.begin(),&*val.begin());
[2441]73        LEMON_glp(set_row_bnds)(lp,i,
74                                LEMON_glp(get_row_type)(glp.lp,i),
75                                LEMON_glp(get_row_lb)(glp.lp,i),
76                                LEMON_glp(get_row_ub)(glp.lp,i));
[2321]77      }
78
79    //Objective function, coloumn bounds
[2441]80    LEMON_glp(set_obj_dir)(lp, LEMON_glp(get_obj_dir)(glp.lp));
[2321]81    //Objectif function's constant term treated separately
[2441]82    LEMON_glp(set_obj_coef)(lp,0,LEMON_glp(get_obj_coef)(glp.lp,0));
83    for (int i=1;i<=LEMON_glp(get_num_cols)(glp.lp);++i)
[2321]84      {
[2441]85        LEMON_glp(set_obj_coef)(lp,i,
86                                LEMON_glp(get_obj_coef)(glp.lp,i));
87        LEMON_glp(set_col_bnds)(lp,i,
88                                LEMON_glp(get_col_type)(glp.lp,i),
89                                LEMON_glp(get_col_lb)(glp.lp,i),
90                                LEMON_glp(get_col_ub)(glp.lp,i));
[2321]91      }
[2605]92    rows = glp.rows;
93    cols = glp.cols;
[2321]94  }
95 
[1321]96  LpGlpk::~LpGlpk() {
[2441]97    LEMON_glp(delete_prob)(lp);
[1321]98  }
99 
100  int LpGlpk::_addCol() {
[2441]101    int i=LEMON_glp(add_cols)(lp, 1);
102    LEMON_glp(set_col_bnds)(lp, i, LEMON_GLP(FR), 0.0, 0.0);
103    solved = false;
[1321]104    return i;
105  }
106
[1436]107  ///\e
108
109
[2605]110  LpSolverBase* LpGlpk::_newLp()
[1436]111  {
[2605]112    LpGlpk* newlp = new LpGlpk;
113    return newlp;
[1436]114  }
115 
116  ///\e
117
[2605]118  LpSolverBase* LpGlpk::_copyLp()
[1436]119  {
[2605]120    LpGlpk *newlp = new LpGlpk(*this);
121    return newlp;
[1436]122  }
123
[1321]124  int LpGlpk::_addRow() {
[2441]125    int i=LEMON_glp(add_rows)(lp, 1);
126    solved = false;
[1321]127    return i;
128  }
129
130 
[1432]131  void LpGlpk::_eraseCol(int i) {
[2386]132    int ca[2];
133    ca[1]=i;
[2441]134    LEMON_glp(del_cols)(lp, 1, ca);
135    solved = false;
[1432]136  }
137 
138  void LpGlpk::_eraseRow(int i) {
[2386]139    int ra[2];
140    ra[1]=i;
[2441]141    LEMON_glp(del_rows)(lp, 1, ra);
142    solved = false;
[1432]143  }
144
[2386]145  void LpGlpk::_getColName(int c, std::string & name) const
[1895]146  {
147   
[2441]148    const char *n = LEMON_glp(get_col_name)(lp,c);
[1895]149    name = n?n:"";
150  }
151 
152 
[2386]153  void LpGlpk::_setColName(int c, const std::string & name)
[1895]154  {
[2441]155    LEMON_glp(set_col_name)(lp,c,const_cast<char*>(name.c_str()));
[2349]156
[1895]157  }
[2366]158
159  int LpGlpk::_colByName(const std::string& name) const
160  {
[2441]161    int k = LEMON_glp(find_col)(lp, const_cast<char*>(name.c_str()));
[2366]162    return k > 0 ? k : -1;
163  }
164
[1895]165 
[2364]166  void LpGlpk::_setRowCoeffs(int i, ConstRowIterator b, ConstRowIterator e)
[1321]167  {
[2312]168    std::vector<int> indices;
169    std::vector<Value> values;
170
171    indices.push_back(0);
172    values.push_back(0);
173
[2364]174    for(ConstRowIterator it=b; it!=e; ++it) {
[2312]175      indices.push_back(it->first);
176      values.push_back(it->second);
177    }
178
[2441]179    LEMON_glp(set_mat_row)(lp, i, values.size() - 1,
180                                &indices[0], &values[0]);
181
182    solved = false;
[1321]183  }
[2364]184
[2386]185  void LpGlpk::_getRowCoeffs(int ix, RowIterator b) const
[2364]186  {
[2441]187    int length = LEMON_glp(get_mat_row)(lp, ix, 0, 0);
[2364]188   
189    std::vector<int> indices(length + 1);
190    std::vector<Value> values(length + 1);
191   
[2441]192    LEMON_glp(get_mat_row)(lp, ix, &indices[0], &values[0]);
[2364]193   
194    for (int i = 1; i <= length; ++i) {
195      *b = std::make_pair(indices[i], values[i]);
196      ++b;
197    }
198  }
[1321]199 
[2386]200  void LpGlpk::_setColCoeffs(int ix, ConstColIterator b, ConstColIterator e) {
[2312]201
202    std::vector<int> indices;
203    std::vector<Value> values;
204
205    indices.push_back(0);
206    values.push_back(0);
207
[2364]208    for(ConstColIterator it=b; it!=e; ++it) {
[2312]209      indices.push_back(it->first);
210      values.push_back(it->second);
211    }
212   
[2441]213    LEMON_glp(set_mat_col)(lp, ix, values.size() - 1,
214                                &indices[0], &values[0]);
215
216    solved = false;
[1321]217  }
[1431]218
[2386]219  void LpGlpk::_getColCoeffs(int ix, ColIterator b) const
[2364]220  {
[2441]221    int length = LEMON_glp(get_mat_col)(lp, ix, 0, 0);
[2364]222   
223    std::vector<int> indices(length + 1);
224    std::vector<Value> values(length + 1);
225   
[2441]226    LEMON_glp(get_mat_col)(lp, ix, &indices[0], &values[0]);
[2364]227   
228    for (int i = 1; i <= length; ++i) {
229      *b = std::make_pair(indices[i], values[i]);
230      ++b;
231    }
232  }
[1431]233
[2386]234  void LpGlpk::_setCoeff(int ix, int jx, Value value)
[1431]235  {
[2312]236
[2441]237    if (LEMON_glp(get_num_cols)(lp) < LEMON_glp(get_num_rows)(lp)) {
[2312]238
[2441]239      int length=LEMON_glp(get_mat_row)(lp, ix, 0, 0);
[2312]240     
241      std::vector<int> indices(length + 2);
242      std::vector<Value> values(length + 2);
243     
[2441]244      LEMON_glp(get_mat_row)(lp, ix, &indices[0], &values[0]);
[2312]245     
246      //The following code does not suppose that the elements of the
247      //array indices are sorted
248      bool found=false;
249      for (int i = 1; i <= length; ++i) {
[2386]250        if (indices[i]==jx){
[2312]251          found=true;
252          values[i]=value;
253          break;
254        }
255      }
256      if (!found){
257        ++length;
[2386]258        indices[length]=jx;
[2312]259        values[length]=value;
260      }
[1431]261   
[2441]262      LEMON_glp(set_mat_row)(lp, ix, length, &indices[0], &values[0]);
[2312]263
264    } else {
265
[2441]266      int length=LEMON_glp(get_mat_col)(lp, jx, 0, 0);
[2312]267     
268      std::vector<int> indices(length + 2);
269      std::vector<Value> values(length + 2);
270     
[2441]271      LEMON_glp(get_mat_col)(lp, jx, &indices[0], &values[0]);
[2312]272     
273      //The following code does not suppose that the elements of the
274      //array indices are sorted
275      bool found=false;
276      for (int i = 1; i <= length; ++i) {
[2622]277        if (indices[i]==ix){
[2312]278          found=true;
279          values[i]=value;
280          break;
281        }
282      }
283      if (!found){
284        ++length;
[2386]285        indices[length]=ix;
[2312]286        values[length]=value;
287      }
[1431]288   
[2441]289      LEMON_glp(set_mat_col)(lp, jx, length, &indices[0], &values[0]);
[1431]290    }
[2441]291
292    solved = false;
[1431]293  }
294
[2386]295  LpGlpk::Value LpGlpk::_getCoeff(int ix, int jx) const
[2324]296  {
[2328]297
[2441]298    int length=LEMON_glp(get_mat_row)(lp, ix, 0, 0);
[2328]299   
[2364]300    std::vector<int> indices(length + 1);
301    std::vector<Value> values(length + 1);
[2328]302   
[2441]303    LEMON_glp(get_mat_row)(lp, ix, &indices[0], &values[0]);
[2328]304   
305    //The following code does not suppose that the elements of the
306    //array indices are sorted
307    for (int i = 1; i <= length; ++i) {
[2386]308      if (indices[i]==jx){
[2328]309        return values[i];
310      }
311    }
[2324]312    return 0;
[2328]313
[2324]314  }
315
316
[1321]317  void LpGlpk::_setColLowerBound(int i, Value lo)
318  {
319    if (lo==INF) {
320      //FIXME error
321    }
[2441]322    int b=LEMON_glp(get_col_type)(lp, i);
323    double up=LEMON_glp(get_col_ub)(lp, i);     
[1321]324    if (lo==-INF) {
325      switch (b) {
[2441]326      case LEMON_GLP(FR):
327      case LEMON_GLP(LO):
328        LEMON_glp(set_col_bnds)(lp, i, LEMON_GLP(FR), lo, up);
[1321]329        break;
[2441]330      case LEMON_GLP(UP):
[1321]331        break;
[2441]332      case LEMON_GLP(DB):
333      case LEMON_GLP(FX):
334        LEMON_glp(set_col_bnds)(lp, i, LEMON_GLP(UP), lo, up);
[1321]335        break;
336      default: ;
337        //FIXME error
338      }
339    } else {
340      switch (b) {
[2441]341      case LEMON_GLP(FR):
342      case LEMON_GLP(LO):
343        LEMON_glp(set_col_bnds)(lp, i, LEMON_GLP(LO), lo, up);
[1321]344        break;
[2441]345      case LEMON_GLP(UP):         
346      case LEMON_GLP(DB):
347      case LEMON_GLP(FX):
[1321]348        if (lo==up)
[2441]349          LEMON_glp(set_col_bnds)(lp, i, LEMON_GLP(FX), lo, up);
[1321]350        else
[2441]351          LEMON_glp(set_col_bnds)(lp, i, LEMON_GLP(DB), lo, up);
[1321]352        break;
353      default: ;
354        //FIXME error
355      }
[1261]356    }
357
[2441]358    solved = false;
[1321]359  }
[2328]360
[2366]361  LpGlpk::Value LpGlpk::_getColLowerBound(int i) const
[2328]362  {
[2441]363    int b=LEMON_glp(get_col_type)(lp, i);
[2328]364      switch (b) {
[2441]365      case LEMON_GLP(LO):
366      case LEMON_GLP(DB):
367      case LEMON_GLP(FX):
368        return LEMON_glp(get_col_lb)(lp, i);   
[2328]369      default: ;
370        return -INF;
371      }
372  }
[1321]373 
374  void LpGlpk::_setColUpperBound(int i, Value up)
375  {
376    if (up==-INF) {
377      //FIXME error
[1261]378    }
[2441]379    int b=LEMON_glp(get_col_type)(lp, i);
380    double lo=LEMON_glp(get_col_lb)(lp, i);
[1321]381    if (up==INF) {
382      switch (b) {
[2441]383      case LEMON_GLP(FR):
384      case LEMON_GLP(LO):
[1321]385        break;
[2441]386      case LEMON_GLP(UP):
387        LEMON_glp(set_col_bnds)(lp, i, LEMON_GLP(FR), lo, up);
[1321]388        break;
[2441]389      case LEMON_GLP(DB):
390      case LEMON_GLP(FX):
391        LEMON_glp(set_col_bnds)(lp, i, LEMON_GLP(LO), lo, up);
[1321]392        break;
393      default: ;
[1261]394        //FIXME error
395      }
[1321]396    } else {
397      switch (b) {
[2441]398      case LEMON_GLP(FR):
399        LEMON_glp(set_col_bnds)(lp, i, LEMON_GLP(UP), lo, up);
[1321]400        break;
[2441]401      case LEMON_GLP(UP):
402        LEMON_glp(set_col_bnds)(lp, i, LEMON_GLP(UP), lo, up);
[1321]403        break;
[2441]404      case LEMON_GLP(LO):
405      case LEMON_GLP(DB):
406      case LEMON_GLP(FX):
[1321]407        if (lo==up)
[2441]408          LEMON_glp(set_col_bnds)(lp, i, LEMON_GLP(FX), lo, up);
[1321]409        else
[2441]410          LEMON_glp(set_col_bnds)(lp, i, LEMON_GLP(DB), lo, up);
[1321]411        break;
412      default: ;
[1261]413        //FIXME error
414      }
[1321]415    }
[2441]416
417    solved = false;
[1321]418  }
[2328]419
[2366]420  LpGlpk::Value LpGlpk::_getColUpperBound(int i) const
[2328]421  {
[2441]422    int b=LEMON_glp(get_col_type)(lp, i);
[2328]423      switch (b) {
[2441]424      case LEMON_GLP(UP):
425      case LEMON_GLP(DB):
426      case LEMON_GLP(FX):
427        return LEMON_glp(get_col_ub)(lp, i);   
[2328]428      default: ;
429        return INF;
430      }
431  }
[1321]432 
[1379]433  void LpGlpk::_setRowBounds(int i, Value lb, Value ub)
434  {
435    //Bad parameter
436    if (lb==INF || ub==-INF) {
437      //FIXME error
438    }
439
440    if (lb == -INF){
441      if (ub == INF){
[2441]442        LEMON_glp(set_row_bnds)(lp, i, LEMON_GLP(FR), lb, ub);
[1379]443      }
444      else{
[2441]445        LEMON_glp(set_row_bnds)(lp, i, LEMON_GLP(UP), lb, ub);
[1379]446      }
447    }
448    else{
449      if (ub==INF){
[2441]450        LEMON_glp(set_row_bnds)(lp, i, LEMON_GLP(LO), lb, ub);
[1379]451
452      }
453      else{
454        if (lb == ub){
[2441]455          LEMON_glp(set_row_bnds)(lp, i, LEMON_GLP(FX), lb, ub);
[1379]456        }
457        else{
[2441]458          LEMON_glp(set_row_bnds)(lp, i, LEMON_GLP(DB), lb, ub);
[1379]459        }
460      }
461    }
462
[2441]463    solved = false;
[1379]464  }
[2328]465
[2366]466  void LpGlpk::_getRowBounds(int i, Value &lb, Value &ub) const
[2328]467  {
468
[2441]469    int b=LEMON_glp(get_row_type)(lp, i);
[2328]470    switch (b) {
[2441]471    case LEMON_GLP(FR):
472    case LEMON_GLP(UP):
[2328]473      lb = -INF;
474        break;
475    default:
[2441]476      lb=LEMON_glp(get_row_lb)(lp, i);
[2328]477    }
478
479    switch (b) {
[2441]480    case LEMON_GLP(FR):
481    case LEMON_GLP(LO):
[2328]482      ub = INF;
483        break;
484    default:
[2441]485      ub=LEMON_glp(get_row_ub)(lp, i);
[2328]486    }
487   
488  }
[1261]489 
[1298]490  void LpGlpk::_setObjCoeff(int i, Value obj_coef)
491  {
[1376]492    //i=0 means the constant term (shift)
[2441]493    LEMON_glp(set_obj_coef)(lp, i, obj_coef);
494
495    solved = false;
[1298]496  }
[1261]497
[2366]498  LpGlpk::Value LpGlpk::_getObjCoeff(int i) const {
[2324]499    //i=0 means the constant term (shift)
[2441]500    return LEMON_glp(get_obj_coef)(lp, i);
[2324]501  }
502
[1377]503  void LpGlpk::_clearObj()
[1376]504  {
[2441]505    for (int i=0;i<=LEMON_glp(get_num_cols)(lp);++i){
506      LEMON_glp(set_obj_coef)(lp, i, 0);
[1376]507    }
[2441]508
509    solved = false;
[1376]510  }
[1263]511
[1303]512  LpGlpk::SolveExitStatus LpGlpk::_solve()
[1263]513  {
[2345]514    // A way to check the problem to be solved
[2441]515    //LEMON_glp(write_cpxlp(lp,"naittvan.cpx");   
[2345]516
[2441]517    LEMON_lpx(std_basis)(lp);
518    int i =  LEMON_lpx(simplex)(lp);
[2363]519   
[1298]520    switch (i) {
[2441]521    case LEMON_LPX(E_OK):
522      solved = true;
[1298]523      return SOLVED;
524    default:
525      return UNSOLVED;
526    }
[1263]527  }
528
[2366]529  LpGlpk::Value LpGlpk::_getPrimal(int i) const
[1263]530  {
[2441]531    return LEMON_glp(get_col_prim)(lp,i);
[1263]532  }
[1787]533
[2366]534  LpGlpk::Value LpGlpk::_getDual(int i) const
[1787]535  {
[2441]536    return LEMON_glp(get_row_dual)(lp,i);
[1787]537  }
[1263]538 
[2366]539  LpGlpk::Value LpGlpk::_getPrimalValue() const
[1312]540  {
[2441]541    return LEMON_glp(get_obj_val)(lp);
[1312]542  }
[2366]543  bool LpGlpk::_isBasicCol(int i) const
544  {
[2441]545    return (LEMON_glp(get_col_stat)(lp, i)==LEMON_GLP(BS));
[1840]546  }
[1312]547 
[1298]548 
[2366]549  LpGlpk::SolutionStatus LpGlpk::_getPrimalStatus() const
[1294]550  {
[2441]551    if (!solved) return UNDEFINED;
552    int stat=  LEMON_lpx(get_status)(lp);
[1298]553    switch (stat) {
[2441]554    case LEMON_LPX(UNDEF)://Undefined (no solve has been run yet)
[1298]555      return UNDEFINED;
[2441]556    case LEMON_LPX(NOFEAS)://There is no feasible solution (primal, I guess)
557    case LEMON_LPX(INFEAS)://Infeasible
[1458]558      return INFEASIBLE;
[2441]559    case LEMON_LPX(UNBND)://Unbounded
[1458]560      return INFINITE;
[2441]561    case LEMON_LPX(FEAS)://Feasible
[1458]562      return FEASIBLE;
[2441]563    case LEMON_LPX(OPT)://Feasible
[1458]564      return OPTIMAL;
565    default:
566      return UNDEFINED; //to avoid gcc warning
567      //FIXME error
568    }
569  }
570
[2366]571  LpGlpk::SolutionStatus LpGlpk::_getDualStatus() const
[1458]572  {
[2441]573    if (!solved) return UNDEFINED;
574    switch (LEMON_lpx(get_dual_stat)(lp)) {
575    case LEMON_LPX(D_UNDEF)://Undefined (no solve has been run yet)
[1458]576      return UNDEFINED;
[2441]577    case LEMON_LPX(D_NOFEAS)://There is no dual feasible solution
578//    case LEMON_LPX(D_INFEAS://Infeasible
[1458]579      return INFEASIBLE;
[2441]580    case LEMON_LPX(D_FEAS)://Feasible   
581      switch (LEMON_lpx(get_status)(lp)) {
582      case LEMON_LPX(NOFEAS):
[1458]583        return INFINITE;
[2441]584      case LEMON_LPX(OPT):
[1458]585        return OPTIMAL;
586      default:
587        return FEASIBLE;
588      }
589    default:
590      return UNDEFINED; //to avoid gcc warning
591      //FIXME error
592    }
593  }
594
[2366]595  LpGlpk::ProblemTypes LpGlpk::_getProblemType() const
[1458]596  {
[2441]597    if (!solved) return UNKNOWN;
598      //int stat=  LEMON_glp(get_status(lp);
599    int statp=  LEMON_lpx(get_prim_stat)(lp);
600    int statd=  LEMON_lpx(get_dual_stat)(lp);
601    if (statp==LEMON_LPX(P_FEAS) && statd==LEMON_LPX(D_FEAS))
[1460]602        return PRIMAL_DUAL_FEASIBLE;
[2441]603    if (statp==LEMON_LPX(P_FEAS) && statd==LEMON_LPX(D_NOFEAS))
[1460]604        return PRIMAL_FEASIBLE_DUAL_INFEASIBLE;
[2441]605    if (statp==LEMON_LPX(P_NOFEAS) && statd==LEMON_LPX(D_FEAS))
[1460]606        return PRIMAL_INFEASIBLE_DUAL_FEASIBLE;
[2441]607    if (statp==LEMON_LPX(P_NOFEAS) && statd==LEMON_LPX(D_NOFEAS))
[1460]608        return PRIMAL_DUAL_INFEASIBLE;
609    //In all other cases
610    return UNKNOWN;
[1294]611  }
[1263]612
[1312]613  void LpGlpk::_setMax()
614  {
[2441]615    solved = false;
616    LEMON_glp(set_obj_dir)(lp, LEMON_GLP(MAX));
[1321]617  }
618
[1312]619  void LpGlpk::_setMin()
620  {
[2441]621    solved = false;
622    LEMON_glp(set_obj_dir)(lp, LEMON_GLP(MIN));
[1321]623  }
624
[2366]625  bool LpGlpk::_isMax() const
[2324]626  {
[2441]627    return (LEMON_glp(get_obj_dir)(lp)==LEMON_GLP(MAX));
[2324]628  }
629
[1321]630 
[2324]631
[1321]632  void LpGlpk::messageLevel(int m)
633  {
[2441]634    LEMON_lpx(set_int_parm)(lp, LEMON_LPX(K_MSGLEV), m);
[1321]635  }
[1312]636
[1326]637  void LpGlpk::presolver(bool b)
638  {
[2441]639    LEMON_lpx(set_int_parm)(lp, LEMON_LPX(K_PRESOL), b);
[1326]640  }
641
[1312]642 
[1261]643} //END OF NAMESPACE LEMON
Note: See TracBrowser for help on using the repository browser.