dep-selector-libgecode 1.0.0.alpha.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (806) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +26 -0
  3. data/Gemfile +3 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +29 -0
  6. data/Rakefile +20 -0
  7. data/dep-selector-libgecode.gemspec +25 -0
  8. data/ext/libgecode3/Makefile +8 -0
  9. data/ext/libgecode3/extconf.rb +57 -0
  10. data/ext/libgecode3/vendor/gecode-3.7.3/LICENSE +25 -0
  11. data/ext/libgecode3/vendor/gecode-3.7.3/Makefile.contribs +88 -0
  12. data/ext/libgecode3/vendor/gecode-3.7.3/Makefile.dep +11307 -0
  13. data/ext/libgecode3/vendor/gecode-3.7.3/Makefile.in +1795 -0
  14. data/ext/libgecode3/vendor/gecode-3.7.3/changelog.in +6132 -0
  15. data/ext/libgecode3/vendor/gecode-3.7.3/configure +13054 -0
  16. data/ext/libgecode3/vendor/gecode-3.7.3/configure.ac +356 -0
  17. data/ext/libgecode3/vendor/gecode-3.7.3/configure.ac.in +352 -0
  18. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/README +26 -0
  19. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/AbstractWorker.hh +42 -0
  20. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/Doxyfile +263 -0
  21. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/Makefile.in.in +162 -0
  22. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/OptVar.cc +82 -0
  23. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/OptVar.hh +124 -0
  24. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/QCOPPlus.cc +306 -0
  25. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/QCOPPlus.hh +166 -0
  26. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/QCSPPlusUnblockable.cc +239 -0
  27. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/QCSPPlusUnblockable.hh +140 -0
  28. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/README +6 -0
  29. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/Strategy.cc +253 -0
  30. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/Strategy.hh +112 -0
  31. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/StrategyNode.cc +59 -0
  32. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/StrategyNode.hh +49 -0
  33. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/UnblockableBranching.hh +34 -0
  34. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/UnblockableViewValBranching.cc +61 -0
  35. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/UnblockableViewValBranching.hh +45 -0
  36. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/Work.cc +48 -0
  37. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/Work.hh +64 -0
  38. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/WorkComparators.hh +67 -0
  39. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/WorkManager.cc +376 -0
  40. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/WorkManager.hh +96 -0
  41. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/Worker.cc +285 -0
  42. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/Worker.hh +70 -0
  43. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/clean +5 -0
  44. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/configure +2637 -0
  45. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/configure.ac +44 -0
  46. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/myDom.cc +59 -0
  47. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/myspace.cc +119 -0
  48. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/myspace.hh +79 -0
  49. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/qecode.hh +56 -0
  50. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/qsolver_parallel.cc +41 -0
  51. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/qsolver_parallel.hh +43 -0
  52. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/qsolver_qcop.cc +268 -0
  53. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/qsolver_qcop.hh +56 -0
  54. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/qsolver_qcsp.cc +163 -0
  55. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/qsolver_qcsp.hh +63 -0
  56. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/qsolver_unblockable.cc +423 -0
  57. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/qsolver_unblockable.hh +84 -0
  58. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/shortdesc.ac +1 -0
  59. data/ext/libgecode3/vendor/gecode-3.7.3/contribs/qecode/vartype.hh +31 -0
  60. data/ext/libgecode3/vendor/gecode-3.7.3/doxygen/doxygen.conf.in +1245 -0
  61. data/ext/libgecode3/vendor/gecode-3.7.3/doxygen/doxygen.hh.in +594 -0
  62. data/ext/libgecode3/vendor/gecode-3.7.3/examples/all-interval.cpp +136 -0
  63. data/ext/libgecode3/vendor/gecode-3.7.3/examples/alpha.cpp +151 -0
  64. data/ext/libgecode3/vendor/gecode-3.7.3/examples/bacp.cpp +596 -0
  65. data/ext/libgecode3/vendor/gecode-3.7.3/examples/bibd.cpp +182 -0
  66. data/ext/libgecode3/vendor/gecode-3.7.3/examples/bin-packing.cpp +25363 -0
  67. data/ext/libgecode3/vendor/gecode-3.7.3/examples/black-hole.cpp +413 -0
  68. data/ext/libgecode3/vendor/gecode-3.7.3/examples/car-sequencing.cpp +653 -0
  69. data/ext/libgecode3/vendor/gecode-3.7.3/examples/crew.cpp +269 -0
  70. data/ext/libgecode3/vendor/gecode-3.7.3/examples/crossword.cpp +3954 -0
  71. data/ext/libgecode3/vendor/gecode-3.7.3/examples/crowded-chess.cpp +424 -0
  72. data/ext/libgecode3/vendor/gecode-3.7.3/examples/dominating-queens.cpp +170 -0
  73. data/ext/libgecode3/vendor/gecode-3.7.3/examples/domino.cpp +346 -0
  74. data/ext/libgecode3/vendor/gecode-3.7.3/examples/donald.cpp +135 -0
  75. data/ext/libgecode3/vendor/gecode-3.7.3/examples/efpa.cpp +323 -0
  76. data/ext/libgecode3/vendor/gecode-3.7.3/examples/eq20.cpp +128 -0
  77. data/ext/libgecode3/vendor/gecode-3.7.3/examples/golf.cpp +190 -0
  78. data/ext/libgecode3/vendor/gecode-3.7.3/examples/golomb-ruler.cpp +157 -0
  79. data/ext/libgecode3/vendor/gecode-3.7.3/examples/graph-color.cpp +425 -0
  80. data/ext/libgecode3/vendor/gecode-3.7.3/examples/grocery.cpp +116 -0
  81. data/ext/libgecode3/vendor/gecode-3.7.3/examples/hamming.cpp +144 -0
  82. data/ext/libgecode3/vendor/gecode-3.7.3/examples/ind-set.cpp +144 -0
  83. data/ext/libgecode3/vendor/gecode-3.7.3/examples/kakuro.cpp +627 -0
  84. data/ext/libgecode3/vendor/gecode-3.7.3/examples/knights.cpp +430 -0
  85. data/ext/libgecode3/vendor/gecode-3.7.3/examples/langford-number.cpp +218 -0
  86. data/ext/libgecode3/vendor/gecode-3.7.3/examples/magic-sequence.cpp +133 -0
  87. data/ext/libgecode3/vendor/gecode-3.7.3/examples/magic-square.cpp +141 -0
  88. data/ext/libgecode3/vendor/gecode-3.7.3/examples/minesweeper.cpp +311 -0
  89. data/ext/libgecode3/vendor/gecode-3.7.3/examples/money.cpp +132 -0
  90. data/ext/libgecode3/vendor/gecode-3.7.3/examples/nonogram.cpp +1215 -0
  91. data/ext/libgecode3/vendor/gecode-3.7.3/examples/open-shop.cpp +412 -0
  92. data/ext/libgecode3/vendor/gecode-3.7.3/examples/ortho-latin.cpp +183 -0
  93. data/ext/libgecode3/vendor/gecode-3.7.3/examples/partition.cpp +145 -0
  94. data/ext/libgecode3/vendor/gecode-3.7.3/examples/pentominoes.cpp +952 -0
  95. data/ext/libgecode3/vendor/gecode-3.7.3/examples/perfect-square.cpp +317 -0
  96. data/ext/libgecode3/vendor/gecode-3.7.3/examples/photo.cpp +166 -0
  97. data/ext/libgecode3/vendor/gecode-3.7.3/examples/queen-armies.cpp +335 -0
  98. data/ext/libgecode3/vendor/gecode-3.7.3/examples/queens.cpp +214 -0
  99. data/ext/libgecode3/vendor/gecode-3.7.3/examples/radiotherapy.cpp +943 -0
  100. data/ext/libgecode3/vendor/gecode-3.7.3/examples/sat.cpp +260 -0
  101. data/ext/libgecode3/vendor/gecode-3.7.3/examples/schurs-lemma.cpp +142 -0
  102. data/ext/libgecode3/vendor/gecode-3.7.3/examples/scowl.hpp +14149 -0
  103. data/ext/libgecode3/vendor/gecode-3.7.3/examples/sports-league.cpp +353 -0
  104. data/ext/libgecode3/vendor/gecode-3.7.3/examples/steel-mill.cpp +654 -0
  105. data/ext/libgecode3/vendor/gecode-3.7.3/examples/steiner.cpp +170 -0
  106. data/ext/libgecode3/vendor/gecode-3.7.3/examples/sudoku.cpp +2294 -0
  107. data/ext/libgecode3/vendor/gecode-3.7.3/examples/tsp.cpp +339 -0
  108. data/ext/libgecode3/vendor/gecode-3.7.3/examples/warehouses.cpp +185 -0
  109. data/ext/libgecode3/vendor/gecode-3.7.3/examples/word-square.cpp +168 -0
  110. data/ext/libgecode3/vendor/gecode-3.7.3/gecode.m4 +1272 -0
  111. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/driver.hh +602 -0
  112. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/driver/options.cpp +435 -0
  113. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/driver/options.hpp +418 -0
  114. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/driver/script.cpp +104 -0
  115. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/driver/script.hpp +388 -0
  116. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc.hh +417 -0
  117. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/CHANGES +63 -0
  118. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/ast.hh +492 -0
  119. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/conexpr.hh +82 -0
  120. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/exampleplugin/myplugin.cpp +49 -0
  121. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/exampleplugin/myplugin.hh +47 -0
  122. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/exampleplugin/myplugin.pro +51 -0
  123. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/exampleplugin/test_myplugin.fzn +1 -0
  124. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/flatzinc.cpp +1056 -0
  125. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/lexer.lxx +137 -0
  126. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/lexer.yy.cpp +2458 -0
  127. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/all_different_int.mzn +37 -0
  128. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/all_equal_int.mzn +37 -0
  129. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/among.mzn +37 -0
  130. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/at_least_int.mzn +37 -0
  131. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/at_least_set.mzn +38 -0
  132. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/at_most_int.mzn +37 -0
  133. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/at_most_set.mzn +38 -0
  134. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/bin_packing.mzn +44 -0
  135. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/bin_packing_capa.mzn +45 -0
  136. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/bin_packing_load.mzn +45 -0
  137. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/circuit.mzn +40 -0
  138. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/count.mzn +37 -0
  139. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/cumulative.mzn +53 -0
  140. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/decreasing_bool.mzn +37 -0
  141. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/decreasing_int.mzn +37 -0
  142. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/diffn.mzn +44 -0
  143. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/disjoint.mzn +37 -0
  144. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/distribute.mzn +46 -0
  145. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/exactly_int.mzn +40 -0
  146. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/exactly_set.mzn +38 -0
  147. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/gecode.mzn +98 -0
  148. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/global_cardinality.mzn +43 -0
  149. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/global_cardinality_closed.mzn +39 -0
  150. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/global_cardinality_low_up.mzn +40 -0
  151. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/global_cardinality_low_up_closed.mzn +40 -0
  152. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/increasing_bool.mzn +37 -0
  153. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/increasing_int.mzn +37 -0
  154. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/int_set_channel.mzn +49 -0
  155. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/inverse.mzn +42 -0
  156. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/lex_less_int.mzn +42 -0
  157. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/lex_lesseq_int.mzn +42 -0
  158. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/link_set_to_booleans.mzn +47 -0
  159. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/maximum_int.mzn +37 -0
  160. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/member_bool.mzn +41 -0
  161. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/member_int.mzn +41 -0
  162. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/minimum_int.mzn +37 -0
  163. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/nvalue.mzn +37 -0
  164. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/partition_set.mzn +42 -0
  165. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/precedence.mzn +41 -0
  166. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/range.mzn +51 -0
  167. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/redefinitions.mzn +62 -0
  168. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/regular.mzn +38 -0
  169. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/roots.mzn +63 -0
  170. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/sort.mzn +37 -0
  171. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/sum_pred.mzn +42 -0
  172. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/table_bool.mzn +37 -0
  173. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/mznlib/table_int.mzn +37 -0
  174. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/option.hh +70 -0
  175. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/parser.hh +265 -0
  176. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/parser.tab.cpp +3571 -0
  177. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/parser.tab.hh +164 -0
  178. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/parser.yxx +1604 -0
  179. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/plugin.hh +83 -0
  180. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/registry.cpp +1812 -0
  181. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/registry.hh +71 -0
  182. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/symboltable.hh +96 -0
  183. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/flatzinc/varspec.hh +163 -0
  184. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist.hh +298 -0
  185. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/drawingcursor.cpp +288 -0
  186. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/drawingcursor.hh +110 -0
  187. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/drawingcursor.hpp +84 -0
  188. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/gecodelogo.cpp +673 -0
  189. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/gecodelogo.hh +65 -0
  190. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/gist.cpp +120 -0
  191. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/gist.hpp +207 -0
  192. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/layoutcursor.hh +69 -0
  193. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/layoutcursor.hpp +70 -0
  194. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/mainwindow.cpp +341 -0
  195. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/mainwindow.hh +129 -0
  196. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/node.cpp +82 -0
  197. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/node.hh +160 -0
  198. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/node.hpp +210 -0
  199. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/nodecursor.hh +215 -0
  200. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/nodecursor.hpp +271 -0
  201. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/nodestats.cpp +138 -0
  202. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/nodestats.hh +81 -0
  203. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/nodevisitor.hh +96 -0
  204. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/nodevisitor.hpp +126 -0
  205. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/nodewidget.cpp +90 -0
  206. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/nodewidget.hh +59 -0
  207. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/preferences.cpp +190 -0
  208. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/preferences.hh +96 -0
  209. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/qtgist.cpp +809 -0
  210. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/qtgist.hh +294 -0
  211. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/spacenode.cpp +369 -0
  212. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/spacenode.hh +221 -0
  213. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/spacenode.hpp +191 -0
  214. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/standalone-example/mygist.cpp +80 -0
  215. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/standalone-example/standalone_example.pro +18 -0
  216. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/stopbrancher.cpp +90 -0
  217. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/stopbrancher.hh +82 -0
  218. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/textoutput.cpp +175 -0
  219. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/textoutput.hh +75 -0
  220. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/treecanvas.cpp +1430 -0
  221. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/treecanvas.hh +369 -0
  222. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/visualnode.cpp +473 -0
  223. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/visualnode.hh +237 -0
  224. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/visualnode.hpp +220 -0
  225. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/gist/zoomToFitIcon.hpp +114 -0
  226. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int.hh +3477 -0
  227. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/arithmetic.cpp +185 -0
  228. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/arithmetic.hh +666 -0
  229. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/arithmetic/abs.hpp +236 -0
  230. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/arithmetic/divmod.hpp +350 -0
  231. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/arithmetic/max.hpp +398 -0
  232. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/arithmetic/mult.hpp +750 -0
  233. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/arithmetic/sqr.hpp +377 -0
  234. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/arithmetic/sqrt.hpp +217 -0
  235. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/array-traits.hpp +147 -0
  236. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/array.cpp +113 -0
  237. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/array.hpp +111 -0
  238. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/bin-packing.cpp +71 -0
  239. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/bin-packing.hh +184 -0
  240. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/bin-packing/propagate.cpp +388 -0
  241. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/bin-packing/propagate.hpp +219 -0
  242. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/bool.cpp +755 -0
  243. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/bool.hh +581 -0
  244. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/bool/base.hpp +137 -0
  245. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/bool/clause.hpp +353 -0
  246. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/bool/eq.hpp +196 -0
  247. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/bool/eqv.cpp +104 -0
  248. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/bool/eqv.hpp +202 -0
  249. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/bool/lq.hpp +241 -0
  250. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/bool/or.hpp +850 -0
  251. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/branch.cpp +152 -0
  252. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/branch.hh +607 -0
  253. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/branch/post-val-bool.hpp +81 -0
  254. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/branch/post-val-int.hpp +107 -0
  255. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/branch/post-view-bool.bs +121 -0
  256. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/branch/post-view-bool.cpp +438 -0
  257. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/branch/post-view-int.bs +121 -0
  258. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/branch/post-view-int.cpp +438 -0
  259. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/branch/select-val.hpp +229 -0
  260. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/branch/select-values.hpp +213 -0
  261. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/branch/select-view.hpp +364 -0
  262. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/channel.cpp +172 -0
  263. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/channel.hh +249 -0
  264. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/channel/base.hpp +78 -0
  265. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/channel/dom.hpp +332 -0
  266. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/channel/link-multi.cpp +241 -0
  267. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/channel/link-multi.hpp +84 -0
  268. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/channel/link-single.cpp +77 -0
  269. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/channel/link-single.hpp +71 -0
  270. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/channel/val.hpp +256 -0
  271. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/circuit.cpp +229 -0
  272. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/circuit.hh +160 -0
  273. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/circuit/base.hpp +270 -0
  274. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/circuit/dom.hpp +128 -0
  275. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/circuit/val.hpp +105 -0
  276. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/count.cpp +417 -0
  277. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/count.hh +410 -0
  278. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/count/int-base.hpp +80 -0
  279. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/count/int-eq.hpp +143 -0
  280. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/count/int-gq.hpp +137 -0
  281. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/count/int-lq.hpp +136 -0
  282. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/count/rel.hpp +281 -0
  283. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/count/view-base.hpp +131 -0
  284. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/count/view-eq.hpp +117 -0
  285. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/count/view-gq.hpp +109 -0
  286. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/count/view-lq.hpp +96 -0
  287. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/cumulative.cpp +432 -0
  288. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/cumulative.hh +745 -0
  289. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/cumulative/basic.hpp +211 -0
  290. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/cumulative/edge-finding.hpp +185 -0
  291. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/cumulative/man-prop.hpp +127 -0
  292. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/cumulative/opt-prop.hpp +171 -0
  293. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/cumulative/overload.hpp +63 -0
  294. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/cumulative/task-view.hpp +84 -0
  295. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/cumulative/task.hpp +256 -0
  296. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/cumulative/tree.hpp +272 -0
  297. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/cumulatives.cpp +187 -0
  298. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/cumulatives.hh +133 -0
  299. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/cumulatives/val.hpp +380 -0
  300. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/distinct.cpp +97 -0
  301. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/distinct.hh +314 -0
  302. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/distinct/bnd.hpp +444 -0
  303. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/distinct/dom-ctrl.hpp +81 -0
  304. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/distinct/dom.hpp +123 -0
  305. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/distinct/graph.hpp +266 -0
  306. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/distinct/ter-dom.hpp +113 -0
  307. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/distinct/val.hpp +185 -0
  308. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/dom.cpp +135 -0
  309. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/dom.hh +118 -0
  310. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/dom/range.hpp +105 -0
  311. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/dom/spec.hpp +124 -0
  312. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/element.cpp +190 -0
  313. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/element.hh +384 -0
  314. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/element/int.hpp +443 -0
  315. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/element/pair.cpp +151 -0
  316. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/element/pair.hpp +74 -0
  317. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/element/view.hpp +559 -0
  318. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/exception.hpp +196 -0
  319. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/exec.cpp +83 -0
  320. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/exec.hh +87 -0
  321. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/exec/when.cpp +77 -0
  322. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/exec/when.hpp +51 -0
  323. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/extensional.cpp +124 -0
  324. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/extensional.hh +508 -0
  325. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/extensional/base.hpp +163 -0
  326. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/extensional/basic.hpp +148 -0
  327. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/extensional/dfa.cpp +535 -0
  328. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/extensional/dfa.hpp +282 -0
  329. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/extensional/incremental.hpp +454 -0
  330. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/extensional/layered-graph.hpp +982 -0
  331. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/extensional/tuple-set.cpp +222 -0
  332. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/extensional/tuple-set.hpp +184 -0
  333. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/gcc.cpp +172 -0
  334. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/gcc.hh +268 -0
  335. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/gcc/bnd-sup.hpp +608 -0
  336. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/gcc/bnd.hpp +829 -0
  337. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/gcc/dom-sup.hpp +1777 -0
  338. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/gcc/dom.hpp +315 -0
  339. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/gcc/post.hpp +169 -0
  340. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/gcc/val.hpp +299 -0
  341. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/gcc/view.hpp +410 -0
  342. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/int-set-1.hpp +249 -0
  343. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/int-set-2.hpp +51 -0
  344. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/int-set.cpp +167 -0
  345. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/limits.hpp +94 -0
  346. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/linear-bool.cpp +196 -0
  347. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/linear-int.cpp +194 -0
  348. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/linear.hh +1560 -0
  349. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/linear/bool-int.hpp +743 -0
  350. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/linear/bool-post.cpp +602 -0
  351. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/linear/bool-scale.hpp +695 -0
  352. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/linear/bool-view.hpp +319 -0
  353. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/linear/int-bin.hpp +439 -0
  354. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/linear/int-dom.hpp +484 -0
  355. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/linear/int-nary.hpp +864 -0
  356. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/linear/int-noview.hpp +251 -0
  357. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/linear/int-post.cpp +561 -0
  358. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/linear/int-ter.hpp +273 -0
  359. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/linear/post.hpp +152 -0
  360. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/member.cpp +85 -0
  361. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/member.hh +125 -0
  362. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/member/prop.hpp +175 -0
  363. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/member/re-prop.hpp +178 -0
  364. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/no-overlap.cpp +226 -0
  365. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/no-overlap.hh +318 -0
  366. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/no-overlap/base.hpp +88 -0
  367. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/no-overlap/box.hpp +198 -0
  368. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/no-overlap/dim.hpp +197 -0
  369. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/no-overlap/man.hpp +119 -0
  370. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/no-overlap/opt.hpp +153 -0
  371. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/nvalues.cpp +244 -0
  372. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/nvalues.hh +429 -0
  373. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/nvalues/bool-base.hpp +98 -0
  374. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/nvalues/bool-eq.hpp +174 -0
  375. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/nvalues/bool-gq.hpp +149 -0
  376. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/nvalues/bool-lq.hpp +151 -0
  377. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/nvalues/graph.hpp +283 -0
  378. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/nvalues/int-base.hpp +347 -0
  379. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/nvalues/int-eq.hpp +167 -0
  380. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/nvalues/int-gq.hpp +130 -0
  381. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/nvalues/int-lq.hpp +154 -0
  382. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/nvalues/range-event.hpp +51 -0
  383. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/nvalues/sym-bit-matrix.hpp +69 -0
  384. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/precede.cpp +73 -0
  385. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/precede.hh +113 -0
  386. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/precede/single.hpp +232 -0
  387. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/propagator.hpp +311 -0
  388. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/rel.cpp +381 -0
  389. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/rel.hh +665 -0
  390. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/rel/eq.hpp +676 -0
  391. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/rel/lex.hpp +414 -0
  392. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/rel/lq-le.hpp +537 -0
  393. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/rel/nq.hpp +196 -0
  394. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/sequence.cpp +197 -0
  395. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/sequence.hh +154 -0
  396. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/sequence/int.hpp +168 -0
  397. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/sequence/set-op.hpp +154 -0
  398. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/sequence/view.hpp +499 -0
  399. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/sequence/violations.hpp +101 -0
  400. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/sorted.cpp +82 -0
  401. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/sorted.hh +107 -0
  402. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/sorted/matching.hpp +173 -0
  403. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/sorted/narrowing.hpp +250 -0
  404. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/sorted/order.hpp +213 -0
  405. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/sorted/propagate.hpp +646 -0
  406. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/sorted/sortsup.hpp +564 -0
  407. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/support-values.hh +154 -0
  408. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/support-values.hpp +187 -0
  409. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/task.hh +454 -0
  410. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/task/array.hpp +179 -0
  411. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/task/fwd-to-bwd.hpp +102 -0
  412. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/task/iter.hpp +92 -0
  413. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/task/man-to-opt.hpp +100 -0
  414. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/task/prop.hpp +70 -0
  415. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/task/purge.hpp +74 -0
  416. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/task/sort.hpp +234 -0
  417. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/task/tree.hpp +189 -0
  418. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/unary.cpp +258 -0
  419. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/unary.hh +839 -0
  420. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/unary/detectable.hpp +116 -0
  421. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/unary/edge-finding.hpp +78 -0
  422. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/unary/man-prop.hpp +78 -0
  423. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/unary/not-first-not-last.hpp +133 -0
  424. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/unary/opt-prop.hpp +116 -0
  425. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/unary/overload.hpp +93 -0
  426. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/unary/subsumption.hpp +55 -0
  427. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/unary/task-view.hpp +105 -0
  428. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/unary/task.hpp +532 -0
  429. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/unary/tree.hpp +229 -0
  430. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/unshare.cpp +146 -0
  431. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/val-set.hh +118 -0
  432. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/val-set.hpp +186 -0
  433. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/var-imp.hpp +710 -0
  434. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/var-imp/bool.cpp +65 -0
  435. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/var-imp/bool.hpp +431 -0
  436. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/var-imp/bool.vis +75 -0
  437. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/var-imp/delta.hpp +64 -0
  438. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/var-imp/int.cpp +361 -0
  439. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/var-imp/int.hpp +1029 -0
  440. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/var-imp/int.vis +117 -0
  441. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/var/bool.cpp +53 -0
  442. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/var/bool.hpp +121 -0
  443. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/var/int.cpp +61 -0
  444. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/var/int.hpp +145 -0
  445. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/var/print.hpp +56 -0
  446. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view-val-graph.hh +334 -0
  447. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view-val-graph/bi-link.hpp +89 -0
  448. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view-val-graph/comb-ptr-flag.hpp +78 -0
  449. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view-val-graph/edge.hpp +124 -0
  450. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view-val-graph/graph.hpp +202 -0
  451. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view-val-graph/iter-prune-val.hpp +70 -0
  452. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view-val-graph/node.hpp +171 -0
  453. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view.hpp +1690 -0
  454. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view/bool-test.hpp +64 -0
  455. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view/bool.hpp +314 -0
  456. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view/cached.hpp +402 -0
  457. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view/constint.hpp +324 -0
  458. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view/int.hpp +264 -0
  459. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view/iter.hpp +65 -0
  460. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view/minus.hpp +300 -0
  461. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view/neg-bool.hpp +177 -0
  462. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view/offset.hpp +303 -0
  463. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view/print.hpp +162 -0
  464. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view/rel-test.hpp +231 -0
  465. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view/scale.hpp +368 -0
  466. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/int/view/zero.hpp +305 -0
  467. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter.hh +96 -0
  468. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-add.hpp +144 -0
  469. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-append.hpp +222 -0
  470. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-array.hpp +139 -0
  471. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-cache.hpp +106 -0
  472. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-compl.hpp +220 -0
  473. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-diff.hpp +142 -0
  474. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-empty.hpp +111 -0
  475. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-inter.hpp +309 -0
  476. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-list.hpp +263 -0
  477. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-map.hpp +260 -0
  478. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-minmax.hpp +118 -0
  479. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-minus.hpp +107 -0
  480. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-negative.hpp +137 -0
  481. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-offset.hpp +127 -0
  482. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-operations.hpp +157 -0
  483. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-positive.hpp +139 -0
  484. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-rangelist.hpp +115 -0
  485. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-scale.hpp +238 -0
  486. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-singleton-append.hpp +111 -0
  487. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-singleton.hpp +86 -0
  488. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-size.hpp +146 -0
  489. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-union.hpp +361 -0
  490. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/ranges-values.hpp +140 -0
  491. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/values-array.hpp +120 -0
  492. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/values-bitset.hpp +114 -0
  493. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/values-inter.hpp +130 -0
  494. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/values-list.hpp +186 -0
  495. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/values-map.hpp +136 -0
  496. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/values-minus.hpp +105 -0
  497. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/values-negative.hpp +116 -0
  498. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/values-offset.hpp +113 -0
  499. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/values-positive.hpp +123 -0
  500. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/values-ranges.hpp +106 -0
  501. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/values-singleton.hpp +109 -0
  502. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/values-union.hpp +137 -0
  503. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/iter/values-unique.hpp +118 -0
  504. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel.hh +194 -0
  505. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/advisor.hpp +102 -0
  506. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/allocators.hpp +476 -0
  507. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/archive.cpp +70 -0
  508. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/archive.hpp +298 -0
  509. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/array.hpp +2133 -0
  510. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/branch.cpp +121 -0
  511. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/branch.hpp +254 -0
  512. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/brancher-tiebreak.hpp +615 -0
  513. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/brancher-val.hpp +126 -0
  514. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/brancher-view.hpp +455 -0
  515. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/brancher.hpp +431 -0
  516. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/core.cpp +563 -0
  517. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/core.hpp +3668 -0
  518. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/exception.hpp +124 -0
  519. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/global-prop-info.hpp +258 -0
  520. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/macros.hpp +118 -0
  521. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/memory-config.hpp +154 -0
  522. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/memory-manager.cpp +53 -0
  523. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/memory-manager.hpp +511 -0
  524. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/modevent.hpp +69 -0
  525. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/propagator.hpp +699 -0
  526. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/range-list.hpp +184 -0
  527. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/region.cpp +85 -0
  528. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/region.hpp +459 -0
  529. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/shared-array.hpp +345 -0
  530. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/var-imp.hpp +332 -0
  531. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/var-type.hpp +767 -0
  532. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/var.hpp +144 -0
  533. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/view.hpp +715 -0
  534. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/kernel/wait.hh +244 -0
  535. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/minimodel.hh +1870 -0
  536. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/minimodel/arithmetic.cpp +408 -0
  537. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/minimodel/bool-expr.cpp +522 -0
  538. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/minimodel/bool-expr.hpp +87 -0
  539. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/minimodel/exception.hpp +84 -0
  540. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/minimodel/lin-expr.cpp +594 -0
  541. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/minimodel/lin-expr.hpp +297 -0
  542. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/minimodel/lin-rel.cpp +414 -0
  543. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/minimodel/lin-rel.hpp +85 -0
  544. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/minimodel/matrix.hpp +247 -0
  545. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/minimodel/optimize.hpp +62 -0
  546. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/minimodel/reg.cpp +817 -0
  547. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/minimodel/reg.hpp +94 -0
  548. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/minimodel/set-expr.cpp +704 -0
  549. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/minimodel/set-expr.hpp +96 -0
  550. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/minimodel/set-rel.cpp +81 -0
  551. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/minimodel/set-rel.hpp +84 -0
  552. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search.hh +458 -0
  553. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/bab.cpp +62 -0
  554. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/bab.hpp +91 -0
  555. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/dfs.cpp +62 -0
  556. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/dfs.hpp +84 -0
  557. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/options.cpp +72 -0
  558. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/options.hpp +49 -0
  559. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/parallel/bab.cpp +178 -0
  560. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/parallel/bab.hh +203 -0
  561. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/parallel/dfs.cpp +176 -0
  562. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/parallel/dfs.hh +195 -0
  563. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/parallel/engine.cpp +118 -0
  564. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/parallel/engine.hh +418 -0
  565. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/parallel/path.hh +477 -0
  566. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/parallel/restart.cpp +167 -0
  567. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/parallel/restart.hh +73 -0
  568. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/restart.cpp +62 -0
  569. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/restart.hpp +88 -0
  570. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/sequential/bab.hh +177 -0
  571. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/sequential/dfs.hh +176 -0
  572. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/sequential/path.hh +411 -0
  573. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/sequential/restart.hh +89 -0
  574. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/statistics.hpp +70 -0
  575. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/stop.cpp +83 -0
  576. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/stop.hpp +137 -0
  577. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/support.hh +91 -0
  578. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/search/worker.hh +202 -0
  579. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set.hh +1144 -0
  580. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/array-traits.hpp +86 -0
  581. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/array.cpp +219 -0
  582. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/array.hpp +64 -0
  583. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/branch.cpp +128 -0
  584. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/branch.hh +438 -0
  585. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/branch/post-val.hpp +107 -0
  586. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/branch/post-view.bs +109 -0
  587. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/branch/post-view.cpp +370 -0
  588. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/branch/select-val.hpp +204 -0
  589. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/branch/select-view.hpp +306 -0
  590. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/cardinality.cpp +65 -0
  591. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/convex.cpp +60 -0
  592. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/convex.hh +107 -0
  593. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/convex/conv.cpp +97 -0
  594. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/convex/conv.hpp +67 -0
  595. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/convex/hull.cpp +116 -0
  596. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/convex/hull.hpp +68 -0
  597. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/distinct.cpp +56 -0
  598. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/distinct.hh +79 -0
  599. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/distinct/atmostOne.cpp +162 -0
  600. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/distinct/atmostOne.hpp +66 -0
  601. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/dom.cpp +300 -0
  602. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/element.cpp +255 -0
  603. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/element.hh +218 -0
  604. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/element/disjoint.hpp +324 -0
  605. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/element/inter.hpp +308 -0
  606. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/element/union.hpp +342 -0
  607. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/element/unionConst.hpp +293 -0
  608. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/exception.hpp +146 -0
  609. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/exec.cpp +58 -0
  610. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/int.cpp +191 -0
  611. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/int.hh +459 -0
  612. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/int/card.hpp +93 -0
  613. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/int/channel-bool.hpp +282 -0
  614. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/int/channel-int.hpp +158 -0
  615. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/int/match.hpp +199 -0
  616. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/int/minmax.hpp +645 -0
  617. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/int/weights.hpp +353 -0
  618. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/limits.hpp +62 -0
  619. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/precede.cpp +74 -0
  620. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/precede.hh +115 -0
  621. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/precede/single.hpp +255 -0
  622. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op-const-cvc.cpp +66 -0
  623. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op-const-cvv.cpp +65 -0
  624. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op-const-vcc.cpp +168 -0
  625. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op-const-vcv.cpp +166 -0
  626. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op-const-vvc.cpp +63 -0
  627. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op-singleton.cpp +115 -0
  628. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op-ternary.cpp +60 -0
  629. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op.cpp +105 -0
  630. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op.hh +297 -0
  631. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op/common.hpp +619 -0
  632. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op/inter.hpp +389 -0
  633. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op/partition.hpp +164 -0
  634. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op/post-compl-cvc.cpp +58 -0
  635. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op/post-compl-cvv.cpp +54 -0
  636. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op/post-compl-vvc.cpp +57 -0
  637. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op/post-compl.cpp +54 -0
  638. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op/post-nocompl-cvc.cpp +55 -0
  639. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op/post-nocompl-cvv.cpp +54 -0
  640. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op/post-nocompl-vvc.cpp +54 -0
  641. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op/post-nocompl.cpp +54 -0
  642. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op/post.hpp +266 -0
  643. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op/subofunion.hpp +166 -0
  644. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op/superofinter.hpp +167 -0
  645. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel-op/union.hpp +319 -0
  646. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel.cpp +232 -0
  647. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel.hh +322 -0
  648. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel/common.hpp +125 -0
  649. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel/eq.hpp +116 -0
  650. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel/lq.hpp +417 -0
  651. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel/nosubset.hpp +104 -0
  652. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel/nq.hpp +160 -0
  653. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel/re-eq.hpp +152 -0
  654. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel/re-lq.hpp +182 -0
  655. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel/re-subset.hpp +146 -0
  656. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/rel/subset.hpp +96 -0
  657. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/sequence.cpp +64 -0
  658. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/sequence.hh +115 -0
  659. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/sequence/common.hpp +100 -0
  660. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/sequence/seq-u.cpp +145 -0
  661. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/sequence/seq-u.hpp +79 -0
  662. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/sequence/seq.cpp +76 -0
  663. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/sequence/seq.hpp +69 -0
  664. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/var-imp.hpp +634 -0
  665. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/var-imp/delta.hpp +78 -0
  666. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/var-imp/integerset.cpp +348 -0
  667. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/var-imp/integerset.hpp +426 -0
  668. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/var-imp/iter.hpp +63 -0
  669. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/var-imp/set.cpp +142 -0
  670. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/var-imp/set.hpp +531 -0
  671. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/var-imp/set.vis +197 -0
  672. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/var/print.hpp +49 -0
  673. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/var/set.cpp +111 -0
  674. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/var/set.hpp +254 -0
  675. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/view.hpp +1142 -0
  676. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/view/cached.hpp +399 -0
  677. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/view/complement.hpp +556 -0
  678. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/view/const.hpp +723 -0
  679. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/view/print.hpp +140 -0
  680. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/view/set.hpp +263 -0
  681. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/set/view/singleton.hpp +402 -0
  682. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support.hh +135 -0
  683. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/auto-link.hpp +73 -0
  684. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/bitset-base.hpp +379 -0
  685. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/bitset.hpp +81 -0
  686. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/block-allocator.hpp +169 -0
  687. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/cast.hpp +52 -0
  688. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/config.hpp.in +109 -0
  689. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/dynamic-array.hpp +140 -0
  690. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/dynamic-queue.hpp +156 -0
  691. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/dynamic-stack.hpp +186 -0
  692. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/exception.cpp +65 -0
  693. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/exception.hpp +102 -0
  694. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/heap.cpp +49 -0
  695. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/heap.hpp +593 -0
  696. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/int-type.hpp +172 -0
  697. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/macros.hpp +103 -0
  698. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/marked-pointer.hpp +79 -0
  699. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/random.hpp +128 -0
  700. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/sort.hpp +268 -0
  701. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/static-stack.hpp +148 -0
  702. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/thread.hpp +272 -0
  703. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/thread/none.hpp +87 -0
  704. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/thread/pthreads.cpp +66 -0
  705. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/thread/pthreads.hpp +142 -0
  706. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/thread/thread.cpp +72 -0
  707. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/thread/thread.hpp +114 -0
  708. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/thread/windows.cpp +68 -0
  709. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/thread/windows.hpp +108 -0
  710. data/ext/libgecode3/vendor/gecode-3.7.3/gecode/support/timer.hpp +103 -0
  711. data/ext/libgecode3/vendor/gecode-3.7.3/install-sh +323 -0
  712. data/ext/libgecode3/vendor/gecode-3.7.3/misc/allexamples.perl +60 -0
  713. data/ext/libgecode3/vendor/gecode-3.7.3/misc/doxygen/back.png +0 -0
  714. data/ext/libgecode3/vendor/gecode-3.7.3/misc/doxygen/footer.html +3 -0
  715. data/ext/libgecode3/vendor/gecode-3.7.3/misc/doxygen/gecode-logo-100.png +0 -0
  716. data/ext/libgecode3/vendor/gecode-3.7.3/misc/doxygen/header.html +66 -0
  717. data/ext/libgecode3/vendor/gecode-3.7.3/misc/doxygen/stylesheet.css +468 -0
  718. data/ext/libgecode3/vendor/gecode-3.7.3/misc/fixautoheader.perl +55 -0
  719. data/ext/libgecode3/vendor/gecode-3.7.3/misc/fixmanifest.perl +84 -0
  720. data/ext/libgecode3/vendor/gecode-3.7.3/misc/fixproperties.sh +98 -0
  721. data/ext/libgecode3/vendor/gecode-3.7.3/misc/gecode-logo.ico +0 -0
  722. data/ext/libgecode3/vendor/gecode-3.7.3/misc/genbranch.perl +310 -0
  723. data/ext/libgecode3/vendor/gecode-3.7.3/misc/genchangelog.perl +249 -0
  724. data/ext/libgecode3/vendor/gecode-3.7.3/misc/gencurrentchangelog.perl +191 -0
  725. data/ext/libgecode3/vendor/gecode-3.7.3/misc/genlcovmakefile.perl +148 -0
  726. data/ext/libgecode3/vendor/gecode-3.7.3/misc/genlicense.perl +121 -0
  727. data/ext/libgecode3/vendor/gecode-3.7.3/misc/genrc.perl +236 -0
  728. data/ext/libgecode3/vendor/gecode-3.7.3/misc/genstatistics.perl +178 -0
  729. data/ext/libgecode3/vendor/gecode-3.7.3/misc/gentxtchangelog.perl +198 -0
  730. data/ext/libgecode3/vendor/gecode-3.7.3/misc/genvarimp.perl +877 -0
  731. data/ext/libgecode3/vendor/gecode-3.7.3/misc/genxcodeproj.perl +144 -0
  732. data/ext/libgecode3/vendor/gecode-3.7.3/misc/getrevision.perl +47 -0
  733. data/ext/libgecode3/vendor/gecode-3.7.3/misc/makedepend.perl +85 -0
  734. data/ext/libgecode3/vendor/gecode-3.7.3/misc/svn-ignore-root.txt +43 -0
  735. data/ext/libgecode3/vendor/gecode-3.7.3/misc/svn-ignore.txt +18 -0
  736. data/ext/libgecode3/vendor/gecode-3.7.3/test/afc.cpp +143 -0
  737. data/ext/libgecode3/vendor/gecode-3.7.3/test/array.cpp +277 -0
  738. data/ext/libgecode3/vendor/gecode-3.7.3/test/assign.cpp +278 -0
  739. data/ext/libgecode3/vendor/gecode-3.7.3/test/assign.hh +119 -0
  740. data/ext/libgecode3/vendor/gecode-3.7.3/test/assign/bool.cpp +61 -0
  741. data/ext/libgecode3/vendor/gecode-3.7.3/test/assign/int.cpp +70 -0
  742. data/ext/libgecode3/vendor/gecode-3.7.3/test/assign/set.cpp +72 -0
  743. data/ext/libgecode3/vendor/gecode-3.7.3/test/branch.cpp +504 -0
  744. data/ext/libgecode3/vendor/gecode-3.7.3/test/branch.hh +119 -0
  745. data/ext/libgecode3/vendor/gecode-3.7.3/test/branch/bool.cpp +61 -0
  746. data/ext/libgecode3/vendor/gecode-3.7.3/test/branch/int.cpp +70 -0
  747. data/ext/libgecode3/vendor/gecode-3.7.3/test/branch/set.cpp +72 -0
  748. data/ext/libgecode3/vendor/gecode-3.7.3/test/int.cpp +655 -0
  749. data/ext/libgecode3/vendor/gecode-3.7.3/test/int.hh +353 -0
  750. data/ext/libgecode3/vendor/gecode-3.7.3/test/int.hpp +314 -0
  751. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/arithmetic.cpp +772 -0
  752. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/basic.cpp +82 -0
  753. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/bin-packing.cpp +237 -0
  754. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/bool.cpp +500 -0
  755. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/channel.cpp +234 -0
  756. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/circuit.cpp +359 -0
  757. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/count.cpp +410 -0
  758. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/cumulative.cpp +560 -0
  759. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/cumulatives.cpp +276 -0
  760. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/distinct.cpp +248 -0
  761. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/dom.cpp +174 -0
  762. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/element.cpp +602 -0
  763. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/exec.cpp +150 -0
  764. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/extensional.cpp +571 -0
  765. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/gcc.cpp +320 -0
  766. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/linear.cpp +394 -0
  767. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/member.cpp +138 -0
  768. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/mm-arithmetic.cpp +368 -0
  769. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/mm-bool.cpp +4344 -0
  770. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/mm-count.cpp +295 -0
  771. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/mm-lin.cpp +2179 -0
  772. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/mm-rel.cpp +136 -0
  773. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/no-overlap.cpp +259 -0
  774. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/nvalues.cpp +241 -0
  775. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/precede.cpp +115 -0
  776. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/rel.cpp +568 -0
  777. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/sequence.cpp +168 -0
  778. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/sorted.cpp +165 -0
  779. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/unary.cpp +327 -0
  780. data/ext/libgecode3/vendor/gecode-3.7.3/test/int/unshare.cpp +109 -0
  781. data/ext/libgecode3/vendor/gecode-3.7.3/test/search.cpp +487 -0
  782. data/ext/libgecode3/vendor/gecode-3.7.3/test/set.cpp +638 -0
  783. data/ext/libgecode3/vendor/gecode-3.7.3/test/set.hh +362 -0
  784. data/ext/libgecode3/vendor/gecode-3.7.3/test/set.hpp +121 -0
  785. data/ext/libgecode3/vendor/gecode-3.7.3/test/set/construct.cpp +225 -0
  786. data/ext/libgecode3/vendor/gecode-3.7.3/test/set/convex.cpp +139 -0
  787. data/ext/libgecode3/vendor/gecode-3.7.3/test/set/distinct.cpp +116 -0
  788. data/ext/libgecode3/vendor/gecode-3.7.3/test/set/dom.cpp +346 -0
  789. data/ext/libgecode3/vendor/gecode-3.7.3/test/set/element.cpp +397 -0
  790. data/ext/libgecode3/vendor/gecode-3.7.3/test/set/exec.cpp +86 -0
  791. data/ext/libgecode3/vendor/gecode-3.7.3/test/set/int.cpp +532 -0
  792. data/ext/libgecode3/vendor/gecode-3.7.3/test/set/mm-set.cpp +4532 -0
  793. data/ext/libgecode3/vendor/gecode-3.7.3/test/set/precede.cpp +136 -0
  794. data/ext/libgecode3/vendor/gecode-3.7.3/test/set/rel-op-const.cpp +368 -0
  795. data/ext/libgecode3/vendor/gecode-3.7.3/test/set/rel-op.cpp +504 -0
  796. data/ext/libgecode3/vendor/gecode-3.7.3/test/set/rel.cpp +157 -0
  797. data/ext/libgecode3/vendor/gecode-3.7.3/test/set/sequence.cpp +133 -0
  798. data/ext/libgecode3/vendor/gecode-3.7.3/test/test.cpp +281 -0
  799. data/ext/libgecode3/vendor/gecode-3.7.3/test/test.hh +161 -0
  800. data/ext/libgecode3/vendor/gecode-3.7.3/test/test.hpp +76 -0
  801. data/ext/libgecode3/vendor/gecode-3.7.3/tools/flatzinc/fz.cpp +93 -0
  802. data/ext/libgecode3/vendor/gecode-3.7.3/tools/flatzinc/mzn-gecode.bat.in +41 -0
  803. data/ext/libgecode3/vendor/gecode-3.7.3/tools/flatzinc/mzn-gecode.in +41 -0
  804. data/lib/dep-selector-libgecode.rb +15 -0
  805. data/lib/dep-selector-libgecode/version.rb +3 -0
  806. metadata +878 -0
