COIN-OR::LEMON - Graph Library

Changeset 2144:cd8897f67c26 in lemon-0.x


Ignore:
Timestamp:
07/17/06 11:00:21 (13 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2858
Message:

MIP support added (by Jano, the Great).

Files:
3 added
5 edited

Legend:

Unmodified
Added
Removed
  • lemon/Makefile.am

    r2126 r2144  
    2020if HAVE_GLPK
    2121lemon_libemon_la_SOURCES += lemon/lp_glpk.cc
     22lemon_libemon_la_SOURCES += lemon/mip_glpk.cc
    2223endif
    2324
  • lemon/lp.h

    r1956 r2144  
    2424#ifdef HAVE_GLPK
    2525#include <lemon/lp_glpk.h>
     26#include <lemon/mip_glpk.h>
    2627#elif HAVE_CPLEX
    2728#include <lemon/lp_cplex.h>
     
    5556  ///Currently, the possible values are "GLPK" or "CPLEX"
    5657  const char default_solver_name[]="SOLVER"; 
     58
     59  ///The default ILP solver.
     60
     61  ///The default ILP solver.
     62  ///\ingroup gen_opt_group
     63  ///
     64  ///Currently, it is either \c LpGlpk or \c LpCplex
     65  typedef MipGlpk Mip;
    5766#else
    5867#ifdef HAVE_GLPK
    5968#define DEFAULT_LP GLPK
    6069  typedef LpGlpk Lp;
     70  typedef MipGlpk Mip;
    6171  const char default_solver_name[]="GLPK";
    6272#elif HAVE_CPLEX
  • lemon/lp_base.h

    r2085 r2144  
    176176      int id;
    177177      friend class LpSolverBase;
     178      friend class MipSolverBase;
    178179    public:
    179180      typedef Value ExprValue;
     
    11571158  }; 
    11581159
    1159   ///\e
     1160
     1161  ///Common base class for ILP solvers
     1162  ///\todo Much more docs
     1163  ///\ingroup gen_opt_group
     1164  class MipSolverBase : virtual public LpSolverBase{
     1165  public:
     1166
     1167    ///Set the type of the given Col to integer or remove that property.
     1168    ///
     1169    ///Set the type of the given Col to integer or remove that property.
     1170    void integer(Col c, bool enable) {
     1171      _integer(cols.floatingId(c.id),enable);
     1172    }
     1173
     1174    ///Gives back the type of the column.
     1175    ///
     1176    ///Gives back the type of the column.
     1177    ///\return true if the column has integer type and false if not.
     1178    bool integer(Col c){
     1179      return _integer(cols.floatingId(c.id));
     1180    }
     1181
     1182  protected:
     1183
     1184    virtual bool _integer(int col) = 0;
     1185    virtual void _integer(int col, bool enable) = 0;
     1186  };
    11601187 
    11611188  ///\relates LpSolverBase::Expr
  • lemon/lp_glpk.h

    r1956 r2144  
    3636  /// This class implements an interface for the GLPK LP solver.
    3737  ///\ingroup gen_opt_group
    38   class LpGlpk : public LpSolverBase {
     38  class LpGlpk : virtual public LpSolverBase {
    3939  protected:
    4040    LPX* lp;
  • test/Makefile.am

    r2119 r2144  
    2929        test/max_matching_test \
    3030        test/min_cost_flow_test \
     31        test/mip_test \
    3132        test/path_test \
    3233        test/polynomial_test \
     
    7172test_max_matching_test_SOURCES = test/max_matching_test.cc
    7273test_min_cost_flow_test_SOURCES = test/min_cost_flow_test.cc
     74test_mip_test_SOURCES = test/mip_test.cc
    7375test_path_test_SOURCES = test/path_test.cc
    7476test_polynomial_test_SOURCES = test/polynomial_test.cc
Note: See TracChangeset for help on using the changeset viewer.