lemon/lp_soplex.h
changeset 481 7afc121e0689
child 482 ed54c0d13df0
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/lemon/lp_soplex.h	Tue Dec 02 21:40:33 2008 +0100
     1.3 @@ -0,0 +1,120 @@
     1.4 +/* -*- mode: C++; indent-tabs-mode: nil; -*-
     1.5 + *
     1.6 + * This file is a part of LEMON, a generic C++ optimization library.
     1.7 + *
     1.8 + * Copyright (C) 2003-2008
     1.9 + * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    1.10 + * (Egervary Research Group on Combinatorial Optimization, EGRES).
    1.11 + *
    1.12 + * Permission to use, modify and distribute this software is granted
    1.13 + * provided that this copyright notice appears in all copies. For
    1.14 + * precise terms see the accompanying LICENSE file.
    1.15 + *
    1.16 + * This software is provided "AS IS" with no warranty of any kind,
    1.17 + * express or implied, and with no claim as to its suitability for any
    1.18 + * purpose.
    1.19 + *
    1.20 + */
    1.21 +
    1.22 +#ifndef LEMON_LP_SOPLEX_H
    1.23 +#define LEMON_LP_SOPLEX_H
    1.24 +
    1.25 +///\file
    1.26 +///\brief Header of the LEMON-SOPLEX lp solver interface.
    1.27 +
    1.28 +#include <vector>
    1.29 +#include <string>
    1.30 +
    1.31 +#include <lemon/lp_base.h>
    1.32 +
    1.33 +// Forward declaration
    1.34 +namespace soplex {
    1.35 +  class SoPlex;
    1.36 +}
    1.37 +
    1.38 +namespace lemon {
    1.39 +
    1.40 +  /// \ingroup lp_group
    1.41 +  ///
    1.42 +  /// \brief Interface for the SOPLEX solver
    1.43 +  ///
    1.44 +  /// This class implements an interface for the SoPlex LP solver.
    1.45 +  /// The SoPlex library is an object oriented lp solver library
    1.46 +  /// developed at the Konrad-Zuse-Zentrum für Informationstechnik
    1.47 +  /// Berlin (ZIB). You can find detailed information about it at the
    1.48 +  /// <tt>http://soplex.zib.de</tt> address.
    1.49 +  class LpSoplex :virtual public LpSolverBase {
    1.50 +  protected:
    1.51 +
    1.52 +    _lp_bits::RelocateIdHandler relocateIdHandler;
    1.53 +
    1.54 +    soplex::SoPlex* soplex;
    1.55 +    bool solved;
    1.56 +
    1.57 +    std::vector<std::string> colNames;
    1.58 +    std::map<std::string, int> invColNames;
    1.59 +
    1.60 +    std::vector<Value> primal_value;
    1.61 +    std::vector<Value> dual_value;
    1.62 +
    1.63 +
    1.64 +  public:
    1.65 +
    1.66 +    typedef LpSolverBase Parent;
    1.67 +
    1.68 +
    1.69 +    /// \e
    1.70 +    LpSoplex();
    1.71 +    /// \e
    1.72 +    LpSoplex(const LpSoplex&);
    1.73 +    /// \e
    1.74 +    ~LpSoplex();
    1.75 +
    1.76 +  protected:
    1.77 +
    1.78 +    virtual LpSolverBase* _newLp();
    1.79 +    virtual LpSolverBase* _copyLp();
    1.80 +
    1.81 +    virtual int _addCol();
    1.82 +    virtual int _addRow();
    1.83 +    virtual void _eraseCol(int i);
    1.84 +    virtual void _eraseRow(int i);
    1.85 +    virtual void _getColName(int col, std::string & name) const;
    1.86 +    virtual void _setColName(int col, const std::string & name);
    1.87 +    virtual int _colByName(const std::string& name) const;
    1.88 +    virtual void _setRowCoeffs(int i, ConstRowIterator b, ConstRowIterator e);
    1.89 +    virtual void _getRowCoeffs(int i, RowIterator b) const;
    1.90 +    virtual void _setColCoeffs(int i, ConstColIterator b, ConstColIterator e);
    1.91 +    virtual void _getColCoeffs(int i, ColIterator b) const;
    1.92 +    virtual void _setCoeff(int row, int col, Value value);
    1.93 +    virtual Value _getCoeff(int row, int col) const;
    1.94 +    virtual void _setColLowerBound(int i, Value value);
    1.95 +    virtual Value _getColLowerBound(int i) const;
    1.96 +    virtual void _setColUpperBound(int i, Value value);
    1.97 +    virtual Value _getColUpperBound(int i) const;
    1.98 +    virtual void _setRowBounds(int i, Value lower, Value upper);
    1.99 +    virtual void _getRowBounds(int i, Value &lower, Value &upper) const;
   1.100 +    virtual void _setObjCoeff(int i, Value obj_coef);
   1.101 +    virtual Value _getObjCoeff(int i) const;
   1.102 +    virtual void _clearObj();
   1.103 +
   1.104 +    virtual SolveExitStatus _solve();
   1.105 +    virtual Value _getPrimal(int i) const;
   1.106 +    virtual Value _getDual(int i) const;
   1.107 +    virtual Value _getPrimalValue() const;
   1.108 +    virtual bool _isBasicCol(int i) const;
   1.109 +
   1.110 +    virtual SolutionStatus _getPrimalStatus() const;
   1.111 +    virtual SolutionStatus _getDualStatus() const;
   1.112 +    virtual ProblemTypes _getProblemType() const;
   1.113 +
   1.114 +
   1.115 +    virtual void _setMax();
   1.116 +    virtual void _setMin();
   1.117 +    virtual bool _isMax() const;
   1.118 +
   1.119 +  };
   1.120 +} //END OF NAMESPACE LEMON
   1.121 +
   1.122 +#endif //LEMON_LP_SOPLEX_H
   1.123 +