lemon/cbc.h
changeset 783 ef88c0a30f85
parent 576 745e182d0139
child 877 141f9c0db4a3
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/lemon/cbc.h	Thu Nov 05 15:48:01 2009 +0100
     1.3 @@ -0,0 +1,130 @@
     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-2009
     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 +// -*- C++ -*-
    1.23 +#ifndef LEMON_CBC_H
    1.24 +#define LEMON_CBC_H
    1.25 +
    1.26 +///\file
    1.27 +///\brief Header of the LEMON-CBC mip solver interface.
    1.28 +///\ingroup lp_group
    1.29 +
    1.30 +#include <lemon/lp_base.h>
    1.31 +
    1.32 +class CoinModel;
    1.33 +class OsiSolverInterface;
    1.34 +class CbcModel;
    1.35 +
    1.36 +namespace lemon {
    1.37 +
    1.38 +  /// \brief Interface for the CBC MIP solver
    1.39 +  ///
    1.40 +  /// This class implements an interface for the CBC MIP solver.
    1.41 +  ///\ingroup lp_group
    1.42 +  class CbcMip : public MipSolver {
    1.43 +  protected:
    1.44 +
    1.45 +    CoinModel *_prob;
    1.46 +    OsiSolverInterface *_osi_solver;
    1.47 +    CbcModel *_cbc_model;
    1.48 +
    1.49 +  public:
    1.50 +
    1.51 +    /// \e
    1.52 +    CbcMip();
    1.53 +    /// \e
    1.54 +    CbcMip(const CbcMip&);
    1.55 +    /// \e
    1.56 +    ~CbcMip();
    1.57 +    /// \e
    1.58 +    virtual CbcMip* newSolver() const;
    1.59 +    /// \e
    1.60 +    virtual CbcMip* cloneSolver() const;
    1.61 +
    1.62 +  protected:
    1.63 +
    1.64 +    virtual const char* _solverName() const;
    1.65 +
    1.66 +    virtual int _addCol();
    1.67 +    virtual int _addRow();
    1.68 +    virtual int _addRow(Value l, ExprIterator b, ExprIterator e, Value u);
    1.69 +
    1.70 +    virtual void _eraseCol(int i);
    1.71 +    virtual void _eraseRow(int i);
    1.72 +
    1.73 +    virtual void _eraseColId(int i);
    1.74 +    virtual void _eraseRowId(int i);
    1.75 +
    1.76 +    virtual void _getColName(int col, std::string& name) const;
    1.77 +    virtual void _setColName(int col, const std::string& name);
    1.78 +    virtual int _colByName(const std::string& name) const;
    1.79 +
    1.80 +    virtual void _getRowName(int row, std::string& name) const;
    1.81 +    virtual void _setRowName(int row, const std::string& name);
    1.82 +    virtual int _rowByName(const std::string& name) const;
    1.83 +
    1.84 +    virtual void _setRowCoeffs(int i, ExprIterator b, ExprIterator e);
    1.85 +    virtual void _getRowCoeffs(int i, InsertIterator b) const;
    1.86 +
    1.87 +    virtual void _setColCoeffs(int i, ExprIterator b, ExprIterator e);
    1.88 +    virtual void _getColCoeffs(int i, InsertIterator b) const;
    1.89 +
    1.90 +    virtual void _setCoeff(int row, int col, Value value);
    1.91 +    virtual Value _getCoeff(int row, int col) const;
    1.92 +
    1.93 +    virtual void _setColLowerBound(int i, Value value);
    1.94 +    virtual Value _getColLowerBound(int i) const;
    1.95 +    virtual void _setColUpperBound(int i, Value value);
    1.96 +    virtual Value _getColUpperBound(int i) const;
    1.97 +
    1.98 +    virtual void _setRowLowerBound(int i, Value value);
    1.99 +    virtual Value _getRowLowerBound(int i) const;
   1.100 +    virtual void _setRowUpperBound(int i, Value value);
   1.101 +    virtual Value _getRowUpperBound(int i) const;
   1.102 +
   1.103 +    virtual void _setObjCoeffs(ExprIterator b, ExprIterator e);
   1.104 +    virtual void _getObjCoeffs(InsertIterator b) const;
   1.105 +
   1.106 +    virtual void _setObjCoeff(int i, Value obj_coef);
   1.107 +    virtual Value _getObjCoeff(int i) const;
   1.108 +
   1.109 +    virtual void _setSense(Sense sense);
   1.110 +    virtual Sense _getSense() const;
   1.111 +
   1.112 +    virtual ColTypes _getColType(int col) const;
   1.113 +    virtual void _setColType(int col, ColTypes col_type);
   1.114 +
   1.115 +    virtual SolveExitStatus _solve();
   1.116 +    virtual ProblemType _getType() const;
   1.117 +    virtual Value _getSol(int i) const;
   1.118 +    virtual Value _getSolValue() const;
   1.119 +
   1.120 +    virtual void _clear();
   1.121 +
   1.122 +    virtual void _messageLevel(MessageLevel level);
   1.123 +    void _applyMessageLevel();
   1.124 +
   1.125 +    int _message_level;
   1.126 +
   1.127 +    
   1.128 +
   1.129 +  };
   1.130 +
   1.131 +}
   1.132 +
   1.133 +#endif