lemon/cbc.h
author Alpar Juttner <alpar@cs.elte.hu>
Fri, 09 Aug 2013 11:28:17 +0200
changeset 1270 dceba191c00d
parent 1232 fc3854d936f7
permissions -rw-r--r--
Apply unify-sources.sh to the source tree
deba@614
     1
/* -*- mode: C++; indent-tabs-mode: nil; -*-
deba@614
     2
 *
deba@614
     3
 * This file is a part of LEMON, a generic C++ optimization library.
deba@614
     4
 *
alpar@1270
     5
 * Copyright (C) 2003-2013
deba@614
     6
 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
deba@614
     7
 * (Egervary Research Group on Combinatorial Optimization, EGRES).
deba@614
     8
 *
deba@614
     9
 * Permission to use, modify and distribute this software is granted
deba@614
    10
 * provided that this copyright notice appears in all copies. For
deba@614
    11
 * precise terms see the accompanying LICENSE file.
deba@614
    12
 *
deba@614
    13
 * This software is provided "AS IS" with no warranty of any kind,
deba@614
    14
 * express or implied, and with no claim as to its suitability for any
deba@614
    15
 * purpose.
deba@614
    16
 *
deba@614
    17
 */
deba@614
    18
deba@614
    19
#ifndef LEMON_CBC_H
deba@614
    20
#define LEMON_CBC_H
deba@614
    21
deba@614
    22
///\file
deba@614
    23
///\brief Header of the LEMON-CBC mip solver interface.
deba@614
    24
///\ingroup lp_group
deba@614
    25
deba@614
    26
#include <lemon/lp_base.h>
deba@614
    27
deba@614
    28
class CoinModel;
deba@614
    29
class OsiSolverInterface;
deba@614
    30
class CbcModel;
deba@614
    31
deba@614
    32
namespace lemon {
deba@614
    33
deba@614
    34
  /// \brief Interface for the CBC MIP solver
deba@614
    35
  ///
deba@614
    36
  /// This class implements an interface for the CBC MIP solver.
deba@614
    37
  ///\ingroup lp_group
deba@614
    38
  class CbcMip : public MipSolver {
deba@614
    39
  protected:
deba@614
    40
deba@614
    41
    CoinModel *_prob;
deba@614
    42
    OsiSolverInterface *_osi_solver;
deba@614
    43
    CbcModel *_cbc_model;
deba@614
    44
deba@614
    45
  public:
deba@614
    46
deba@614
    47
    /// \e
deba@614
    48
    CbcMip();
deba@614
    49
    /// \e
deba@614
    50
    CbcMip(const CbcMip&);
deba@614
    51
    /// \e
deba@614
    52
    ~CbcMip();
deba@614
    53
    /// \e
deba@614
    54
    virtual CbcMip* newSolver() const;
deba@614
    55
    /// \e
deba@614
    56
    virtual CbcMip* cloneSolver() const;
deba@614
    57
deba@614
    58
  protected:
deba@614
    59
deba@614
    60
    virtual const char* _solverName() const;
deba@614
    61
deba@614
    62
    virtual int _addCol();
deba@614
    63
    virtual int _addRow();
deba@793
    64
    virtual int _addRow(Value l, ExprIterator b, ExprIterator e, Value u);
deba@614
    65
deba@614
    66
    virtual void _eraseCol(int i);
deba@614
    67
    virtual void _eraseRow(int i);
deba@614
    68
deba@614
    69
    virtual void _eraseColId(int i);
deba@614
    70
    virtual void _eraseRowId(int i);
deba@614
    71
deba@614
    72
    virtual void _getColName(int col, std::string& name) const;
deba@614
    73
    virtual void _setColName(int col, const std::string& name);
deba@614
    74
    virtual int _colByName(const std::string& name) const;
deba@614
    75
deba@614
    76
    virtual void _getRowName(int row, std::string& name) const;
deba@614
    77
    virtual void _setRowName(int row, const std::string& name);
deba@614
    78
    virtual int _rowByName(const std::string& name) const;
deba@614
    79
deba@614
    80
    virtual void _setRowCoeffs(int i, ExprIterator b, ExprIterator e);
deba@614
    81
    virtual void _getRowCoeffs(int i, InsertIterator b) const;
deba@614
    82
deba@614
    83
    virtual void _setColCoeffs(int i, ExprIterator b, ExprIterator e);
deba@614
    84
    virtual void _getColCoeffs(int i, InsertIterator b) const;
deba@614
    85
deba@614
    86
    virtual void _setCoeff(int row, int col, Value value);
deba@614
    87
    virtual Value _getCoeff(int row, int col) const;
deba@614
    88
deba@614
    89
    virtual void _setColLowerBound(int i, Value value);
deba@614
    90
    virtual Value _getColLowerBound(int i) const;
deba@614
    91
    virtual void _setColUpperBound(int i, Value value);
deba@614
    92
    virtual Value _getColUpperBound(int i) const;
deba@614
    93
deba@614
    94
    virtual void _setRowLowerBound(int i, Value value);
deba@614
    95
    virtual Value _getRowLowerBound(int i) const;
deba@614
    96
    virtual void _setRowUpperBound(int i, Value value);
deba@614
    97
    virtual Value _getRowUpperBound(int i) const;
deba@614
    98
deba@614
    99
    virtual void _setObjCoeffs(ExprIterator b, ExprIterator e);
deba@614
   100
    virtual void _getObjCoeffs(InsertIterator b) const;
deba@614
   101
deba@614
   102
    virtual void _setObjCoeff(int i, Value obj_coef);
deba@614
   103
    virtual Value _getObjCoeff(int i) const;
deba@614
   104
deba@614
   105
    virtual void _setSense(Sense sense);
deba@614
   106
    virtual Sense _getSense() const;
deba@614
   107
deba@614
   108
    virtual ColTypes _getColType(int col) const;
deba@614
   109
    virtual void _setColType(int col, ColTypes col_type);
deba@614
   110
deba@614
   111
    virtual SolveExitStatus _solve();
deba@614
   112
    virtual ProblemType _getType() const;
deba@614
   113
    virtual Value _getSol(int i) const;
deba@614
   114
    virtual Value _getSolValue() const;
deba@614
   115
deba@614
   116
    virtual void _clear();
deba@614
   117
deba@623
   118
    virtual void _messageLevel(MessageLevel level);
deba@623
   119
    void _applyMessageLevel();
deba@614
   120
deba@623
   121
    int _message_level;
deba@614
   122
alpar@956
   123
deba@614
   124
deba@614
   125
  };
deba@614
   126
deba@614
   127
}
deba@614
   128
deba@614
   129
#endif