[1247] | 1 | /* -*- C++ -*- |
---|
| 2 | * src/lemon/maps.h - Part of LEMON, a generic C++ optimization library |
---|
| 3 | * |
---|
| 4 | * Copyright (C) 2005 Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport |
---|
| 5 | * (Egervary Combinatorial Optimization Research Group, EGRES). |
---|
| 6 | * |
---|
| 7 | * Permission to use, modify and distribute this software is granted |
---|
| 8 | * provided that this copyright notice appears in all copies. For |
---|
| 9 | * precise terms see the accompanying LICENSE file. |
---|
| 10 | * |
---|
| 11 | * This software is provided "AS IS" with no warranty of any kind, |
---|
| 12 | * express or implied, and with no claim as to its suitability for any |
---|
| 13 | * purpose. |
---|
| 14 | * |
---|
| 15 | */ |
---|
| 16 | |
---|
[1246] | 17 | #ifndef LEMON_LP_BASE_H |
---|
| 18 | #define LEMON_LP_BASE_H |
---|
| 19 | |
---|
| 20 | ///\file |
---|
| 21 | ///\brief The interface of the LP solver interface. |
---|
| 22 | namespace lemon { |
---|
| 23 | class LpSolverBase { |
---|
[1247] | 24 | public: |
---|
| 25 | |
---|
| 26 | //UNCATEGORIZED |
---|
| 27 | |
---|
| 28 | /// \e |
---|
| 29 | typedef double Value; |
---|
| 30 | /// \e |
---|
| 31 | static const Value INF; |
---|
| 32 | protected: |
---|
[1246] | 33 | |
---|
| 34 | //MATRIX MANIPULATING FUNCTIONS |
---|
| 35 | |
---|
| 36 | /// \e |
---|
| 37 | virtual int _addCol() = 0; |
---|
| 38 | /// \e |
---|
| 39 | virtual int _addRow() = 0; |
---|
| 40 | /// \e |
---|
| 41 | /// \warning Arrays are indexed from 1 (datum at index 0 is ignored) |
---|
| 42 | virtual void _setRowCoeffs(int i, |
---|
[1247] | 43 | int const * indices, |
---|
| 44 | Value const * values ) = 0; |
---|
[1246] | 45 | /// \e |
---|
| 46 | /// \warning Arrays are indexed from 1 (datum at index 0 is ignored) |
---|
| 47 | virtual void _setColCoeffs(int i, |
---|
[1247] | 48 | int const * indices, |
---|
| 49 | Value const * values ) = 0; |
---|
[1246] | 50 | |
---|
[1247] | 51 | /// \e |
---|
| 52 | /// The lower bound of a variable (column) have to be given by an |
---|
| 53 | /// extended number of type Value, i.e. a finite number of type |
---|
| 54 | /// Value or -INF. |
---|
| 55 | virtual void _setColLowerBound(int i, Value value) = 0; |
---|
| 56 | /// \e |
---|
| 57 | /// The upper bound of a variable (column) have to be given by an |
---|
| 58 | /// extended number of type Value, i.e. a finite number of type |
---|
| 59 | /// Value or INF. |
---|
| 60 | virtual void _setColUpperBound(int i, Value value) = 0; |
---|
| 61 | /// \e |
---|
| 62 | /// The lower bound of a linear expression (row) have to be given by an |
---|
| 63 | /// extended number of type Value, i.e. a finite number of type |
---|
| 64 | /// Value or -INF. |
---|
| 65 | virtual void _setRowLowerBound(int i, Value value) = 0; |
---|
| 66 | /// \e |
---|
| 67 | /// The upper bound of a linear expression (row) have to be given by an |
---|
| 68 | /// extended number of type Value, i.e. a finite number of type |
---|
| 69 | /// Value or INF. |
---|
| 70 | virtual void _setRowUpperBound(int i, Value value) = 0; |
---|
| 71 | |
---|
| 72 | /// \e |
---|
| 73 | virtual void _setObjCoeff(int i, Value obj_coef) = 0; |
---|
[1248] | 74 | }; |
---|
[1246] | 75 | |
---|
| 76 | } //namespace lemon |
---|
| 77 | |
---|
| 78 | #endif //LEMON_LP_BASE_H |
---|