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 | |
---|
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 { |
---|
24 | public: |
---|
25 | |
---|
26 | //UNCATEGORIZED |
---|
27 | |
---|
28 | /// \e |
---|
29 | typedef double Value; |
---|
30 | /// \e |
---|
31 | static const Value INF; |
---|
32 | protected: |
---|
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, |
---|
43 | int length, |
---|
44 | int const * indices, |
---|
45 | Value const * values ) = 0; |
---|
46 | /// \e |
---|
47 | /// \warning Arrays are indexed from 1 (datum at index 0 is ignored) |
---|
48 | virtual void _setColCoeffs(int i, |
---|
49 | int length, |
---|
50 | int const * indices, |
---|
51 | Value const * values ) = 0; |
---|
52 | |
---|
53 | /// \e |
---|
54 | /// The lower bound of a variable (column) have to be given by an |
---|
55 | /// extended number of type Value, i.e. a finite number of type |
---|
56 | /// Value or -INF. |
---|
57 | virtual void _setColLowerBound(int i, Value value) = 0; |
---|
58 | /// \e |
---|
59 | /// The upper bound of a variable (column) have to be given by an |
---|
60 | /// extended number of type Value, i.e. a finite number of type |
---|
61 | /// Value or INF. |
---|
62 | virtual void _setColUpperBound(int i, Value value) = 0; |
---|
63 | /// \e |
---|
64 | /// The lower bound of a linear expression (row) have to be given by an |
---|
65 | /// extended number of type Value, i.e. a finite number of type |
---|
66 | /// Value or -INF. |
---|
67 | virtual void _setRowLowerBound(int i, Value value) = 0; |
---|
68 | /// \e |
---|
69 | /// The upper bound of a linear expression (row) have to be given by an |
---|
70 | /// extended number of type Value, i.e. a finite number of type |
---|
71 | /// Value or INF. |
---|
72 | virtual void _setRowUpperBound(int i, Value value) = 0; |
---|
73 | |
---|
74 | /// \e |
---|
75 | virtual void _setObjCoeff(int i, Value obj_coef) = 0; |
---|
76 | }; |
---|
77 | |
---|
78 | } //namespace lemon |
---|
79 | |
---|
80 | #endif //LEMON_LP_BASE_H |
---|