lemon/lp_skeleton.h
changeset 783 ef88c0a30f85
parent 576 745e182d0139
child 877 141f9c0db4a3
     1.1 --- a/lemon/lp_skeleton.h	Mon Jan 12 23:11:39 2009 +0100
     1.2 +++ b/lemon/lp_skeleton.h	Thu Nov 05 15:48:01 2009 +0100
     1.3 @@ -16,16 +16,22 @@
     1.4   *
     1.5   */
     1.6  
     1.7 -#ifndef LEMON_LP_SKELETON
     1.8 -#define LEMON_LP_SKELETON
     1.9 +#ifndef LEMON_LP_SKELETON_H
    1.10 +#define LEMON_LP_SKELETON_H
    1.11  
    1.12  #include <lemon/lp_base.h>
    1.13  
    1.14  ///\file
    1.15 -///\brief A skeleton file to implement LP solver interfaces
    1.16 +///\brief Skeleton file to implement LP/MIP solver interfaces
    1.17 +///  
    1.18 +///The classes in this file do nothing, but they can serve as skeletons when
    1.19 +///implementing an interface to new solvers.
    1.20  namespace lemon {
    1.21  
    1.22 -  ///A skeleton class to implement LP solver interfaces
    1.23 +  ///A skeleton class to implement LP/MIP solver base interface
    1.24 +  
    1.25 +  ///This class does nothing, but it can serve as a skeleton when
    1.26 +  ///implementing an interface to new solvers.
    1.27    class SkeletonSolverBase : public virtual LpBase {
    1.28      int col_num,row_num;
    1.29  
    1.30 @@ -39,6 +45,8 @@
    1.31      /// \e
    1.32      virtual int _addRow();
    1.33      /// \e
    1.34 +    virtual int _addRow(Value l, ExprIterator b, ExprIterator e, Value u);
    1.35 +    /// \e
    1.36      virtual void _eraseCol(int i);
    1.37      /// \e
    1.38      virtual void _eraseRow(int i);
    1.39 @@ -134,16 +142,24 @@
    1.40      ///\e
    1.41      virtual void _clear();
    1.42  
    1.43 +    ///\e
    1.44 +    virtual void _messageLevel(MessageLevel);
    1.45    };
    1.46  
    1.47 -  /// \brief Interface for a skeleton LP solver
    1.48 +  /// \brief Skeleton class for an LP solver interface
    1.49    ///
    1.50 -  /// This class implements an interface for a skeleton LP solver.
    1.51 +  ///This class does nothing, but it can serve as a skeleton when
    1.52 +  ///implementing an interface to new solvers.
    1.53 +
    1.54    ///\ingroup lp_group
    1.55 -  class LpSkeleton : public SkeletonSolverBase, public LpSolver {
    1.56 +  class LpSkeleton : public LpSolver, public SkeletonSolverBase {
    1.57    public:
    1.58 -    LpSkeleton() : SkeletonSolverBase(), LpSolver() {}
    1.59 -
    1.60 +    ///\e
    1.61 +    LpSkeleton() : LpSolver(), SkeletonSolverBase() {}
    1.62 +    ///\e
    1.63 +    virtual LpSkeleton* newSolver() const;
    1.64 +    ///\e
    1.65 +    virtual LpSkeleton* cloneSolver() const;
    1.66    protected:
    1.67  
    1.68      ///\e
    1.69 @@ -173,57 +189,41 @@
    1.70      virtual VarStatus _getRowStatus(int i) const;
    1.71  
    1.72      ///\e
    1.73 -    virtual LpSkeleton* _newSolver() const;
    1.74 -    ///\e
    1.75 -    virtual LpSkeleton* _cloneSolver() const;
    1.76 -    ///\e
    1.77      virtual const char* _solverName() const;
    1.78  
    1.79    };
    1.80  
    1.81 -  /// \brief Interface for a skeleton MIP solver
    1.82 +  /// \brief Skeleton class for a MIP solver interface
    1.83    ///
    1.84 -  /// This class implements an interface for a skeleton MIP solver.
    1.85 +  ///This class does nothing, but it can serve as a skeleton when
    1.86 +  ///implementing an interface to new solvers.
    1.87    ///\ingroup lp_group
    1.88 -  class MipSkeleton : public SkeletonSolverBase, public MipSolver {
    1.89 +  class MipSkeleton : public MipSolver, public SkeletonSolverBase {
    1.90    public:
    1.91 -    MipSkeleton() : SkeletonSolverBase(), MipSolver() {}
    1.92 +    ///\e
    1.93 +    MipSkeleton() : MipSolver(), SkeletonSolverBase() {}
    1.94 +    ///\e
    1.95 +    virtual MipSkeleton* newSolver() const;
    1.96 +    ///\e
    1.97 +    virtual MipSkeleton* cloneSolver() const;
    1.98  
    1.99    protected:
   1.100      ///\e
   1.101 -
   1.102 -    ///\bug Wrong interface
   1.103 -    ///
   1.104      virtual SolveExitStatus _solve();
   1.105  
   1.106      ///\e
   1.107 -
   1.108 -    ///\bug Wrong interface
   1.109 -    ///
   1.110      virtual Value _getSol(int i) const;
   1.111  
   1.112      ///\e
   1.113 -
   1.114 -    ///\bug Wrong interface
   1.115 -    ///
   1.116      virtual Value _getSolValue() const;
   1.117  
   1.118      ///\e
   1.119 -
   1.120 -    ///\bug Wrong interface
   1.121 -    ///
   1.122      virtual ProblemType _getType() const;
   1.123  
   1.124      ///\e
   1.125 -    virtual MipSkeleton* _newSolver() const;
   1.126 -
   1.127 -    ///\e
   1.128 -    virtual MipSkeleton* _cloneSolver() const;
   1.129 -    ///\e
   1.130      virtual const char* _solverName() const;
   1.131 -
   1.132    };
   1.133  
   1.134  } //namespace lemon
   1.135  
   1.136 -#endif // LEMON_LP_SKELETON
   1.137 +#endif