src/lemon/lp_cplex.h
changeset 1396 56f9a4ba9149
child 1398 2f21cc34a245
equal deleted inserted replaced
-1:000000000000 0:e0a39bd984f8
       
     1 /* -*- C++ -*-
       
     2  * src/lemon/lp_cplex.h - Part of LEMON, a generic C++ optimization library
       
     3  *
       
     4  * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
       
     5  * (Egervary Research Group on Combinatorial Optimization, EGRES).
       
     6  *
       
     7  * Permission to use, modify and distribute this software is granted
       
     8  * provided that this copyright notice appears in all copies. For
       
     9  * precise terms see the accompanying LICENSE file.
       
    10  *
       
    11  * This software is provided "AS IS" with no warranty of any kind,
       
    12  * express or implied, and with no claim as to its suitability for any
       
    13  * purpose.
       
    14  *
       
    15  */
       
    16 
       
    17 #ifndef LEMON_LP_CPLEX_H
       
    18 #define LEMON_LP_CPLEX_H
       
    19 
       
    20 ///\file
       
    21 ///\brief Header of the LEMON-CPLEX lp solver interface.
       
    22 
       
    23 #include <lemon/lp_base.h>
       
    24 extern "C" {
       
    25 #include <ilcplex/cplex.h>
       
    26 }
       
    27 
       
    28 namespace lemon {
       
    29 
       
    30 
       
    31   /// \brief Wrapper for GLPK solver
       
    32   /// 
       
    33   /// This class implements a lemon wrapper for GLPK.
       
    34   class LpCplex : public LpSolverBase {
       
    35 
       
    36   public:
       
    37 
       
    38     typedef LpSolverBase Parent;
       
    39     
       
    40     /// \e
       
    41     int status;
       
    42     CPXENVptr env;
       
    43     CPXLPptr lp;
       
    44 
       
    45 
       
    46     /// \e
       
    47     LpCplex();
       
    48     /// \e
       
    49     ~LpCplex();
       
    50 
       
    51   protected:
       
    52     virtual LpSolverBase &_newLp();
       
    53     virtual LpSolverBase &_copyLp();
       
    54 
       
    55     virtual int _addCol();
       
    56     virtual int _addRow();
       
    57     virtual void _setRowCoeffs(int i, 
       
    58 			       int length,
       
    59                                const int   * indices, 
       
    60                                const Value   * values );
       
    61     virtual void _setColCoeffs(int i, 
       
    62 			       int length,
       
    63                                const int   * indices, 
       
    64                                const Value   * values);
       
    65     virtual void _setColLowerBound(int i, Value value);
       
    66     virtual void _setColUpperBound(int i, Value value);
       
    67     virtual void _setRowLowerBound(int i, Value value);
       
    68     virtual void _setRowUpperBound(int i, Value value);
       
    69     virtual void _setRowBounds(int i, Value lower, Value upper);
       
    70     virtual void _setObjCoeff(int i, Value obj_coef);
       
    71     virtual void _clearObj();
       
    72     ///\e
       
    73     
       
    74     ///\bug Unimplemented
       
    75     ///
       
    76     virtual SolveExitStatus _solve();
       
    77     ///\e
       
    78 
       
    79     ///\bug Unimplemented
       
    80     ///
       
    81     virtual Value _getPrimal(int i);
       
    82     ///\e
       
    83     
       
    84     ///\bug Unimplemented
       
    85     ///
       
    86     virtual Value _getPrimalValue();
       
    87     ///\e
       
    88     
       
    89     ///\bug Unimplemented
       
    90     ///
       
    91     virtual SolutionStatus _getPrimalStatus();
       
    92 
       
    93     ///\e
       
    94     
       
    95     ///\bug Unimplemented
       
    96     ///
       
    97     virtual void _setMax();
       
    98     ///\e
       
    99     
       
   100     ///\bug Unimplemented
       
   101     ///
       
   102     virtual void _setMin();
       
   103 
       
   104   };
       
   105 } //END OF NAMESPACE LEMON
       
   106 
       
   107 #endif //LEMON_LP_CPLEX_H
       
   108