src/lemon/lp_glpk.h
changeset 1323 3aaadfb7de3d
parent 1312 48f9299b390d
child 1326 85f1c483279e
equal deleted inserted replaced
1:77104b2c0fc1 2:97355d406f8d
    30 
    30 
    31   /// \brief Wrapper for GLPK solver
    31   /// \brief Wrapper for GLPK solver
    32   /// 
    32   /// 
    33   /// This class implements a lemon wrapper for GLPK.
    33   /// This class implements a lemon wrapper for GLPK.
    34   class LpGlpk : public LpSolverBase {
    34   class LpGlpk : public LpSolverBase {
    35 
    35   protected:
       
    36     LPX* lp;
       
    37     
    36   public:
    38   public:
    37 
    39     
    38     typedef LpSolverBase Parent;
    40     typedef LpSolverBase Parent;
    39     
    41     
    40     /// \e
    42     LpGlpk();
    41     LPX* lp;
    43     ~LpGlpk();
    42 
    44     
    43     /// \e
       
    44     LpGlpk() : Parent(), 
       
    45 			lp(lpx_create_prob()) {
       
    46       lpx_set_int_parm(lp, LPX_K_DUAL, 1);
       
    47     }
       
    48     /// \e
       
    49     ~LpGlpk() {
       
    50       lpx_delete_prob(lp);
       
    51     }
       
    52 
       
    53   protected:
    45   protected:
    54     virtual int _addCol();
    46     virtual int _addCol();
    55     virtual int _addRow();
    47     virtual int _addRow();
    56     virtual void _setRowCoeffs(int i, 
    48     virtual void _setRowCoeffs(int i, 
    57 			       int length,
    49 			       int length,
    66     virtual void _setRowLowerBound(int i, Value value);
    58     virtual void _setRowLowerBound(int i, Value value);
    67     virtual void _setRowUpperBound(int i, Value value);
    59     virtual void _setRowUpperBound(int i, Value value);
    68     virtual void _setObjCoeff(int i, Value obj_coef);
    60     virtual void _setObjCoeff(int i, Value obj_coef);
    69     ///\e
    61     ///\e
    70     
    62     
    71     ///\bug Unimplemented
    63     ///\todo It should be clarified
    72     ///
    64     ///
    73     virtual SolveExitStatus _solve();
    65     virtual SolveExitStatus _solve();
    74     ///\e
       
    75     
       
    76     ///\bug Unimplemented
       
    77     ///
       
    78     virtual Value _getPrimal(int i);
    66     virtual Value _getPrimal(int i);
    79     ///\e
       
    80     
       
    81     ///\bug Unimplemented
       
    82     ///
       
    83     virtual Value _getPrimalValue();
    67     virtual Value _getPrimalValue();
    84     ///\e
    68     ///\e
    85     
    69     
    86     ///\bug Unimplemented
    70     ///\todo It should be clarified
    87     ///
    71     ///
    88     virtual SolutionStatus _getPrimalStatus();
    72     virtual SolutionStatus _getPrimalStatus();
       
    73     virtual void _setMax();
       
    74     virtual void _setMin();
    89 
    75 
    90     ///\e
    76   public:
       
    77     ///Set the verbosity of the messages
       
    78 
       
    79     ///\param m is the level of the messages output by the solver routines.
       
    80     ///The possible values are:
       
    81     ///- 0 --- no output (default value)
       
    82     ///- 1 --- error messages only
       
    83     ///- 2 --- normal output
       
    84     ///- 3 --- full output (includes informational messages)
       
    85     void messageLevel(int m);
    91     
    86     
    92     ///\bug Unimplemented
       
    93     ///
       
    94     virtual void _setMax();
       
    95     ///\e
       
    96     
       
    97     ///\bug Unimplemented
       
    98     ///
       
    99     virtual void _setMin();
       
   100   
       
   101   };
    87   };
   102 } //END OF NAMESPACE LEMON
    88 } //END OF NAMESPACE LEMON
   103 
    89 
   104 #endif //LEMON_LP_GLPK_H
    90 #endif //LEMON_LP_GLPK_H
   105 
    91