@@ -0,0 +1,1777 @@
1
+ /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Main authors:
4
+ * Patrick Pekczynski <pekczynski@ps.uni-sb.de>
5
+ *
6
+ * Contributing authors:
7
+ * Christian Schulte <schulte@gecode.org>
8
+ * Guido Tack <tack@gecode.org>
9
+ *
10
+ * Copyright:
11
+ * Patrick Pekczynski, 2005
12
+ * Christian Schulte, 2009
13
+ * Guido Tack, 2009
14
+ *
15
+ * Last modified:
16
+ * $Date: 2011-09-01 23:04:29 +1000 (Thu, 01 Sep 2011) $ by $Author: schulte $
17
+ * $Revision: 12384 $
18
+ *
19
+ * This file is part of Gecode, the generic constraint
20
+ * development environment:
21
+ * http://www.gecode.org
22
+ *
23
+ * Permission is hereby granted, free of charge, to any person obtaining
24
+ * a copy of this software and associated documentation files (the
25
+ * "Software"), to deal in the Software without restriction, including
26
+ * without limitation the rights to use, copy, modify, merge, publish,
27
+ * distribute, sublicense, and/or sell copies of the Software, and to
28
+ * permit persons to whom the Software is furnished to do so, subject to
29
+ * the following conditions:
30
+ *
31
+ * The above copyright notice and this permission notice shall be
32
+ * included in all copies or substantial portions of the Software.
33
+ *
34
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
35
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
37
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
38
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
39
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
40
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41
+ *
42
+ */
43
+
44
+ namespace Gecode { namespace Int { namespace GCC {
45
+
46
+ /**
47
+ * \brief Bounds constraint (BC) type
48
+ *
49
+ * If BC = UBC, then we argue about the Upper Bounds Constraint
50
+ * else we use the functions for the Lower Bounds Constraint
51
+ */
52
+ enum BC {UBC = 1, LBC = 0};
53
+
54
+ class Edge;
55
+ /// Base class for nodes in the variable-value-graph
56
+ class Node {
57
+ protected:
58
+ /// Stores all incident edges on the node
59
+ Edge* e;
60
+ /// First edge
61
+ Edge* fst;
62
+ /// Last edge
63
+ Edge* lst;
64
+ /// Single incoming edge used for storing a path in the algorithms
65
+ Edge* ie;
66
+ /// Index
67
+ int idx;
68
+ /// Flags for nodes
69
+ enum NodeFlag {
70
+ /// No flags set
71
+ NF_NONE = 0,
72
+ /// Whether node is a value node
73
+ NF_VAL = 1 << 0,
74
+ /// Whether matched for LBC
75
+ NF_M_LBC = 1 << 1,
76
+ /// Whether matched for UBC
77
+ NF_M_UBC = 1 << 2
78
+ };
79
+ /// Flags for node
80
+ unsigned char nf;
81
+ public:
82
+ /// stores the number of incident edges on the node
83
+ int noe;
84
+
85
+ /// \name Constructors and initialization
86
+ //@{
87
+ /// Default constructor
88
+ Node(void);
89
+ /// Constructor for index \a i that sets type to \a t
90
+ Node(NodeFlag nf, int i);
91
+ //@}
92
+
93
+ /// \name Access
94
+ //@{
95
+ /// Return the type of the node (false for a variable node)
96
+ bool type(void) const;
97
+ /// Return reference to the incident edges
98
+ Edge** adj(void);
99
+ /// Return pointer to the first incident edge
100
+ Edge* first(void) const;
101
+ /// Return pointer to the last incident edge
102
+ Edge* last(void) const;
103
+ /// Return pointer to the node's inedge
104
+ Edge* inedge(void) const;
105
+ /// Get index of either variable or value
106
+ int index(void) const;
107
+ /// check whether a node has been removed from the graph
108
+ bool removed(void) const;
109
+ //@}
110
+
111
+ /// \name Update
112
+ //@{
113
+ /// Set the first edge pointer to \a p
114
+ void first(Edge* p);
115
+ /// Set the last edge pointer to \a p
116
+ void last(Edge* p);
117
+ /// Set the inedge pointer to \a p
118
+ void inedge(Edge* p);
119
+ /// Set index of either variable or value
120
+ void index(int i);
121
+ //@}
122
+
123
+ /// \name Memory management
124
+ //@{
125
+ /// Allocate memory from space
126
+ static void* operator new(size_t s, Space& home);
127
+ /// Free memory (unused)
128
+ static void operator delete(void*, Space&) {};
129
+ /// Needed for exceptions
130
+ static void operator delete(void*) {};
131
+ //@}
132
+ };
133
+
134
+ /// %Variable node
135
+ class VarNode : public Node {
136
+ protected:
137
+ /// Stores the matching edge on this node in the UBC
138
+ Edge* ubm;
139
+ /// Stores the matching edge on this node in the LBC
140
+ Edge* lbm;
141
+ public:
142
+ /// \name Constructors and initialization
143
+ //@{
144
+ /// Default constructor
145
+ VarNode(void);
146
+ /// Creates a variable node with index \a i
147
+ VarNode(int i);
148
+ //@}
149
+
150
+ /// \name Access
151
+ //@{
152
+ /// Return the matching edge on the node
153
+ Edge* get_match(BC bc) const;
154
+ /// tests whether the node is matched or not
155
+ bool matched(BC bc) const;
156
+ //@}
157
+
158
+ /// \name Update
159
+ //@{
160
+ /// Set the pointer of the matching edge to m
161
+ void set_match(BC bc, Edge* m);
162
+ /// Set node to matched
163
+ void match(BC bc);
164
+ /// Unmatch the node
165
+ void unmatch(BC bc);
166
+ //@}
167
+ };
168
+
169
+ /// Value node
170
+ class ValNode : public Node {
171
+ protected:
172
+ /// Minimal required occurence of the value as stored in k
173
+ int _klb;
174
+ /// Maximal required occurence of the value as stored in k
175
+ int _kub;
176
+ /// Index to acces the value via cardinality array k
177
+ int _kidx;
178
+ /// Stores the current number of occurences of the value
179
+ int _kcount;
180
+ /// Store numbre of conflicting matching edges
181
+ int noc;
182
+ /// Minimal capacity of the value node
183
+ int lb;
184
+ /// Smallest maximal capacity of the value node
185
+ int ublow;
186
+ /// Maximal capacity of the value node
187
+ int ub;
188
+ public:
189
+ /// Stores the value of the node
190
+ int val;
191
+
192
+ /// \name Constructors and destructors
193
+ //@{
194
+ /// Default constructor
195
+ ValNode(void);
196
+ /**
197
+ * \brief Constructor for value node
198
+ *
199
+ * with minimal capacity \a min,
200
+ * maximal capacity \a max,
201
+ * the value \a value and the index \a k_access in \a k
202
+ */
203
+ ValNode(int min, int max, int value, int kidx, int kshift, int count);
204
+ //@}
205
+
206
+ /// \name Access
207
+ //@{
208
+ /// get max cap for LBC
209
+ int maxlow(void) const;
210
+ /// Mark the value node as conflicting in case of variable cardinalities
211
+ void card_conflict(int c);
212
+ /// Check whether the value node is conflicting
213
+ int card_conflict(void) const;
214
+ /// Reduce the conflict counter
215
+ void red_conflict(void);
216
+ /// increases the value counter
217
+ void inc(void);
218
+ /// returns the current number of occurences of the value
219
+ int kcount(void) const;
220
+ /// returns the number of incident matching edges on a value node
221
+ int incid_match(BC bc) const;
222
+ /// returns the index in cardinality array k
223
+ int kindex(void) const;
224
+ /// returns \a true if the node is matched in BC, \a false otherwise
225
+ bool matched(BC bc) const;
226
+ /// tests whether the node is a sink
227
+ bool sink(void) const;
228
+ /// tests whether the node is a source
229
+ bool source(void) const;
230
+ /// return the minimal node capacity as stored in \a k
231
+ int kmin(void) const;
232
+ /// return the maximal node capacity as stored in \a k
233
+ int kmax(void) const;
234
+ /// return minimal or maximal capacity
235
+ int kbound(BC bc) const;
236
+ //@}
237
+
238
+ /// \name Update
239
+ //@{
240
+ /// set the max cap for LBC
241
+ void maxlow(int i);
242
+ /// Set how often value occurs
243
+ void kcount(int);
244
+ /// changes the index in the cardinality array k
245
+ void kindex(int);
246
+ /// decrease the node-capacity
247
+ void dec(BC bc);
248
+ /// increase the node-capacity
249
+ void inc(BC bc);
250
+ /// return the the node-capacity
251
+ int cap(BC bc) const;
252
+ /// set the node-capacity to \a c
253
+ void cap(BC bc, int c);
254
+ /// match the node
255
+ void match(BC bc);
256
+ /// unmatch the node
257
+ void unmatch(BC bc);
258
+ /// node reset to original capacity values
259
+ void reset(void);
260
+ /// set the minimal k-capacity to min
261
+ void kmin(int min);
262
+ /// set the maximal k-capacity to max
263
+ void kmax(int max);
264
+ //@}
265
+ };
266
+
267
+ /// Class for edges \f$ e(x,v) \f$ in the variable-value-graph
268
+ class Edge {
269
+ private:
270
+ /// pointer to the variable node
271
+ VarNode* x;
272
+ /// pointer to the value node
273
+ ValNode* v;
274
+ /// pointer to the next edge incident on the same variable node
275
+ Edge* next_edge;
276
+ /// pointer to the previous edge incident on the same variable node
277
+ Edge* prev_edge;
278
+ /// pointer to the next edge on the same value node
279
+ Edge* next_vedge;
280
+ /// pointer to the previous edge on the same value node
281
+ Edge* prev_vedge;
282
+ /// Flags for edges
283
+ enum EdgeFlag {
284
+ /// No flags set
285
+ EF_NONE = 0,
286
+ /// Whether edge is used in LBC
287
+ EF_MRKLB = 1 << 0,
288
+ /// Whether edge is used in UBC
289
+ EF_MRKUB = 1 << 1,
290
+ /// Whether edge is matched in LBC
291
+ EF_LM = 1 << 2,
292
+ /// Whether edge is matched in UBC
293
+ EF_UM = 1 << 3,
294
+ /// Whether edge has been deleted
295
+ EF_DEL = 1 << 4
296
+ };
297
+ /// Flags for edges
298
+ unsigned char ef;
299
+ public:
300
+ /// \name Constructors
301
+ //@{
302
+ /// Default constructor
303
+ Edge(void) {}
304
+ /**
305
+ * \brief Construct edge \f$e(x,v)\f$ from variable node \a x
306
+ * and value node \a y
307
+ */
308
+ Edge(VarNode* x, ValNode* v);
309
+ //@}
310
+
311
+ /// \name Access
312
+ //@{
313
+ /// Whether the edge is used
314
+ bool used(BC bc) const;
315
+ /// return whether the edge is matched
316
+ bool matched(BC bc) const;
317
+ /// return whether the edge has been deleted from the graph
318
+ bool deleted(void) const;
319
+ /**
320
+ * \brief return a pointer to the next edge
321
+ * If \a t is false the function returns the next edge incident on \a x
322
+ * otherwise it returns the next edge incident on \a v
323
+ */
324
+ Edge* next(bool t) const;
325
+ /// return the pointer to the next edge incident on \a x
326
+ Edge* next(void) const;
327
+ /// return the pointer to the previous edge incident on \a x
328
+ Edge* prev(void) const;
329
+ /// return the pointer to the next edge incident on \a v
330
+ Edge* vnext(void) const;
331
+ /// return the pointer to the previous edge incident on \a v
332
+ Edge* vprev(void) const;
333
+ /// return the pointer to the variable node \a x of this edge
334
+ VarNode* getVar(void) const;
335
+ /// return the pointer to the value node \a v of this edge
336
+ ValNode* getVal(void) const;
337
+ /**
338
+ * \brief return pointer to \a x if \a t = true otherwise return \a v
339
+ *
340
+ */
341
+ Node* getMate(bool t) const;
342
+ //@}
343
+
344
+ /// Update
345
+ //@{
346
+ /// Mark the edge as used
347
+ void use(BC bc);
348
+ /// Mark the edge as unused
349
+ void free(BC bc);
350
+ /// Reset the edge (free the edge, and unmatch the edge)
351
+ void reset(BC bc);
352
+ /// Match the edge
353
+ void match(BC bc);
354
+ /// Unmatch the edge and the incident nodes
355
+ void unmatch(BC bc);
356
+ /// Unmatch the edge and ( \a x if t=false, \a v otherwise )
357
+ void unmatch(BC bc, bool t);
358
+ /// Unlink the edge from the linked list of edges
359
+ void unlink(void);
360
+ /// Mark the edge as deleted during synchronization
361
+ void del_edge(void);
362
+ /// Insert the edge again
363
+ void insert_edge(void);
364
+ /// return the reference to the next edge incident on \a x
365
+ Edge** next_ref(void);
366
+ /// return the reference to the previous edge incident on \a x
367
+ Edge** prev_ref(void);
368
+ /// return the reference to the next edge incident on \a v
369
+ Edge** vnext_ref(void);
370
+ /// return the reference to the previous edge incident on \a v
371
+ Edge** vprev_ref(void);
372
+ //@}
373
+
374
+ /// \name Memory management
375
+ //@{
376
+ /// Allocate memory from space
377
+ static void* operator new(size_t s, Space& home);
378
+ /// Free memory (unused)
379
+ static void operator delete(void*, Space&) {};
380
+ /// Needed for exceptions
381
+ static void operator delete(void*) {};
382
+ //@}
383
+ };
384
+
385
+
386
+ /**
387
+ * \brief Variable-value-graph used during propagation
388
+ *
389
+ */
390
+ template<class Card>
391
+ class VarValGraph {
392
+ private:
393
+ /// Temporary stack for nodes
394
+ typedef Support::StaticStack<Node*,Region> NodeStack;
395
+ /// Bitset
396
+ typedef Support::BitSet<Region> BitSet;
397
+ /// Variable partition representing the problem variables
398
+ VarNode** vars;
399
+ /**
400
+ * \brief Value partition
401
+ * For each value
402
+ * \f$ v_i\in V=\left(\bigcup_\{0, \dots, |x|-1\}\right) D_i \f$
403
+ * in the domains of the
404
+ * problem variables there is a node in the graph.
405
+ */
406
+ ValNode** vals;
407
+ /// Cardinality of the variable partition
408
+ int n_var;
409
+ /**
410
+ * \brief Cardinality of the value partition
411
+ *
412
+ * Computed as \f$ |V| = \left(\bigcup_\{0, \dots, |x|-1\}\right) D_i \f$
413
+ */
414
+ int n_val;
415
+ /// Total number of nodes in the graph
416
+ int n_node;
417
+ /**
418
+ * \brief The sum over the minimal capacities of all value nodes
419
+ *
420
+ * \f$sum_min = \sum_{v_i \in V} l_i= k[i].min() \f$
421
+ */
422
+ int sum_min;
423
+ /**
424
+ * \brief The sum over the maximal capacities of all value nodes
425
+ *
426
+ * \f$sum_max = \sum_{v_i \in V} l_i= k[i].max() \f$
427
+ */
428
+ int sum_max;
429
+ public:
430
+ /// \name Constructors and Destructors
431
+ //@{
432
+ /**
433
+ * \brief Constructor for the variable-value-graph
434
+ *
435
+ * The variable parition is initialized with the variables from \a x,
436
+ * the value partition is initialized with the values from \a k.
437
+ **/
438
+ VarValGraph(Space& home,
439
+ ViewArray<IntView>& x, ViewArray<Card>& k,
440
+ int smin, int smax);
441
+ //@}
442
+ /// \name Graph-interface
443
+ //@{
444
+ /// Check whether minimum requirements shrink variable domains
445
+ ExecStatus min_require(Space& home,
446
+ ViewArray<IntView>& x, ViewArray<Card>& k);
447
+
448
+ /**
449
+ * \brief Synchronization of the graph
450
+ *
451
+ * If the graph has already been constructed and some edges have
452
+ * been removed during propagation, this function removes those edges
453
+ * that do not longer belong to the graph associated with the current
454
+ * variable domains.
455
+ */
456
+ ExecStatus sync(Space& home,
457
+ ViewArray<IntView>& x, ViewArray<Card>& k);
458
+ /// Remove edges that do not belong to any maximal matching
459
+ template<BC>
460
+ ExecStatus narrow(Space& home,
461
+ ViewArray<IntView>& x, ViewArray<Card>& k);
462
+
463
+ /** \brief Compute a maximum matching M on the graph
464
+ *
465
+ * - If BC=UBC then \f$|M|= |X|\f$
466
+ * - If BC=LBC then \f$|M|= \sum_{i\in \{ 0, \dots, |X|-1\}}
467
+ * k[i].min()\f$
468
+ */
469
+ template<BC>
470
+ ExecStatus maximum_matching(Space& home);
471
+
472
+ /// Compute possible free alternating paths in the graph
473
+ template<BC>
474
+ void free_alternating_paths(Space& home);
475
+ /// Compute possible strongly connected components of the graph
476
+ template<BC>
477
+ void strongly_connected_components(Space& home);
478
+ /**
479
+ * \brief Test whether the current maximal matching on the graph
480
+ * can be augmented by an alternating path starting and ending with
481
+ * a free node.
482
+ */
483
+ template<BC>
484
+ bool augmenting_path(Space& home, Node*);
485
+
486
+ protected:
487
+ /**
488
+ * \brief Perform depth-first search on the graph
489
+ *
490
+ * Depth first search used to compute the
491
+ * strongly connected components of the graph.
492
+ */
493
+ template<BC>
494
+ void dfs(Node*, BitSet&, BitSet&, int[],
495
+ NodeStack&, NodeStack&, int&);
496
+
497
+ //@}
498
+ public:
499
+ /// Allocate memory for the graph
500
+ void* operator new(size_t t, Space& home);
501
+ /// Deallocation (void)
502
+ void operator delete(void*, Space&) {}
503
+ };
504
+
505
+
506
+
507
+ /*
508
+ * Nodes
509
+ *
510
+ */
511
+ forceinline
512
+ Node::Node(void) {}
513
+ forceinline
514
+ Node::Node(NodeFlag nf0, int i)
515
+ : e(NULL), fst(NULL), lst(NULL), ie(NULL), idx(i),
516
+ nf(static_cast<unsigned char>(nf0)), noe(0) {}
517
+
518
+ forceinline Edge**
519
+ Node::adj(void) {
520
+ return &e;
521
+ }
522
+ forceinline Edge*
523
+ Node::first(void) const {
524
+ return fst;
525
+ }
526
+ forceinline Edge*
527
+ Node::last(void) const {
528
+ return lst;
529
+ }
530
+ forceinline void
531
+ Node::first(Edge* p) {
532
+ fst = p;
533
+ }
534
+ forceinline void
535
+ Node::last(Edge* p) {
536
+ lst = p;
537
+ }
538
+ forceinline bool
539
+ Node::type(void) const {
540
+ return (nf & NF_VAL) != 0;
541
+ }
542
+ forceinline Edge*
543
+ Node::inedge(void) const {
544
+ return ie;
545
+ }
546
+ forceinline void
547
+ Node::inedge(Edge* p) {
548
+ ie = p;
549
+ }
550
+ forceinline bool
551
+ Node::removed(void) const {
552
+ return noe == 0;
553
+ }
554
+ forceinline void
555
+ Node::index(int i) {
556
+ idx = i;
557
+ }
558
+ forceinline int
559
+ Node::index(void) const {
560
+ return idx;
561
+ }
562
+
563
+ forceinline void*
564
+ Node::operator new(size_t s, Space& home) {
565
+ return home.ralloc(s);
566
+ }
567
+
568
+
569
+
570
+ /*
571
+ * Variable nodes
572
+ *
573
+ */
574
+ forceinline
575
+ VarNode::VarNode(void) {}
576
+
577
+ forceinline
578
+ VarNode::VarNode(int x) :
579
+ Node(NF_NONE,x), ubm(NULL), lbm(NULL) {}
580
+
581
+ forceinline bool
582
+ VarNode::matched(BC bc) const {
583
+ if (bc == UBC)
584
+ return (nf & NF_M_UBC) != 0;
585
+ else
586
+ return (nf & NF_M_LBC) != 0;
587
+ }
588
+
589
+ forceinline void
590
+ VarNode::match(BC bc) {
591
+ if (bc == UBC)
592
+ nf |= NF_M_UBC;
593
+ else
594
+ nf |= NF_M_LBC;
595
+ }
596
+
597
+ forceinline void
598
+ VarNode::set_match(BC bc, Edge* p) {
599
+ if (bc == UBC)
600
+ ubm = p;
601
+ else
602
+ lbm = p;
603
+ }
604
+
605
+ forceinline void
606
+ VarNode::unmatch(BC bc) {
607
+ if (bc == UBC) {
608
+ nf &= ~NF_M_UBC; ubm = NULL;
609
+ } else {
610
+ nf &= ~NF_M_LBC; lbm = NULL;
611
+ }
612
+ }
613
+
614
+ forceinline Edge*
615
+ VarNode::get_match(BC bc) const {
616
+ if (bc == UBC)
617
+ return ubm;
618
+ else
619
+ return lbm;
620
+ }
621
+
622
+
623
+
624
+
625
+ /*
626
+ * Value nodes
627
+ *
628
+ */
629
+ forceinline
630
+ ValNode::ValNode(void) {}
631
+
632
+ forceinline
633
+ ValNode::ValNode(int min, int max, int value,
634
+ int kidx, int kshift, int count) :
635
+ Node(NF_VAL,kshift), _klb(min), _kub(max), _kidx(kidx), _kcount(count),
636
+ noc(0),
637
+ lb(min), ublow(max), ub(max),
638
+ val(value) {}
639
+
640
+ forceinline void
641
+ ValNode::maxlow(int i) {
642
+ assert(i >= lb);
643
+ ublow = i;
644
+ }
645
+
646
+ forceinline int
647
+ ValNode::maxlow(void) const {
648
+ if (_klb == _kub) {
649
+ assert(ublow == lb);
650
+ }
651
+ return ublow;
652
+ }
653
+
654
+
655
+ forceinline void
656
+ ValNode::card_conflict(int c) {
657
+ noc = c;
658
+ }
659
+
660
+ forceinline void
661
+ ValNode::red_conflict(void) {
662
+ noc--;
663
+ assert(noc >= 0);
664
+ }
665
+
666
+ forceinline int
667
+ ValNode::card_conflict(void) const {
668
+ return noc;
669
+ }
670
+
671
+ forceinline int
672
+ ValNode::cap(BC bc) const {
673
+ if (bc == UBC)
674
+ return ub;
675
+ else
676
+ return lb;
677
+ }
678
+ forceinline bool
679
+ ValNode::matched(BC bc) const {
680
+ return cap(bc) == 0;
681
+ }
682
+
683
+ forceinline void
684
+ ValNode::reset(void) {
685
+ lb = _klb;
686
+ ublow = _kub;
687
+ ub = _kub;
688
+ noe = 0;
689
+ }
690
+
691
+ forceinline int
692
+ ValNode::kbound(BC bc) const {
693
+ if (bc == UBC) {
694
+ return _kub;
695
+ } else {
696
+ return _klb;
697
+ }
698
+ }
699
+
700
+ forceinline int
701
+ ValNode::kmax(void) const {
702
+ return _kub;
703
+ }
704
+
705
+ forceinline int
706
+ ValNode::kmin(void) const {
707
+ return _klb;
708
+ }
709
+
710
+ forceinline void
711
+ ValNode::kmin(int klb) {
712
+ _klb = klb;
713
+ }
714
+
715
+ forceinline void
716
+ ValNode::kmax(int kub) {
717
+ _kub = kub;
718
+ }
719
+
720
+
721
+ forceinline void
722
+ ValNode::dec(BC bc) {
723
+ if (bc == UBC) {
724
+ ub--;
725
+ } else {
726
+ lb--; ublow--;
727
+ }
728
+ }
729
+
730
+ forceinline void
731
+ ValNode::inc(BC bc) {
732
+ if (bc == UBC) {
733
+ ub++;
734
+ } else {
735
+ lb++; ublow++;
736
+ }
737
+ }
738
+
739
+ forceinline void
740
+ ValNode::match(BC bc) {
741
+ dec(bc);
742
+ }
743
+
744
+ forceinline void
745
+ ValNode::unmatch(BC bc) {
746
+ inc(bc);
747
+ }
748
+
749
+ forceinline void
750
+ ValNode::cap(BC bc, int c) {
751
+ if (bc == UBC)
752
+ ub = c;
753
+ else
754
+ lb = c;
755
+ }
756
+
757
+ forceinline void
758
+ ValNode::inc(void) {
759
+ _kcount++;
760
+ }
761
+
762
+ forceinline int
763
+ ValNode::kcount(void) const {
764
+ return _kcount;
765
+ }
766
+
767
+ forceinline void
768
+ ValNode::kcount(int c) {
769
+ _kcount = c;
770
+ }
771
+
772
+ forceinline void
773
+ ValNode::kindex(int i) {
774
+ _kidx = i;
775
+ }
776
+
777
+ forceinline int
778
+ ValNode::kindex(void) const {
779
+ return _kidx;
780
+ }
781
+
782
+ /// Returs the number of incident matching edges on the node
783
+ forceinline int
784
+ ValNode::incid_match(BC bc) const {
785
+ if (bc == LBC)
786
+ return _kub - ublow + _kcount;
787
+ else
788
+ return _kub - ub + _kcount;
789
+ }
790
+
791
+
792
+ forceinline bool
793
+ ValNode::sink(void) const {
794
+ // there are only incoming edges
795
+ // in case of the UBC-matching
796
+ return _kub - ub == noe;
797
+ }
798
+
799
+ forceinline bool
800
+ ValNode::source(void) const {
801
+ // there are only incoming edges
802
+ // in case of the UBC-matching
803
+ return _klb - lb == noe;
804
+ }
805
+
806
+
807
+
808
+ /*
809
+ * Edges
810
+ *
811
+ */
812
+ forceinline void
813
+ Edge::unlink(void) {
814
+ // unlink from variable side
815
+ Edge* p = prev_edge;
816
+ Edge* n = next_edge;
817
+
818
+ if (p != NULL)
819
+ *p->next_ref() = n;
820
+ if (n != NULL)
821
+ *n->prev_ref() = p;
822
+
823
+ if (this == x->first()) {
824
+ Edge** ref = x->adj();
825
+ *ref = n;
826
+ x->first(n);
827
+ }
828
+
829
+ if (this == x->last())
830
+ x->last(p);
831
+
832
+ // unlink from value side
833
+ Edge* pv = prev_vedge;
834
+ Edge* nv = next_vedge;
835
+
836
+ if (pv != NULL)
837
+ *pv->vnext_ref() = nv;
838
+ if (nv != NULL)
839
+ *nv->vprev_ref() = pv;
840
+ if (this == v->first()) {
841
+ Edge** ref = v->adj();
842
+ *ref = nv;
843
+ v->first(nv);
844
+ }
845
+ if (this == v->last())
846
+ v->last(pv);
847
+ }
848
+
849
+ forceinline
850
+ Edge::Edge(VarNode* var, ValNode* val) :
851
+ x(var), v(val),
852
+ next_edge(NULL), prev_edge(NULL),
853
+ next_vedge(NULL), prev_vedge(NULL), ef(EF_NONE) {}
854
+
855
+ forceinline void
856
+ Edge::use(BC bc) {
857
+ if (bc == UBC)
858
+ ef |= EF_MRKUB;
859
+ else
860
+ ef |= EF_MRKLB;
861
+ }
862
+ forceinline void
863
+ Edge::free(BC bc) {
864
+ if (bc == UBC)
865
+ ef &= ~EF_MRKUB;
866
+ else
867
+ ef &= ~EF_MRKLB;
868
+ }
869
+ forceinline bool
870
+ Edge::used(BC bc) const {
871
+ if (bc == UBC)
872
+ return (ef & EF_MRKUB) != 0;
873
+ else
874
+ return (ef & EF_MRKLB) != 0;
875
+ }
876
+ forceinline Edge*
877
+ Edge::next(void) const {
878
+ return next_edge;
879
+ }
880
+ forceinline Edge*
881
+ Edge::next(bool t) const {
882
+ if (t) {
883
+ return next_vedge;
884
+ } else {
885
+ return next_edge;
886
+ }
887
+ }
888
+
889
+ forceinline Edge*
890
+ Edge::vnext(void) const {
891
+ return next_vedge;
892
+ }
893
+ forceinline Edge**
894
+ Edge::vnext_ref(void) {
895
+ return &next_vedge;
896
+ }
897
+ forceinline Edge*
898
+ Edge::prev(void) const {
899
+ return prev_edge;
900
+ }
901
+ forceinline Edge**
902
+ Edge::prev_ref(void) {
903
+ return &prev_edge;
904
+ }
905
+ forceinline Edge*
906
+ Edge::vprev(void) const {
907
+ return prev_vedge;
908
+ }
909
+ forceinline Edge**
910
+ Edge::vprev_ref(void) {
911
+ return &prev_vedge;
912
+ }
913
+ forceinline Edge**
914
+ Edge::next_ref(void) {
915
+ return &next_edge;
916
+ }
917
+ forceinline VarNode*
918
+ Edge::getVar(void) const {
919
+ assert(x != NULL);
920
+ return x;
921
+ }
922
+
923
+ forceinline ValNode*
924
+ Edge::getVal(void) const {
925
+ assert(v != NULL);
926
+ return v;
927
+ }
928
+
929
+ forceinline Node*
930
+ Edge::getMate(bool type) const {
931
+ if (type)
932
+ return x;
933
+ else
934
+ return v;
935
+ }
936
+
937
+ forceinline void
938
+ Edge::unmatch(BC bc) {
939
+ if (bc == UBC)
940
+ ef &= ~EF_UM;
941
+ else
942
+ ef &= ~EF_LM;
943
+ x->unmatch(bc); v->unmatch(bc);
944
+ }
945
+
946
+ forceinline void
947
+ Edge::unmatch(BC bc, bool node) {
948
+ if (bc == UBC)
949
+ ef &= ~EF_UM;
950
+ else
951
+ ef &= ~EF_LM;
952
+ if (node)
953
+ v->unmatch(bc);
954
+ else
955
+ x->unmatch(bc);
956
+ }
957
+
958
+ forceinline void
959
+ Edge::reset(BC bc) {
960
+ free(bc); unmatch(bc);
961
+ }
962
+
963
+ forceinline void
964
+ Edge::match(BC bc) {
965
+ if (bc == UBC)
966
+ ef |= EF_UM;
967
+ else
968
+ ef |= EF_LM;
969
+ x->match(bc);
970
+ x->set_match(bc,this);
971
+ v->match(bc);
972
+ }
973
+
974
+ forceinline bool
975
+ Edge::matched(BC bc) const {
976
+ if (bc == UBC)
977
+ return (ef & EF_UM) != 0;
978
+ else
979
+ return (ef & EF_LM) != 0;
980
+ }
981
+
982
+ forceinline void
983
+ Edge::del_edge(void) {
984
+ ef |= EF_DEL;
985
+ }
986
+
987
+ forceinline void
988
+ Edge::insert_edge(void) {
989
+ ef &= ~EF_DEL;
990
+ }
991
+
992
+
993
+ forceinline bool
994
+ Edge::deleted(void) const {
995
+ return (ef & EF_DEL) != 0;
996
+ }
997
+
998
+ forceinline void*
999
+ Edge::operator new(size_t s, Space& home) {
1000
+ return home.ralloc(s);
1001
+ }
1002
+
1003
+
1004
+ /*
1005
+ * Variable value graph
1006
+ *
1007
+ */
1008
+ template<class Card>
1009
+ VarValGraph<Card>::VarValGraph(Space& home,
1010
+ ViewArray<IntView>& x, ViewArray<Card>& k,
1011
+ int smin, int smax)
1012
+ : n_var(x.size()),
1013
+ n_val(k.size()),
1014
+ n_node(n_var + n_val),
1015
+ sum_min(smin),
1016
+ sum_max(smax) {
1017
+
1018
+ unsigned int noe = 0;
1019
+ for (int i=x.size(); i--; )
1020
+ noe += x[i].size();
1021
+
1022
+ vars = home.alloc<VarNode*>(n_var);
1023
+ vals = home.alloc<ValNode*>(n_val);
1024
+
1025
+ for (int i = n_val; i--; ) {
1026
+ int kmi = k[i].min();
1027
+ int kma = k[i].max();
1028
+ int kc = k[i].counter();
1029
+ if (kc != kma) {
1030
+ if (kmi >= kc) {
1031
+ kmi -=kc;
1032
+ assert(kmi >=0);
1033
+ } else {
1034
+ kmi = 0;
1035
+ }
1036
+ kma -= kc;
1037
+ assert (kma > 0);
1038
+ vals[i] = new (home)
1039
+ ValNode(kmi, kma, k[i].card(), i, i + n_var, kc);
1040
+ } else {
1041
+ vals[i] = new (home)
1042
+ ValNode(0, 0, k[i].card(), i, i + n_var, kc);
1043
+ }
1044
+ }
1045
+
1046
+ for (int i = n_var; i--; ) {
1047
+ vars[i] = new (home) VarNode(i);
1048
+ // get the space for the edges of the varnode
1049
+ Edge** xadjacent = vars[i]->adj();
1050
+
1051
+ int j = 0;
1052
+ for (ViewValues<IntView> xi(x[i]); xi(); ++xi) {
1053
+ // get the correct index for the value
1054
+ while(vals[j]->val < xi.val())
1055
+ j++;
1056
+ *xadjacent = new (home) Edge(vars[i],vals[j]);
1057
+ vars[i]->noe++;
1058
+ if (vars[i]->first() == NULL)
1059
+ vars[i]->first(*xadjacent);
1060
+ Edge* oldprev = vars[i]->last();
1061
+ vars[i]->last(*xadjacent);
1062
+ *vars[i]->last()->prev_ref() = oldprev;
1063
+
1064
+ if (vals[j]->first() == NULL) {
1065
+ vals[j]->first(*xadjacent);
1066
+ vals[j]->last(*xadjacent);
1067
+ } else {
1068
+ Edge* old = vals[j]->first();
1069
+ vals[j]->first(*xadjacent);
1070
+ *vals[j]->first()->vnext_ref() = old;
1071
+ *old->vprev_ref() = vals[j]->first();
1072
+ }
1073
+ vals[j]->noe++;
1074
+ xadjacent = (*xadjacent)->next_ref();
1075
+ }
1076
+ *xadjacent = NULL;
1077
+ }
1078
+ }
1079
+
1080
+
1081
+ template<class Card>
1082
+ inline ExecStatus
1083
+ VarValGraph<Card>::min_require(Space& home,
1084
+ ViewArray<IntView>& x,
1085
+ ViewArray<Card>& k) {
1086
+ for (int i = n_val; i--; ) {
1087
+ ValNode* vln = vals[i];
1088
+ if (vln->noe > 0) {
1089
+ if (k[i].min() == vln->noe) {
1090
+ // all variable nodes reachable from vln should be equal to vln->val
1091
+ for (Edge* e = vln->first(); e != NULL; e = e->vnext()) {
1092
+ VarNode* vrn = e->getVar();
1093
+ for (Edge* f = vrn->first(); f != NULL; f = f->next())
1094
+ if (f != e) {
1095
+ ValNode* w = f->getVal();
1096
+ w->noe--;
1097
+ vrn->noe--;
1098
+ f->del_edge();
1099
+ f->unlink();
1100
+ }
1101
+ assert(vrn->noe == 1);
1102
+
1103
+ int vi = vrn->index();
1104
+ GECODE_ME_CHECK(x[vi].eq(home, vln->val));
1105
+
1106
+ vars[vi] = vars[--n_var];
1107
+ vars[vi]->index(vi);
1108
+ x.move_lst(vi);
1109
+ n_node--;
1110
+ vln->noe--;
1111
+ }
1112
+
1113
+
1114
+ int vidx = vln->kindex();
1115
+ if (Card::propagate)
1116
+ GECODE_ME_CHECK(k[vidx].eq(home, k[vidx].min()));
1117
+
1118
+ k[vidx].counter(k[vidx].min());
1119
+
1120
+ vln->cap(UBC,0);
1121
+ vln->cap(LBC,0);
1122
+ vln->maxlow(0);
1123
+
1124
+ if (sum_min >= k[vidx].min())
1125
+ sum_min -= k[vidx].min();
1126
+ if (sum_max >= k[vidx].max())
1127
+ sum_max -= k[vidx].max();
1128
+ }
1129
+ } else {
1130
+ vals[i]->cap(UBC,0);
1131
+ vals[i]->cap(LBC,0);
1132
+ vals[i]->maxlow(0);
1133
+ vals[i]->kmax(0);
1134
+ vals[i]->kmin(0);
1135
+ }
1136
+
1137
+ if (Card::propagate && (k[i].counter() == 0))
1138
+ GECODE_ME_CHECK(k[i].lq(home, vals[i]->noe));
1139
+ }
1140
+
1141
+ for (int i = n_val; i--; )
1142
+ vals[i]->index(n_var + i);
1143
+
1144
+ return ES_OK;
1145
+ }
1146
+
1147
+ template<class Card>
1148
+ inline ExecStatus
1149
+ VarValGraph<Card>::sync(Space& home,
1150
+ ViewArray<IntView>& x, ViewArray<Card>& k) {
1151
+ Region r(home);
1152
+ // A node can be pushed twice (once when checking cardinality and later again)
1153
+ NodeStack re(r,2*n_node);
1154
+
1155
+ // synchronize cardinality variables
1156
+ if (Card::propagate) {
1157
+ for (int i = n_val; i--; ) {
1158
+ ValNode* v = vals[i];
1159
+ int inc_ubc = v->incid_match(UBC);
1160
+ int inc_lbc = v->incid_match(LBC);
1161
+ if (v->noe == 0) {
1162
+ inc_ubc = 0;
1163
+ inc_lbc = 0;
1164
+ }
1165
+ int rm = v->kmax() - k[i].max();
1166
+ // the cardinality bounds have been modified
1167
+ if ((k[i].max() < v->kmax()) || (k[i].min() > v->kmin())) {
1168
+ if ((k[i].max() != k[i].counter()) || (k[i].max() == 0)) {
1169
+ // update the bounds
1170
+ v->kmax(k[i].max());
1171
+ v->kmin(k[i].min());
1172
+
1173
+ //everything is fine
1174
+ if (inc_ubc <= k[i].max()) {
1175
+ // adjust capacities
1176
+ v->cap(UBC, k[i].max() - inc_ubc);
1177
+ v->maxlow(k[i].max() - inc_lbc);
1178
+ if (v->kmin() == v->kmax())
1179
+ v->cap(LBC, k[i].max() - inc_lbc);
1180
+ } else {
1181
+ // set cap to max and resolve conflicts on view side
1182
+ // set to full capacity for later rescheduling
1183
+ if (v->cap(UBC))
1184
+ v->cap(UBC,k[i].max());
1185
+ v->maxlow(k[i].max() - (inc_lbc));
1186
+ if (v->kmin() == v->kmax())
1187
+ v->cap(LBC,k[i].max() - (inc_lbc));
1188
+ v->card_conflict(rm);
1189
+ }
1190
+ }
1191
+ }
1192
+ if (inc_lbc < k[i].min() && v->noe > 0) {
1193
+ v->cap(LBC, k[i].min() - inc_lbc);
1194
+ re.push(v);
1195
+ }
1196
+ }
1197
+
1198
+ for (int i = n_var; i--; ) {
1199
+ Edge* mub = vars[i]->get_match(UBC);
1200
+ if (mub != NULL) {
1201
+ ValNode* vu = mub->getVal();
1202
+ if ((vars[i]->noe != 1) && vu->card_conflict()) {
1203
+ vu->red_conflict();
1204
+ mub->unmatch(UBC,vars[i]->type());
1205
+ re.push(vars[i]);
1206
+ }
1207
+ }
1208
+ }
1209
+ }
1210
+
1211
+ // go on with synchronization
1212
+ assert(x.size() == n_var);
1213
+ for (int i = n_var; i--; ) {
1214
+
1215
+ VarNode* vrn = vars[i];
1216
+ if (static_cast<int>(x[i].size()) != vrn->noe) {
1217
+ // if the variable is already assigned
1218
+ if (x[i].assigned()) {
1219
+ int v = x[i].val();
1220
+ ValNode* rv = NULL;
1221
+ Edge* mub = vrn->get_match(UBC);
1222
+ if ((mub != NULL) && (v != mub->getVal()->val)) {
1223
+ mub->unmatch(UBC);
1224
+ re.push(vars[i]);
1225
+ }
1226
+
1227
+ Edge* mlb = vrn->get_match(LBC);
1228
+ if (mlb != NULL) {
1229
+ ValNode* vln = mlb->getVal();
1230
+ if (v != vln->val) {
1231
+ mlb->unmatch(LBC);
1232
+ if (vln->incid_match(LBC) < vln->kmin())
1233
+ re.push(vln);
1234
+ }
1235
+ }
1236
+
1237
+ for (Edge* e = vrn->first(); e != NULL; e = e->next()) {
1238
+ ValNode* vln = e->getVal();
1239
+ if (vln->val != v) {
1240
+ vrn->noe--;
1241
+ e->getVal()->noe--;
1242
+ e->del_edge();
1243
+ e->unlink();
1244
+ } else {
1245
+ rv = e->getVal();
1246
+ }
1247
+ }
1248
+ } else {
1249
+
1250
+ // delete the edge
1251
+ ViewValues<IntView> xiter(x[i]);
1252
+ Edge* mub = vrn->get_match(UBC);
1253
+ Edge* mlb = vrn->get_match(LBC);
1254
+ Edge** p = vrn->adj();
1255
+ Edge* e = *p;
1256
+ do {
1257
+ // search the edge that has to be deleted
1258
+ while (e != NULL && (e->getVal()->val < xiter.val())) {
1259
+ // Skip edge
1260
+ e->getVal()->noe--;
1261
+ vrn->noe--;
1262
+ e->del_edge();
1263
+ e->unlink();
1264
+ e = e ->next();
1265
+ *p = e;
1266
+ }
1267
+
1268
+ assert(xiter.val() == e->getVal()->val);
1269
+
1270
+ // This edge must be kept
1271
+ e->free(UBC);
1272
+ e->free(LBC);
1273
+ ++xiter;
1274
+ p = e->next_ref();
1275
+ e = e->next();
1276
+ } while (xiter());
1277
+ *p = NULL;
1278
+ while (e) {
1279
+ e->getVar()->noe--;
1280
+ e->getVal()->noe--;
1281
+ e->del_edge();
1282
+ e->unlink();
1283
+ e = e->next();
1284
+ }
1285
+
1286
+ if ((mub != NULL) && mub->deleted()) {
1287
+ mub->unmatch(UBC);
1288
+ re.push(vars[i]);
1289
+ }
1290
+
1291
+ //lower bound matching can be zero
1292
+ if ((mlb != NULL) && mlb->deleted()) {
1293
+ ValNode* vln = mlb->getVal();
1294
+ mlb->unmatch(LBC);
1295
+ if (vln->incid_match(LBC) < vln->kmin())
1296
+ re.push(vln);
1297
+ }
1298
+ }
1299
+ }
1300
+ vars[i]->index(i);
1301
+ }
1302
+
1303
+ for (int i = n_val; i--; ) {
1304
+ if ((k[i].min() > vals[i]->noe) && (k[i].counter() == 0))
1305
+ return ES_FAILED;
1306
+ vals[i]->index(n_var + i);
1307
+ }
1308
+
1309
+ // start repair
1310
+ while (!re.empty()) {
1311
+ Node* n = re.pop();
1312
+ if (!n->removed()) {
1313
+ if (!n->type()) {
1314
+ VarNode* vrn = static_cast<VarNode*>(n);
1315
+ if (!vrn->matched(UBC) && !augmenting_path<UBC>(home,vrn))
1316
+ return ES_FAILED;
1317
+ } else {
1318
+ ValNode* vln = static_cast<ValNode*>(n);
1319
+ while (!vln->matched(LBC))
1320
+ if (!augmenting_path<LBC>(home,vln))
1321
+ return ES_FAILED;
1322
+ }
1323
+ }
1324
+ }
1325
+
1326
+ return ES_OK;
1327
+ }
1328
+
1329
+ template<class Card> template<BC bc>
1330
+ inline ExecStatus
1331
+ VarValGraph<Card>::narrow(Space& home,
1332
+ ViewArray<IntView>& x, ViewArray<Card>& k) {
1333
+ for (int i = n_var; i--; )
1334
+ if (vars[i]->noe == 1) {
1335
+ ValNode* v = vars[i]->first()->getVal();
1336
+ vars[i]->first()->free(bc);
1337
+ GECODE_ME_CHECK(x[i].eq(home, v->val));
1338
+ v->inc();
1339
+ }
1340
+
1341
+ for (int i = n_val; i--; ) {
1342
+ ValNode* v = vals[i];
1343
+ if (Card::propagate && (k[i].counter() == 0))
1344
+ GECODE_ME_CHECK(k[i].lq(home, v->noe));
1345
+ if (v->noe > 0) {
1346
+ if (Card::propagate)
1347
+ GECODE_ME_CHECK(k[i].lq(home, v->noe));
1348
+
1349
+ // If the maximum number of occurences of a value is reached
1350
+ // it cannot be consumed by another view
1351
+
1352
+ if (v->kcount() == v->kmax()) {
1353
+ int vidx = v->kindex();
1354
+
1355
+ k[i].counter(v->kcount());
1356
+
1357
+ if (Card::propagate)
1358
+ GECODE_ME_CHECK(k[i].eq(home, k[i].counter()));
1359
+
1360
+ bool delall = v->card_conflict() && (v->noe > v->kmax());
1361
+
1362
+ for (Edge* e = v->last(); e != NULL; e = e->vprev()) {
1363
+ VarNode* vrn = e->getVar();
1364
+ if (vrn->noe == 1) {
1365
+ vrn->noe--;
1366
+ v->noe--;
1367
+ int vi= vrn->index();
1368
+
1369
+ x.move_lst(vi);
1370
+ vars[vi] = vars[--n_var];
1371
+ vars[vi]->index(vi);
1372
+ n_node--;
1373
+ e->del_edge();
1374
+ e->unlink();
1375
+
1376
+ } else if (delall) {
1377
+ GECODE_ME_CHECK(x[vrn->index()].nq(home, v->val));
1378
+ vrn->noe--;
1379
+ v->noe--;
1380
+ e->del_edge();
1381
+ e->unlink();
1382
+ }
1383
+ }
1384
+ v->cap(UBC,0);
1385
+ v->cap(LBC,0);
1386
+ v->maxlow(0);
1387
+ if (sum_min >= k[vidx].min())
1388
+ sum_min -= k[vidx].min();
1389
+ if (sum_max >= k[vidx].max())
1390
+ sum_max -= k[vidx].max();
1391
+
1392
+ } else if (v->kcount() > 0) {
1393
+ v->kcount(0);
1394
+ }
1395
+ }
1396
+ }
1397
+ for (int i = n_var; i--; )
1398
+ vars[i]->index(i);
1399
+
1400
+ for (int i = n_val; i--; ) {
1401
+ if (vals[i]->noe == 0) {
1402
+ vals[i]->cap(UBC,0);
1403
+ vals[i]->cap(LBC,0);
1404
+ vals[i]->maxlow(0);
1405
+ }
1406
+ vals[i]->index(n_var + i);
1407
+ }
1408
+
1409
+ for (int i = n_var; i--; )
1410
+ if (vars[i]->noe > 1)
1411
+ for (Edge* e = vars[i]->first(); e != NULL; e = e->next())
1412
+ if (!e->matched(bc) && !e->used(bc)) {
1413
+ GECODE_ME_CHECK(x[i].nq(home, e->getVal()->val));
1414
+ } else {
1415
+ e->free(bc);
1416
+ }
1417
+
1418
+ return ES_OK;
1419
+ }
1420
+
1421
+ template<class Card> template<BC bc>
1422
+ forceinline bool
1423
+ VarValGraph<Card>::augmenting_path(Space& home, Node* v) {
1424
+ Region r(home);
1425
+ NodeStack ns(r,n_node);
1426
+ BitSet visited(r,static_cast<unsigned int>(n_node));
1427
+ Edge** start = r.alloc<Edge*>(n_node);
1428
+
1429
+ // keep track of the nodes that have already been visited
1430
+ Node* sn = v;
1431
+
1432
+ // mark the start partition
1433
+ bool sp = sn->type();
1434
+
1435
+ // nodes in sp only follow free edges
1436
+ // nodes in V - sp only follow matched edges
1437
+
1438
+ for (int i = n_node; i--; )
1439
+ if (i >= n_var) {
1440
+ vals[i-n_var]->inedge(NULL);
1441
+ start[i] = vals[i-n_var]->first();
1442
+ } else {
1443
+ vars[i]->inedge(NULL);
1444
+ start[i] = vars[i]->first();
1445
+ }
1446
+
1447
+ v->inedge(NULL);
1448
+ ns.push(v);
1449
+ visited.set(static_cast<unsigned int>(v->index()));
1450
+ while (!ns.empty()) {
1451
+ Node* v = ns.top();
1452
+ Edge* e = NULL;
1453
+ if (v->type() == sp) {
1454
+ e = start[v->index()];
1455
+ while ((e != NULL) && e->matched(bc))
1456
+ e = e->next(v->type());
1457
+ } else {
1458
+ e = start[v->index()];
1459
+ while ((e != NULL) && !e->matched(bc))
1460
+ e = e->next(v->type());
1461
+ start[v->index()] = e;
1462
+ }
1463
+ if (e != NULL) {
1464
+ start[v->index()] = e->next(v->type());
1465
+ Node* w = e->getMate(v->type());
1466
+ if (!visited.get(static_cast<unsigned int>(w->index()))) {
1467
+ // unexplored path
1468
+ bool m = w->type() ?
1469
+ static_cast<ValNode*>(w)->matched(bc) :
1470
+ static_cast<VarNode*>(w)->matched(bc);
1471
+ if (!m && w->type() != sp) {
1472
+ if (v->inedge() != NULL) {
1473
+ // augmenting path of length l > 1
1474
+ e->match(bc);
1475
+ break;
1476
+ } else {
1477
+ // augmenting path of length l = 1
1478
+ e->match(bc);
1479
+ ns.pop();
1480
+ return true;
1481
+ }
1482
+ } else {
1483
+ w->inedge(e);
1484
+ visited.set(static_cast<unsigned int>(w->index()));
1485
+ // find matching edge m incident with w
1486
+ ns.push(w);
1487
+ }
1488
+ }
1489
+ } else {
1490
+ // tried all outgoing edges without finding an augmenting path
1491
+ ns.pop();
1492
+ }
1493
+ }
1494
+
1495
+ bool pathfound = !ns.empty();
1496
+
1497
+ while (!ns.empty()) {
1498
+ Node* t = ns.pop();
1499
+ if (t != sn) {
1500
+ Edge* in = t->inedge();
1501
+ if (t->type() != sp) {
1502
+ in->match(bc);
1503
+ } else if (!sp) {
1504
+ in->unmatch(bc,!sp);
1505
+ } else {
1506
+ in->unmatch(bc);
1507
+ }
1508
+ }
1509
+ }
1510
+ return pathfound;
1511
+ }
1512
+
1513
+ template<class Card> template<BC bc>
1514
+ inline ExecStatus
1515
+ VarValGraph<Card>::maximum_matching(Space& home) {
1516
+ int card_match = 0;
1517
+ // find an intial matching in O(n*d)
1518
+ // greedy algorithm
1519
+ for (int i = n_val; i--; )
1520
+ for (Edge* e = vals[i]->first(); e != NULL ; e = e->vnext())
1521
+ if (!e->getVar()->matched(bc) && !vals[i]->matched(bc)) {
1522
+ e->match(bc); card_match++;
1523
+ }
1524
+
1525
+ Region r(home);
1526
+ switch (bc) {
1527
+ case LBC:
1528
+ if (card_match < sum_min) {
1529
+ Support::StaticStack<ValNode*,Region> free(r,n_val);
1530
+
1531
+ // find failed nodes
1532
+ for (int i = n_val; i--; )
1533
+ if (!vals[i]->matched(LBC))
1534
+ free.push(vals[i]);
1535
+
1536
+ while (!free.empty()) {
1537
+ ValNode* v = free.pop();
1538
+ while (!v->matched(LBC))
1539
+ if (augmenting_path<LBC>(home,v))
1540
+ card_match++;
1541
+ else
1542
+ break;
1543
+ }
1544
+
1545
+ return (card_match >= sum_min) ? ES_OK : ES_FAILED;
1546
+ } else {
1547
+ return ES_OK;
1548
+ }
1549
+ break;
1550
+ case UBC:
1551
+ if (card_match < n_var) {
1552
+ Support::StaticStack<VarNode*,Region> free(r,n_var);
1553
+
1554
+ // find failed nodes
1555
+ for (int i = n_var; i--; )
1556
+ if (!vars[i]->matched(UBC))
1557
+ free.push(vars[i]);
1558
+
1559
+ while (!free.empty()) {
1560
+ VarNode* v = free.pop();
1561
+ if (!v->matched(UBC) && augmenting_path<UBC>(home,v))
1562
+ card_match++;
1563
+ }
1564
+
1565
+ return (card_match >= n_var) ? ES_OK : ES_FAILED;
1566
+ } else {
1567
+ return ES_OK;
1568
+ }
1569
+ break;
1570
+ default: GECODE_NEVER;
1571
+ }
1572
+ GECODE_NEVER;
1573
+ return ES_FAILED;
1574
+ }
1575
+
1576
+
1577
+ template<class Card> template<BC bc>
1578
+ forceinline void
1579
+ VarValGraph<Card>::free_alternating_paths(Space& home) {
1580
+ Region r(home);
1581
+ NodeStack ns(r,n_node);
1582
+ BitSet visited(r,static_cast<unsigned int>(n_node));
1583
+
1584
+ switch (bc) {
1585
+ case LBC:
1586
+ // after a maximum matching on the value nodes there still can be
1587
+ // free value nodes, hence we have to consider ALL nodes whether
1588
+ // they are the starting point of an even alternating path in G
1589
+ for (int i = n_var; i--; )
1590
+ if (!vars[i]->matched(LBC)) {
1591
+ ns.push(vars[i]);
1592
+ visited.set(static_cast<unsigned int>(vars[i]->index()));
1593
+ }
1594
+ for (int i = n_val; i--; )
1595
+ if (!vals[i]->matched(LBC)) {
1596
+ ns.push(vals[i]);
1597
+ visited.set(static_cast<unsigned int>(vals[i]->index()));
1598
+ }
1599
+ break;
1600
+ case UBC:
1601
+ // clearly, after a maximum matching on the x variables
1602
+ // corresponding to a set cover on x there are NO free var nodes
1603
+ for (int i = n_val; i--; )
1604
+ if (!vals[i]->matched(UBC)) {
1605
+ ns.push(vals[i]);
1606
+ visited.set(static_cast<unsigned int>(vals[i]->index()));
1607
+ }
1608
+ break;
1609
+ default: GECODE_NEVER;
1610
+ }
1611
+
1612
+ while (!ns.empty()) {
1613
+ Node* node = ns.pop();
1614
+ if (node->type()) {
1615
+ // ValNode
1616
+ ValNode* vln = static_cast<ValNode*>(node);
1617
+
1618
+ for (Edge* cur = vln->first(); cur != NULL; cur = cur->vnext()) {
1619
+ VarNode* mate = cur->getVar();
1620
+ switch (bc) {
1621
+ case LBC:
1622
+ if (cur->matched(LBC)) {
1623
+ // mark the edge
1624
+ cur->use(LBC);
1625
+ if (!visited.get(static_cast<unsigned int>(mate->index()))) {
1626
+ ns.push(mate);
1627
+ visited.set(static_cast<unsigned int>(mate->index()));
1628
+ }
1629
+ }
1630
+ break;
1631
+ case UBC:
1632
+ if (!cur->matched(UBC)) {
1633
+ // mark the edge
1634
+ cur->use(UBC);
1635
+ if (!visited.get(static_cast<unsigned int>(mate->index()))) {
1636
+ ns.push(mate);
1637
+ visited.set(static_cast<unsigned int>(mate->index()));
1638
+ }
1639
+ }
1640
+ break;
1641
+ default: GECODE_NEVER;
1642
+ }
1643
+ }
1644
+
1645
+ } else {
1646
+ // VarNode
1647
+ VarNode* vrn = static_cast<VarNode*>(node);
1648
+
1649
+ switch (bc) {
1650
+ case LBC:
1651
+ // after LBC-matching we can follow every unmatched edge
1652
+ for (Edge* cur = vrn->first(); cur != NULL; cur = cur->next()) {
1653
+ ValNode* mate = cur->getVal();
1654
+ if (!cur->matched(LBC)) {
1655
+ cur->use(LBC);
1656
+ if (!visited.get(static_cast<unsigned int>(mate->index()))) {
1657
+ ns.push(mate);
1658
+ visited.set(static_cast<unsigned int>(mate->index()));
1659
+ }
1660
+ }
1661
+ }
1662
+ break;
1663
+ case UBC:
1664
+ // after UBC-matching we can only follow a matched edge
1665
+ {
1666
+ Edge* cur = vrn->get_match(UBC);
1667
+ if (cur != NULL) {
1668
+ cur->use(UBC);
1669
+ ValNode* mate = cur->getVal();
1670
+ if (!visited.get(static_cast<unsigned int>(mate->index()))) {
1671
+ ns.push(mate);
1672
+ visited.set(static_cast<unsigned int>(mate->index()));
1673
+ }
1674
+ }
1675
+ }
1676
+ break;
1677
+ default: GECODE_NEVER;
1678
+ }
1679
+ }
1680
+ }
1681
+ }
1682
+
1683
+ template<class Card> template<BC bc>
1684
+ void
1685
+ VarValGraph<Card>::dfs(Node* v,
1686
+ BitSet& inscc, BitSet& in_unfinished, int dfsnum[],
1687
+ NodeStack& roots, NodeStack& unfinished,
1688
+ int& count) {
1689
+ count++;
1690
+ int v_index = v->index();
1691
+ dfsnum[v_index] = count;
1692
+ inscc.set(static_cast<unsigned int>(v_index));
1693
+ in_unfinished.set(static_cast<unsigned int>(v_index));
1694
+
1695
+ unfinished.push(v);
1696
+ roots.push(v);
1697
+ for (Edge* e = v->first(); e != NULL; e = e->next(v->type())) {
1698
+ bool m;
1699
+ switch (bc) {
1700
+ case LBC:
1701
+ m = v->type() ? e->matched(LBC) : !e->matched(LBC);
1702
+ break;
1703
+ case UBC:
1704
+ m = v->type() ? !e->matched(UBC) : e->matched(UBC);
1705
+ break;
1706
+ default: GECODE_NEVER;
1707
+ }
1708
+ if (m) {
1709
+ Node* w = e->getMate(v->type());
1710
+ int w_index = w->index();
1711
+
1712
+ assert(w_index < n_node);
1713
+ if (!inscc.get(static_cast<unsigned int>(w_index))) {
1714
+ // w is an uncompleted scc
1715
+ w->inedge(e);
1716
+ dfs<bc>(w, inscc, in_unfinished, dfsnum,
1717
+ roots, unfinished, count);
1718
+ } else if (in_unfinished.get(static_cast<unsigned int>(w_index))) {
1719
+ // even alternating cycle found mark the edge closing the cycle,
1720
+ // completing the scc
1721
+ e->use(bc);
1722
+ // if w belongs to an scc we detected earlier
1723
+ // merge components
1724
+ assert(roots.top()->index() < n_node);
1725
+ while (dfsnum[roots.top()->index()] > dfsnum[w_index]) {
1726
+ roots.pop();
1727
+ }
1728
+ }
1729
+ }
1730
+ }
1731
+
1732
+ if (v == roots.top()) {
1733
+ while (v != unfinished.top()) {
1734
+ // w belongs to the scc with root v
1735
+ Node* w = unfinished.top();
1736
+ w->inedge()->use(bc);
1737
+ in_unfinished.clear(static_cast<unsigned int>(w->index()));
1738
+ unfinished.pop();
1739
+ }
1740
+ assert(v == unfinished.top());
1741
+ in_unfinished.clear(static_cast<unsigned int>(v_index));
1742
+ roots.pop();
1743
+ unfinished.pop();
1744
+ }
1745
+ }
1746
+
1747
+ template<class Card> template<BC bc>
1748
+ forceinline void
1749
+ VarValGraph<Card>::strongly_connected_components(Space& home) {
1750
+ Region r(home);
1751
+ BitSet inscc(r,static_cast<unsigned int>(n_node));
1752
+ BitSet in_unfinished(r,static_cast<unsigned int>(n_node));
1753
+ int* dfsnum = r.alloc<int>(n_node);
1754
+
1755
+ for (int i = n_node; i--; )
1756
+ dfsnum[i]=0;
1757
+
1758
+ int count = 0;
1759
+ NodeStack roots(r,n_node);
1760
+ NodeStack unfinished(r,n_node);
1761
+
1762
+ for (int i = n_var; i--; )
1763
+ dfs<bc>(vars[i], inscc, in_unfinished, dfsnum,
1764
+ roots, unfinished, count);
1765
+ }
1766
+
1767
+ template<class Card>
1768
+ forceinline void*
1769
+ VarValGraph<Card>::operator new(size_t t, Space& home) {
1770
+ return home.ralloc(t);
1771
+ }
1772
+
1773
+ }}}
1774
+
1775
+ // STATISTICS: int-prop
1776
+
1777
+