lemongraph 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (161) hide show
  1. checksums.yaml +7 -0
  2. data/.yardopts +8 -0
  3. data/LICENSE +674 -0
  4. data/README.md +6 -0
  5. data/ext/lemon-1.3.1/AUTHORS +26 -0
  6. data/ext/lemon-1.3.1/CMakeLists.txt +371 -0
  7. data/ext/lemon-1.3.1/INSTALL +167 -0
  8. data/ext/lemon-1.3.1/LICENSE +32 -0
  9. data/ext/lemon-1.3.1/NEWS +337 -0
  10. data/ext/lemon-1.3.1/README +50 -0
  11. data/ext/lemon-1.3.1/cmake/FindCOIN.cmake +110 -0
  12. data/ext/lemon-1.3.1/cmake/FindGLPK.cmake +55 -0
  13. data/ext/lemon-1.3.1/cmake/FindGhostscript.cmake +10 -0
  14. data/ext/lemon-1.3.1/cmake/FindILOG.cmake +102 -0
  15. data/ext/lemon-1.3.1/cmake/FindSOPLEX.cmake +23 -0
  16. data/ext/lemon-1.3.1/cmake/LEMONConfig.cmake.in +13 -0
  17. data/ext/lemon-1.3.1/cmake/nsis/lemon.ico +0 -0
  18. data/ext/lemon-1.3.1/cmake/nsis/uninstall.ico +0 -0
  19. data/ext/lemon-1.3.1/cmake/version.cmake +1 -0
  20. data/ext/lemon-1.3.1/cmake/version.cmake.in +1 -0
  21. data/ext/lemon-1.3.1/contrib/CMakeLists.txt +19 -0
  22. data/ext/lemon-1.3.1/lemon/CMakeLists.txt +91 -0
  23. data/ext/lemon-1.3.1/lemon/adaptors.h +3638 -0
  24. data/ext/lemon-1.3.1/lemon/arg_parser.cc +474 -0
  25. data/ext/lemon-1.3.1/lemon/arg_parser.h +440 -0
  26. data/ext/lemon-1.3.1/lemon/assert.h +214 -0
  27. data/ext/lemon-1.3.1/lemon/base.cc +37 -0
  28. data/ext/lemon-1.3.1/lemon/bellman_ford.h +1116 -0
  29. data/ext/lemon-1.3.1/lemon/bfs.h +1754 -0
  30. data/ext/lemon-1.3.1/lemon/bin_heap.h +347 -0
  31. data/ext/lemon-1.3.1/lemon/binomial_heap.h +445 -0
  32. data/ext/lemon-1.3.1/lemon/bits/alteration_notifier.h +472 -0
  33. data/ext/lemon-1.3.1/lemon/bits/array_map.h +351 -0
  34. data/ext/lemon-1.3.1/lemon/bits/bezier.h +174 -0
  35. data/ext/lemon-1.3.1/lemon/bits/default_map.h +182 -0
  36. data/ext/lemon-1.3.1/lemon/bits/edge_set_extender.h +627 -0
  37. data/ext/lemon-1.3.1/lemon/bits/enable_if.h +131 -0
  38. data/ext/lemon-1.3.1/lemon/bits/graph_adaptor_extender.h +401 -0
  39. data/ext/lemon-1.3.1/lemon/bits/graph_extender.h +1332 -0
  40. data/ext/lemon-1.3.1/lemon/bits/lock.h +65 -0
  41. data/ext/lemon-1.3.1/lemon/bits/map_extender.h +332 -0
  42. data/ext/lemon-1.3.1/lemon/bits/path_dump.h +177 -0
  43. data/ext/lemon-1.3.1/lemon/bits/solver_bits.h +194 -0
  44. data/ext/lemon-1.3.1/lemon/bits/traits.h +388 -0
  45. data/ext/lemon-1.3.1/lemon/bits/variant.h +494 -0
  46. data/ext/lemon-1.3.1/lemon/bits/vector_map.h +244 -0
  47. data/ext/lemon-1.3.1/lemon/bits/windows.cc +166 -0
  48. data/ext/lemon-1.3.1/lemon/bits/windows.h +44 -0
  49. data/ext/lemon-1.3.1/lemon/bucket_heap.h +594 -0
  50. data/ext/lemon-1.3.1/lemon/capacity_scaling.h +1014 -0
  51. data/ext/lemon-1.3.1/lemon/cbc.cc +460 -0
  52. data/ext/lemon-1.3.1/lemon/cbc.h +129 -0
  53. data/ext/lemon-1.3.1/lemon/christofides_tsp.h +254 -0
  54. data/ext/lemon-1.3.1/lemon/circulation.h +807 -0
  55. data/ext/lemon-1.3.1/lemon/clp.cc +464 -0
  56. data/ext/lemon-1.3.1/lemon/clp.h +164 -0
  57. data/ext/lemon-1.3.1/lemon/color.cc +44 -0
  58. data/ext/lemon-1.3.1/lemon/color.h +204 -0
  59. data/ext/lemon-1.3.1/lemon/concept_check.h +77 -0
  60. data/ext/lemon-1.3.1/lemon/concepts/bpgraph.h +1029 -0
  61. data/ext/lemon-1.3.1/lemon/concepts/digraph.h +491 -0
  62. data/ext/lemon-1.3.1/lemon/concepts/graph.h +788 -0
  63. data/ext/lemon-1.3.1/lemon/concepts/graph_components.h +2134 -0
  64. data/ext/lemon-1.3.1/lemon/concepts/heap.h +324 -0
  65. data/ext/lemon-1.3.1/lemon/concepts/maps.h +223 -0
  66. data/ext/lemon-1.3.1/lemon/concepts/path.h +312 -0
  67. data/ext/lemon-1.3.1/lemon/config.h.in +22 -0
  68. data/ext/lemon-1.3.1/lemon/connectivity.h +1688 -0
  69. data/ext/lemon-1.3.1/lemon/core.h +2506 -0
  70. data/ext/lemon-1.3.1/lemon/cost_scaling.h +1607 -0
  71. data/ext/lemon-1.3.1/lemon/counter.h +249 -0
  72. data/ext/lemon-1.3.1/lemon/cplex.cc +994 -0
  73. data/ext/lemon-1.3.1/lemon/cplex.h +292 -0
  74. data/ext/lemon-1.3.1/lemon/cycle_canceling.h +1230 -0
  75. data/ext/lemon-1.3.1/lemon/dfs.h +1637 -0
  76. data/ext/lemon-1.3.1/lemon/dheap.h +352 -0
  77. data/ext/lemon-1.3.1/lemon/dijkstra.h +1303 -0
  78. data/ext/lemon-1.3.1/lemon/dim2.h +726 -0
  79. data/ext/lemon-1.3.1/lemon/dimacs.h +448 -0
  80. data/ext/lemon-1.3.1/lemon/edge_set.h +1420 -0
  81. data/ext/lemon-1.3.1/lemon/edmonds_karp.h +556 -0
  82. data/ext/lemon-1.3.1/lemon/elevator.h +982 -0
  83. data/ext/lemon-1.3.1/lemon/error.h +276 -0
  84. data/ext/lemon-1.3.1/lemon/euler.h +287 -0
  85. data/ext/lemon-1.3.1/lemon/fib_heap.h +475 -0
  86. data/ext/lemon-1.3.1/lemon/fractional_matching.h +2139 -0
  87. data/ext/lemon-1.3.1/lemon/full_graph.h +1082 -0
  88. data/ext/lemon-1.3.1/lemon/glpk.cc +1012 -0
  89. data/ext/lemon-1.3.1/lemon/glpk.h +263 -0
  90. data/ext/lemon-1.3.1/lemon/gomory_hu.h +568 -0
  91. data/ext/lemon-1.3.1/lemon/graph_to_eps.h +1186 -0
  92. data/ext/lemon-1.3.1/lemon/greedy_tsp.h +251 -0
  93. data/ext/lemon-1.3.1/lemon/grid_graph.h +699 -0
  94. data/ext/lemon-1.3.1/lemon/grosso_locatelli_pullan_mc.h +840 -0
  95. data/ext/lemon-1.3.1/lemon/hao_orlin.h +1015 -0
  96. data/ext/lemon-1.3.1/lemon/hartmann_orlin_mmc.h +654 -0
  97. data/ext/lemon-1.3.1/lemon/howard_mmc.h +651 -0
  98. data/ext/lemon-1.3.1/lemon/hypercube_graph.h +459 -0
  99. data/ext/lemon-1.3.1/lemon/insertion_tsp.h +533 -0
  100. data/ext/lemon-1.3.1/lemon/karp_mmc.h +590 -0
  101. data/ext/lemon-1.3.1/lemon/kruskal.h +324 -0
  102. data/ext/lemon-1.3.1/lemon/lemon.pc.in +10 -0
  103. data/ext/lemon-1.3.1/lemon/lgf_reader.h +3854 -0
  104. data/ext/lemon-1.3.1/lemon/lgf_writer.h +2687 -0
  105. data/ext/lemon-1.3.1/lemon/list_graph.h +2510 -0
  106. data/ext/lemon-1.3.1/lemon/lp.h +95 -0
  107. data/ext/lemon-1.3.1/lemon/lp_base.cc +30 -0
  108. data/ext/lemon-1.3.1/lemon/lp_base.h +2147 -0
  109. data/ext/lemon-1.3.1/lemon/lp_skeleton.cc +143 -0
  110. data/ext/lemon-1.3.1/lemon/lp_skeleton.h +234 -0
  111. data/ext/lemon-1.3.1/lemon/maps.h +4057 -0
  112. data/ext/lemon-1.3.1/lemon/matching.h +3505 -0
  113. data/ext/lemon-1.3.1/lemon/math.h +77 -0
  114. data/ext/lemon-1.3.1/lemon/max_cardinality_search.h +794 -0
  115. data/ext/lemon-1.3.1/lemon/min_cost_arborescence.h +808 -0
  116. data/ext/lemon-1.3.1/lemon/nagamochi_ibaraki.h +702 -0
  117. data/ext/lemon-1.3.1/lemon/nauty_reader.h +113 -0
  118. data/ext/lemon-1.3.1/lemon/nearest_neighbor_tsp.h +238 -0
  119. data/ext/lemon-1.3.1/lemon/network_simplex.h +1659 -0
  120. data/ext/lemon-1.3.1/lemon/opt2_tsp.h +367 -0
  121. data/ext/lemon-1.3.1/lemon/pairing_heap.h +474 -0
  122. data/ext/lemon-1.3.1/lemon/path.h +1164 -0
  123. data/ext/lemon-1.3.1/lemon/planarity.h +2754 -0
  124. data/ext/lemon-1.3.1/lemon/preflow.h +985 -0
  125. data/ext/lemon-1.3.1/lemon/quad_heap.h +343 -0
  126. data/ext/lemon-1.3.1/lemon/radix_heap.h +438 -0
  127. data/ext/lemon-1.3.1/lemon/radix_sort.h +487 -0
  128. data/ext/lemon-1.3.1/lemon/random.cc +29 -0
  129. data/ext/lemon-1.3.1/lemon/random.h +1005 -0
  130. data/ext/lemon-1.3.1/lemon/smart_graph.h +1344 -0
  131. data/ext/lemon-1.3.1/lemon/soplex.cc +465 -0
  132. data/ext/lemon-1.3.1/lemon/soplex.h +158 -0
  133. data/ext/lemon-1.3.1/lemon/static_graph.h +476 -0
  134. data/ext/lemon-1.3.1/lemon/suurballe.h +776 -0
  135. data/ext/lemon-1.3.1/lemon/time_measure.h +610 -0
  136. data/ext/lemon-1.3.1/lemon/tolerance.h +242 -0
  137. data/ext/lemon-1.3.1/lemon/unionfind.h +1824 -0
  138. data/ext/lemon-1.3.1/scripts/unify-sources.sh +390 -0
  139. data/ext/lemon-1.3.1/scripts/valgrind-wrapper.sh +22 -0
  140. data/ext/lemongraph/arc_map.cc +1007 -0
  141. data/ext/lemongraph/digraph.cc +282 -0
  142. data/ext/lemongraph/digraph_arc.cc +153 -0
  143. data/ext/lemongraph/digraph_node.cc +277 -0
  144. data/ext/lemongraph/edge_map.cc +770 -0
  145. data/ext/lemongraph/extconf.rb +53 -0
  146. data/ext/lemongraph/graph.cc +351 -0
  147. data/ext/lemongraph/graph_arc.cc +95 -0
  148. data/ext/lemongraph/graph_edge.cc +153 -0
  149. data/ext/lemongraph/graph_item.cc +76 -0
  150. data/ext/lemongraph/graph_node.cc +321 -0
  151. data/ext/lemongraph/lemongraph.cc +260 -0
  152. data/ext/lemongraph/lemongraph.hh +295 -0
  153. data/ext/lemongraph/lemongraph.map +6 -0
  154. data/ext/lemongraph/lemongraph_export.hh +31 -0
  155. data/ext/lemongraph/node_map.cc +1011 -0
  156. data/lemongraph.gemspec +176 -0
  157. data/lib/lemongraph/graphviz.rb +240 -0
  158. data/lib/lemongraph/version.rb +4 -0
  159. data/lib/lemongraph.rb +21 -0
  160. data/samples/lemondeps.rb +38 -0
  161. metadata +202 -0
