COIN-OR::LEMON - Graph Library

Changeset 542:fc6c7aab4b8d in lemon-1.2 for lemon


Ignore:
Timestamp:
03/04/09 14:43:05 (15 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Parents:
541:89e29e22d479 (diff), 538:ba124394367a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Phase:
public
Message:

Merge

Location:
lemon
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • lemon/glpk.cc

    r538 r542  
    541541  }
    542542
    543   GlpkLp* GlpkLp::_newSolver() const { return new GlpkLp; }
    544   GlpkLp* GlpkLp::_cloneSolver() const { return new GlpkLp(*this); }
     543  GlpkLp* GlpkLp::newSolver() const { return new GlpkLp; }
     544  GlpkLp* GlpkLp::cloneSolver() const { return new GlpkLp(*this); }
    545545
    546546  const char* GlpkLp::_solverName() const { return "GlpkLp"; }
     
    947947  }
    948948
    949   GlpkMip* GlpkMip::_newSolver() const { return new GlpkMip; }
    950   GlpkMip* GlpkMip::_cloneSolver() const {return new GlpkMip(*this); }
     949  GlpkMip* GlpkMip::newSolver() const { return new GlpkMip; }
     950  GlpkMip* GlpkMip::cloneSolver() const {return new GlpkMip(*this); }
    951951
    952952  const char* GlpkMip::_solverName() const { return "GlpkMip"; }
  • lemon/glpk.cc

    r540 r542  
    522522    cols.clear();
    523523  }
     524
     525  void GlpkBase::freeEnv() {
     526    glp_free_env();
     527  }
     528
     529  GlpkBase::FreeEnvHelper GlpkBase::freeEnvHelper;
    524530
    525531  // GlpkLp members
  • lemon/glpk.h

    r538 r542  
    132132  /// This class implements an interface for the GLPK LP solver.
    133133  ///\ingroup lp_group
    134   class GlpkLp : public GlpkBase, public LpSolver {
     134  class GlpkLp : public LpSolver, public GlpkBase {
    135135  public:
    136136
     
    139139    ///\e
    140140    GlpkLp(const GlpkLp&);
     141
     142    ///\e
     143    virtual GlpkLp* cloneSolver() const;
     144    ///\e
     145    virtual GlpkLp* newSolver() const;
    141146
    142147  private:
     
    148153
    149154  protected:
    150 
    151     virtual GlpkLp* _cloneSolver() const;
    152     virtual GlpkLp* _newSolver() const;
    153155
    154156    virtual const char* _solverName() const;
     
    166168    virtual Value _getDualRay(int i) const;
    167169
    168     ///\todo It should be clarified
    169     ///
    170170    virtual ProblemType _getPrimalType() const;
    171171    virtual ProblemType _getDualType() const;
     
    216216  /// This class implements an interface for the GLPK MIP solver.
    217217  ///\ingroup lp_group
    218   class GlpkMip : public GlpkBase, public MipSolver {
     218  class GlpkMip : public MipSolver, public GlpkBase {
    219219  public:
    220220
     
    224224    GlpkMip(const GlpkMip&);
    225225
    226   protected:
    227 
    228     virtual GlpkMip* _cloneSolver() const;
    229     virtual GlpkMip* _newSolver() const;
     226    virtual GlpkMip* cloneSolver() const;
     227    virtual GlpkMip* newSolver() const;
     228
     229  protected:
    230230
    231231    virtual const char* _solverName() const;
  • lemon/glpk.h

    r541 r542  
    101101    virtual void _clear();
    102102
     103  private:
     104
     105    static void freeEnv();
     106
     107    struct FreeEnvHelper {
     108      ~FreeEnvHelper() {
     109        freeEnv();
     110      }
     111    };
     112   
     113    static FreeEnvHelper freeEnvHelper;
     114   
    103115  public:
    104116
Note: See TracChangeset for help on using the changeset viewer.