1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
3 * This file is a part of LEMON, a generic C++ optimization library.
5 * Copyright (C) 2003-2009
6 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7 * (Egervary Research Group on Combinatorial Optimization, EGRES).
9 * Permission to use, modify and distribute this software is granted
10 * provided that this copyright notice appears in all copies. For
11 * precise terms see the accompanying LICENSE file.
13 * This software is provided "AS IS" with no warranty of any kind,
14 * express or implied, and with no claim as to its suitability for any
24 ///\brief Header of the LEMON-CBC mip solver interface.
27 #include <lemon/lp_base.h>
30 class OsiSolverInterface;
35 /// \brief Interface for the CBC MIP solver
37 /// This class implements an interface for the CBC MIP solver.
39 class CbcMip : public MipSolver {
43 OsiSolverInterface *_osi_solver;
51 CbcMip(const CbcMip&);
55 virtual CbcMip* newSolver() const;
57 virtual CbcMip* cloneSolver() const;
61 virtual const char* _solverName() const;
63 virtual int _addCol();
64 virtual int _addRow();
66 virtual void _eraseCol(int i);
67 virtual void _eraseRow(int i);
69 virtual void _eraseColId(int i);
70 virtual void _eraseRowId(int i);
72 virtual void _getColName(int col, std::string& name) const;
73 virtual void _setColName(int col, const std::string& name);
74 virtual int _colByName(const std::string& name) const;
76 virtual void _getRowName(int row, std::string& name) const;
77 virtual void _setRowName(int row, const std::string& name);
78 virtual int _rowByName(const std::string& name) const;
80 virtual void _setRowCoeffs(int i, ExprIterator b, ExprIterator e);
81 virtual void _getRowCoeffs(int i, InsertIterator b) const;
83 virtual void _setColCoeffs(int i, ExprIterator b, ExprIterator e);
84 virtual void _getColCoeffs(int i, InsertIterator b) const;
86 virtual void _setCoeff(int row, int col, Value value);
87 virtual Value _getCoeff(int row, int col) const;
89 virtual void _setColLowerBound(int i, Value value);
90 virtual Value _getColLowerBound(int i) const;
91 virtual void _setColUpperBound(int i, Value value);
92 virtual Value _getColUpperBound(int i) const;
94 virtual void _setRowLowerBound(int i, Value value);
95 virtual Value _getRowLowerBound(int i) const;
96 virtual void _setRowUpperBound(int i, Value value);
97 virtual Value _getRowUpperBound(int i) const;
99 virtual void _setObjCoeffs(ExprIterator b, ExprIterator e);
100 virtual void _getObjCoeffs(InsertIterator b) const;
102 virtual void _setObjCoeff(int i, Value obj_coef);
103 virtual Value _getObjCoeff(int i) const;
105 virtual void _setSense(Sense sense);
106 virtual Sense _getSense() const;
108 virtual ColTypes _getColType(int col) const;
109 virtual void _setColType(int col, ColTypes col_type);
111 virtual SolveExitStatus _solve();
112 virtual ProblemType _getType() const;
113 virtual Value _getSol(int i) const;
114 virtual Value _getSolValue() const;
116 virtual void _clear();
118 virtual void _messageLevel(MessageLevel level);
119 void _applyMessageLevel();