@@ -0,0 +1,143 @@
1
+ /* -*- mode: C++; indent-tabs-mode: nil; -*-
2
+ *
3
+ * This file is a part of LEMON, a generic C++ optimization library.
4
+ *
5
+ * Copyright (C) 2003-2013
6
+ * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7
+ * (Egervary Research Group on Combinatorial Optimization, EGRES).
8
+ *
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.
12
+ *
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
15
+ * purpose.
16
+ *
17
+ */
18
+
19
+ #include <lemon/lp_skeleton.h>
20
+
21
+ ///\file
22
+ ///\brief A skeleton file to implement LP solver interfaces
23
+ namespace lemon {
24
+
25
+ int SkeletonSolverBase::_addCol()
26
+ {
27
+ return ++col_num;
28
+ }
29
+
30
+ int SkeletonSolverBase::_addRow()
31
+ {
32
+ return ++row_num;
33
+ }
34
+
35
+ int SkeletonSolverBase::_addRow(Value, ExprIterator, ExprIterator, Value)
36
+ {
37
+ return ++row_num;
38
+ }
39
+
40
+ void SkeletonSolverBase::_eraseCol(int) {}
41
+ void SkeletonSolverBase::_eraseRow(int) {}
42
+
43
+ void SkeletonSolverBase::_getColName(int, std::string &) const {}
44
+ void SkeletonSolverBase::_setColName(int, const std::string &) {}
45
+ int SkeletonSolverBase::_colByName(const std::string&) const { return -1; }
46
+
47
+ void SkeletonSolverBase::_getRowName(int, std::string &) const {}
48
+ void SkeletonSolverBase::_setRowName(int, const std::string &) {}
49
+ int SkeletonSolverBase::_rowByName(const std::string&) const { return -1; }
50
+
51
+ void SkeletonSolverBase::_setRowCoeffs(int, ExprIterator, ExprIterator) {}
52
+ void SkeletonSolverBase::_getRowCoeffs(int, InsertIterator) const {}
53
+
54
+ void SkeletonSolverBase::_setColCoeffs(int, ExprIterator, ExprIterator) {}
55
+ void SkeletonSolverBase::_getColCoeffs(int, InsertIterator) const {}
56
+
57
+ void SkeletonSolverBase::_setCoeff(int, int, Value) {}
58
+ SkeletonSolverBase::Value SkeletonSolverBase::_getCoeff(int, int) const
59
+ { return 0; }
60
+
61
+ void SkeletonSolverBase::_setColLowerBound(int, Value) {}
62
+ SkeletonSolverBase::Value SkeletonSolverBase::_getColLowerBound(int) const
63
+ { return 0; }
64
+
65
+ void SkeletonSolverBase::_setColUpperBound(int, Value) {}
66
+ SkeletonSolverBase::Value SkeletonSolverBase::_getColUpperBound(int) const
67
+ { return 0; }
68
+
69
+ void SkeletonSolverBase::_setRowLowerBound(int, Value) {}
70
+ SkeletonSolverBase::Value SkeletonSolverBase::_getRowLowerBound(int) const
71
+ { return 0; }
72
+
73
+ void SkeletonSolverBase::_setRowUpperBound(int, Value) {}
74
+ SkeletonSolverBase::Value SkeletonSolverBase::_getRowUpperBound(int) const
75
+ { return 0; }
76
+
77
+ void SkeletonSolverBase::_setObjCoeffs(ExprIterator, ExprIterator) {}
78
+ void SkeletonSolverBase::_getObjCoeffs(InsertIterator) const {};
79
+
80
+ void SkeletonSolverBase::_setObjCoeff(int, Value) {}
81
+ SkeletonSolverBase::Value SkeletonSolverBase::_getObjCoeff(int) const
82
+ { return 0; }
83
+
84
+ void SkeletonSolverBase::_setSense(Sense) {}
85
+ SkeletonSolverBase::Sense SkeletonSolverBase::_getSense() const
86
+ { return MIN; }
87
+
88
+ void SkeletonSolverBase::_clear() {
89
+ row_num = col_num = 0;
90
+ }
91
+
92
+ void SkeletonSolverBase::_messageLevel(MessageLevel) {}
93
+
94
+ void SkeletonSolverBase::_write(std::string, std::string) const {}
95
+
96
+ LpSkeleton::SolveExitStatus LpSkeleton::_solve() { return SOLVED; }
97
+
98
+ LpSkeleton::Value LpSkeleton::_getPrimal(int) const { return 0; }
99
+ LpSkeleton::Value LpSkeleton::_getDual(int) const { return 0; }
100
+ LpSkeleton::Value LpSkeleton::_getPrimalValue() const { return 0; }
101
+
102
+ LpSkeleton::Value LpSkeleton::_getPrimalRay(int) const { return 0; }
103
+ LpSkeleton::Value LpSkeleton::_getDualRay(int) const { return 0; }
104
+
105
+ LpSkeleton::ProblemType LpSkeleton::_getPrimalType() const
106
+ { return UNDEFINED; }
107
+
108
+ LpSkeleton::ProblemType LpSkeleton::_getDualType() const
109
+ { return UNDEFINED; }
110
+
111
+ LpSkeleton::VarStatus LpSkeleton::_getColStatus(int) const
112
+ { return BASIC; }
113
+
114
+ LpSkeleton::VarStatus LpSkeleton::_getRowStatus(int) const
115
+ { return BASIC; }
116
+
117
+ LpSkeleton* LpSkeleton::newSolver() const
118
+ { return static_cast<LpSkeleton*>(0); }
119
+
120
+ LpSkeleton* LpSkeleton::cloneSolver() const
121
+ { return static_cast<LpSkeleton*>(0); }
122
+
123
+ const char* LpSkeleton::_solverName() const { return "LpSkeleton"; }
124
+
125
+ MipSkeleton::SolveExitStatus MipSkeleton::_solve()
126
+ { return SOLVED; }
127
+
128
+ MipSkeleton::Value MipSkeleton::_getSol(int) const { return 0; }
129
+ MipSkeleton::Value MipSkeleton::_getSolValue() const { return 0; }
130
+
131
+ MipSkeleton::ProblemType MipSkeleton::_getType() const
132
+ { return UNDEFINED; }
133
+
134
+ MipSkeleton* MipSkeleton::newSolver() const
135
+ { return static_cast<MipSkeleton*>(0); }
136
+
137
+ MipSkeleton* MipSkeleton::cloneSolver() const
138
+ { return static_cast<MipSkeleton*>(0); }
139
+
140
+ const char* MipSkeleton::_solverName() const { return "MipSkeleton"; }
141
+
142
+ } //namespace lemon
143
+
@@ -0,0 +1,234 @@
1
+ /* -*- mode: C++; indent-tabs-mode: nil; -*-
2
+ *
3
+ * This file is a part of LEMON, a generic C++ optimization library.
4
+ *
5
+ * Copyright (C) 2003-2013
6
+ * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
7
+ * (Egervary Research Group on Combinatorial Optimization, EGRES).
8
+ *
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.
12
+ *
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
15
+ * purpose.
16
+ *
17
+ */
18
+
19
+ #ifndef LEMON_LP_SKELETON_H
20
+ #define LEMON_LP_SKELETON_H
21
+
22
+ #include <lemon/lp_base.h>
23
+
24
+ ///\file
25
+ ///\brief Skeleton file to implement LP/MIP solver interfaces
26
+ ///
27
+ ///The classes in this file do nothing, but they can serve as skeletons when
28
+ ///implementing an interface to new solvers.
29
+ namespace lemon {
30
+
31
+ ///A skeleton class to implement LP/MIP solver base interface
32
+
33
+ ///This class does nothing, but it can serve as a skeleton when
34
+ ///implementing an interface to new solvers.
35
+ class SkeletonSolverBase : public virtual LpBase {
36
+ int col_num,row_num;
37
+
38
+ protected:
39
+
40
+ SkeletonSolverBase()
41
+ : col_num(-1), row_num(-1) {}
42
+
43
+ /// \e
44
+ virtual int _addCol();
45
+ /// \e
46
+ virtual int _addRow();
47
+ /// \e
48
+ virtual int _addRow(Value l, ExprIterator b, ExprIterator e, Value u);
49
+ /// \e
50
+ virtual void _eraseCol(int i);
51
+ /// \e
52
+ virtual void _eraseRow(int i);
53
+
54
+ /// \e
55
+ virtual void _getColName(int col, std::string& name) const;
56
+ /// \e
57
+ virtual void _setColName(int col, const std::string& name);
58
+ /// \e
59
+ virtual int _colByName(const std::string& name) const;
60
+
61
+ /// \e
62
+ virtual void _getRowName(int row, std::string& name) const;
63
+ /// \e
64
+ virtual void _setRowName(int row, const std::string& name);
65
+ /// \e
66
+ virtual int _rowByName(const std::string& name) const;
67
+
68
+ /// \e
69
+ virtual void _setRowCoeffs(int i, ExprIterator b, ExprIterator e);
70
+ /// \e
71
+ virtual void _getRowCoeffs(int i, InsertIterator b) const;
72
+ /// \e
73
+ virtual void _setColCoeffs(int i, ExprIterator b, ExprIterator e);
74
+ /// \e
75
+ virtual void _getColCoeffs(int i, InsertIterator b) const;
76
+
77
+ /// Set one element of the coefficient matrix
78
+ virtual void _setCoeff(int row, int col, Value value);
79
+
80
+ /// Get one element of the coefficient matrix
81
+ virtual Value _getCoeff(int row, int col) const;
82
+
83
+ /// The lower bound of a variable (column) have to be given by an
84
+ /// extended number of type Value, i.e. a finite number of type
85
+ /// Value or -\ref INF.
86
+ virtual void _setColLowerBound(int i, Value value);
87
+ /// \e
88
+
89
+ /// The lower bound of a variable (column) is an
90
+ /// extended number of type Value, i.e. a finite number of type
91
+ /// Value or -\ref INF.
92
+ virtual Value _getColLowerBound(int i) const;
93
+
94
+ /// The upper bound of a variable (column) have to be given by an
95
+ /// extended number of type Value, i.e. a finite number of type
96
+ /// Value or \ref INF.
97
+ virtual void _setColUpperBound(int i, Value value);
98
+ /// \e
99
+
100
+ /// The upper bound of a variable (column) is an
101
+ /// extended number of type Value, i.e. a finite number of type
102
+ /// Value or \ref INF.
103
+ virtual Value _getColUpperBound(int i) const;
104
+
105
+ /// The lower bound of a constraint (row) have to be given by an
106
+ /// extended number of type Value, i.e. a finite number of type
107
+ /// Value or -\ref INF.
108
+ virtual void _setRowLowerBound(int i, Value value);
109
+ /// \e
110
+
111
+ /// The lower bound of a constraint (row) is an
112
+ /// extended number of type Value, i.e. a finite number of type
113
+ /// Value or -\ref INF.
114
+ virtual Value _getRowLowerBound(int i) const;
115
+
116
+ /// The upper bound of a constraint (row) have to be given by an
117
+ /// extended number of type Value, i.e. a finite number of type
118
+ /// Value or \ref INF.
119
+ virtual void _setRowUpperBound(int i, Value value);
120
+ /// \e
121
+
122
+ /// The upper bound of a constraint (row) is an
123
+ /// extended number of type Value, i.e. a finite number of type
124
+ /// Value or \ref INF.
125
+ virtual Value _getRowUpperBound(int i) const;
126
+
127
+ /// \e
128
+ virtual void _setObjCoeffs(ExprIterator b, ExprIterator e);
129
+ /// \e
130
+ virtual void _getObjCoeffs(InsertIterator b) const;
131
+
132
+ /// \e
133
+ virtual void _setObjCoeff(int i, Value obj_coef);
134
+ /// \e
135
+ virtual Value _getObjCoeff(int i) const;
136
+
137
+ ///\e
138
+ virtual void _setSense(Sense);
139
+ ///\e
140
+ virtual Sense _getSense() const;
141
+
142
+ ///\e
143
+ virtual void _clear();
144
+
145
+ ///\e
146
+ virtual void _messageLevel(MessageLevel);
147
+
148
+ ///\e
149
+ virtual void _write(std::string file, std::string format) const;
150
+
151
+ };
152
+
153
+ /// \brief Skeleton class for an LP solver interface
154
+ ///
155
+ ///This class does nothing, but it can serve as a skeleton when
156
+ ///implementing an interface to new solvers.
157
+
158
+ ///\ingroup lp_group
159
+ class LpSkeleton : public LpSolver, public SkeletonSolverBase {
160
+ public:
161
+ ///\e
162
+ LpSkeleton() : LpSolver(), SkeletonSolverBase() {}
163
+ ///\e
164
+ virtual LpSkeleton* newSolver() const;
165
+ ///\e
166
+ virtual LpSkeleton* cloneSolver() const;
167
+ protected:
168
+
169
+ ///\e
170
+ virtual SolveExitStatus _solve();
171
+
172
+ ///\e
173
+ virtual Value _getPrimal(int i) const;
174
+ ///\e
175
+ virtual Value _getDual(int i) const;
176
+
177
+ ///\e
178
+ virtual Value _getPrimalValue() const;
179
+
180
+ ///\e
181
+ virtual Value _getPrimalRay(int i) const;
182
+ ///\e
183
+ virtual Value _getDualRay(int i) const;
184
+
185
+ ///\e
186
+ virtual ProblemType _getPrimalType() const;
187
+ ///\e
188
+ virtual ProblemType _getDualType() const;
189
+
190
+ ///\e
191
+ virtual VarStatus _getColStatus(int i) const;
192
+ ///\e
193
+ virtual VarStatus _getRowStatus(int i) const;
194
+
195
+ ///\e
196
+ virtual const char* _solverName() const;
197
+
198
+ };
199
+
200
+ /// \brief Skeleton class for a MIP solver interface
201
+ ///
202
+ ///This class does nothing, but it can serve as a skeleton when
203
+ ///implementing an interface to new solvers.
204
+ ///\ingroup lp_group
205
+ class MipSkeleton : public MipSolver, public SkeletonSolverBase {
206
+ public:
207
+ ///\e
208
+ MipSkeleton() : MipSolver(), SkeletonSolverBase() {}
209
+ ///\e
210
+ virtual MipSkeleton* newSolver() const;
211
+ ///\e
212
+ virtual MipSkeleton* cloneSolver() const;
213
+
214
+ protected:
215
+ ///\e
216
+ virtual SolveExitStatus _solve();
217
+
218
+ ///\e
219
+ virtual Value _getSol(int i) const;
220
+
221
+ ///\e
222
+ virtual Value _getSolValue() const;
223
+
224
+ ///\e
225
+ virtual ProblemType _getType() const;
226
+
227
+ ///\e
228
+ virtual const char* _solverName() const;
229
+
230
+ };
231
+
232
+ } //namespace lemon
233
+
234
+ #endif