1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/lemon/lp_cplex.h Fri Apr 22 17:47:01 2005 +0000
1.3 @@ -0,0 +1,108 @@
1.4 +/* -*- C++ -*-
1.5 + * src/lemon/lp_cplex.h - Part of LEMON, a generic C++ optimization library
1.6 + *
1.7 + * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
1.8 + * (Egervary Research Group on Combinatorial Optimization, EGRES).
1.9 + *
1.10 + * Permission to use, modify and distribute this software is granted
1.11 + * provided that this copyright notice appears in all copies. For
1.12 + * precise terms see the accompanying LICENSE file.
1.13 + *
1.14 + * This software is provided "AS IS" with no warranty of any kind,
1.15 + * express or implied, and with no claim as to its suitability for any
1.16 + * purpose.
1.17 + *
1.18 + */
1.19 +
1.20 +#ifndef LEMON_LP_CPLEX_H
1.21 +#define LEMON_LP_CPLEX_H
1.22 +
1.23 +///\file
1.24 +///\brief Header of the LEMON-CPLEX lp solver interface.
1.25 +
1.26 +#include <lemon/lp_base.h>
1.27 +extern "C" {
1.28 +#include <ilcplex/cplex.h>
1.29 +}
1.30 +
1.31 +namespace lemon {
1.32 +
1.33 +
1.34 + /// \brief Wrapper for GLPK solver
1.35 + ///
1.36 + /// This class implements a lemon wrapper for GLPK.
1.37 + class LpCplex : public LpSolverBase {
1.38 +
1.39 + public:
1.40 +
1.41 + typedef LpSolverBase Parent;
1.42 +
1.43 + /// \e
1.44 + int status;
1.45 + CPXENVptr env;
1.46 + CPXLPptr lp;
1.47 +
1.48 +
1.49 + /// \e
1.50 + LpCplex();
1.51 + /// \e
1.52 + ~LpCplex();
1.53 +
1.54 + protected:
1.55 + virtual LpSolverBase &_newLp();
1.56 + virtual LpSolverBase &_copyLp();
1.57 +
1.58 + virtual int _addCol();
1.59 + virtual int _addRow();
1.60 + virtual void _setRowCoeffs(int i,
1.61 + int length,
1.62 + const int * indices,
1.63 + const Value * values );
1.64 + virtual void _setColCoeffs(int i,
1.65 + int length,
1.66 + const int * indices,
1.67 + const Value * values);
1.68 + virtual void _setColLowerBound(int i, Value value);
1.69 + virtual void _setColUpperBound(int i, Value value);
1.70 + virtual void _setRowLowerBound(int i, Value value);
1.71 + virtual void _setRowUpperBound(int i, Value value);
1.72 + virtual void _setRowBounds(int i, Value lower, Value upper);
1.73 + virtual void _setObjCoeff(int i, Value obj_coef);
1.74 + virtual void _clearObj();
1.75 + ///\e
1.76 +
1.77 + ///\bug Unimplemented
1.78 + ///
1.79 + virtual SolveExitStatus _solve();
1.80 + ///\e
1.81 +
1.82 + ///\bug Unimplemented
1.83 + ///
1.84 + virtual Value _getPrimal(int i);
1.85 + ///\e
1.86 +
1.87 + ///\bug Unimplemented
1.88 + ///
1.89 + virtual Value _getPrimalValue();
1.90 + ///\e
1.91 +
1.92 + ///\bug Unimplemented
1.93 + ///
1.94 + virtual SolutionStatus _getPrimalStatus();
1.95 +
1.96 + ///\e
1.97 +
1.98 + ///\bug Unimplemented
1.99 + ///
1.100 + virtual void _setMax();
1.101 + ///\e
1.102 +
1.103 + ///\bug Unimplemented
1.104 + ///
1.105 + virtual void _setMin();
1.106 +
1.107 + };
1.108 +} //END OF NAMESPACE LEMON
1.109 +
1.110 +#endif //LEMON_LP_CPLEX_H
1.111 +