1 // -*- c++ -*- |
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 |
2 #ifndef LEMON_LP_BASE_H |
17 #ifndef LEMON_LP_BASE_H |
3 #define LEMON_LP_BASE_H |
18 #define LEMON_LP_BASE_H |
4 |
19 |
5 ///\file |
20 ///\file |
6 ///\brief The interface of the LP solver interface. |
21 ///\brief The interface of the LP solver interface. |
7 namespace lemon { |
22 namespace lemon { |
8 class LpSolverBase { |
23 class LpSolverBase { |
9 protected: |
24 public: |
|
25 |
|
26 //UNCATEGORIZED |
|
27 |
|
28 /// \e |
|
29 typedef double Value; |
|
30 /// \e |
|
31 static const Value INF; |
|
32 protected: |
10 |
33 |
11 //MATRIX MANIPULATING FUNCTIONS |
34 //MATRIX MANIPULATING FUNCTIONS |
12 |
35 |
13 /// \e |
36 /// \e |
14 virtual int _addCol() = 0; |
37 virtual int _addCol() = 0; |
15 /// \e |
38 /// \e |
16 virtual int _addRow() = 0; |
39 virtual int _addRow() = 0; |
17 /// \e |
40 /// \e |
18 /// \warning Arrays are indexed from 1 (datum at index 0 is ignored) |
41 /// \warning Arrays are indexed from 1 (datum at index 0 is ignored) |
19 virtual void _setRowCoeffs(int i, |
42 virtual void _setRowCoeffs(int i, |
20 int * &indices, |
43 int const * indices, |
21 double * &doubles ) = 0; |
44 Value const * values ) = 0; |
22 /// \e |
45 /// \e |
23 /// \warning Arrays are indexed from 1 (datum at index 0 is ignored) |
46 /// \warning Arrays are indexed from 1 (datum at index 0 is ignored) |
24 virtual void _setColCoeffs(int i, |
47 virtual void _setColCoeffs(int i, |
25 int * &indices, |
48 int const * indices, |
26 double * &doubles ) = 0; |
49 Value const * values ) = 0; |
27 |
50 |
|
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; |
28 } |
74 } |
29 |
75 |
30 } //namespace lemon |
76 } //namespace lemon |
31 |
77 |
32 #endif //LEMON_LP_BASE_H |
78 #endif //LEMON_LP_BASE_H |