dep-selector-libgecode 1.0.0.alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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,70 @@
1
+ /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Main authors:
4
+ * Guido Tack <tack@gecode.org>
5
+ *
6
+ * Copyright:
7
+ * Guido Tack, 2011
8
+ *
9
+ * Last modified:
10
+ * $Date: 2011-05-11 20:44:17 +1000 (Wed, 11 May 2011) $ by $Author: tack $
11
+ * $Revision: 12001 $
12
+ *
13
+ * This file is part of Gecode, the generic constraint
14
+ * development environment:
15
+ * http://www.gecode.org
16
+ *
17
+ * Permission is hereby granted, free of charge, to any person obtaining
18
+ * a copy of this software and associated documentation files (the
19
+ * "Software"), to deal in the Software without restriction, including
20
+ * without limitation the rights to use, copy, modify, merge, publish,
21
+ * distribute, sublicense, and/or sell copies of the Software, and to
22
+ * permit persons to whom the Software is furnished to do so, subject to
23
+ * the following conditions:
24
+ *
25
+ * The above copyright notice and this permission notice shall be
26
+ * included in all copies or substantial portions of the Software.
27
+ *
28
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35
+ *
36
+ */
37
+
38
+ #include <gecode/kernel.hh>
39
+
40
+ namespace Gecode {
41
+
42
+ void
43
+ Archive::resize(int n) {
44
+ int m = std::max(n+1, (3*_size)/2);
45
+ _a = heap.realloc<unsigned int>(_a,_n,m);
46
+ _size = m;
47
+ }
48
+
49
+ Archive::Archive(const Archive& e) : _size(e._n), _n(e._n), _pos(e._pos) {
50
+ _a = heap.alloc<unsigned int>(_n);
51
+ heap.copy<unsigned int>(_a,e._a,_n);
52
+ }
53
+
54
+ Archive&
55
+ Archive::operator =(const Archive& e) {
56
+ if (this!=&e) {
57
+ _a = heap.realloc<unsigned int>(_a, _size, e._n);
58
+ heap.copy<unsigned int>(_a,e._a,e._n);
59
+ _size = _n = e._n;
60
+ }
61
+ return *this;
62
+ }
63
+
64
+ Archive::~Archive(void) {
65
+ heap.free<unsigned int>(_a,_size);
66
+ }
67
+
68
+ }
69
+
70
+ // STATISTICS: kernel-branch
@@ -0,0 +1,298 @@
1
+ /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Main authors:
4
+ * Guido Tack <tack@gecode.org>
5
+ *
6
+ * Copyright:
7
+ * Guido Tack, 2011
8
+ *
9
+ * Last modified:
10
+ * $Date: 2012-02-22 16:04:20 +1100 (Wed, 22 Feb 2012) $ by $Author: tack $
11
+ * $Revision: 12537 $
12
+ *
13
+ * This file is part of Gecode, the generic constraint
14
+ * development environment:
15
+ * http://www.gecode.org
16
+ *
17
+ * Permission is hereby granted, free of charge, to any person obtaining
18
+ * a copy of this software and associated documentation files (the
19
+ * "Software"), to deal in the Software without restriction, including
20
+ * without limitation the rights to use, copy, modify, merge, publish,
21
+ * distribute, sublicense, and/or sell copies of the Software, and to
22
+ * permit persons to whom the Software is furnished to do so, subject to
23
+ * the following conditions:
24
+ *
25
+ * The above copyright notice and this permission notice shall be
26
+ * included in all copies or substantial portions of the Software.
27
+ *
28
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
29
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
30
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
31
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
32
+ * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
33
+ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
34
+ * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
35
+ *
36
+ */
37
+
38
+ namespace Gecode {
39
+ /**
40
+ * \brief %Archive representation
41
+ *
42
+ * An Archive is an array of unsigned integers, used as an external
43
+ * representation of internal data structures (such as Choice objects).
44
+ */
45
+ class Archive {
46
+ private:
47
+ /// Size of array
48
+ int _size;
49
+ /// Used size of array
50
+ int _n;
51
+ /// Array elements
52
+ unsigned int* _a;
53
+ /// Current position of read iterator
54
+ int _pos;
55
+ /// Resize to at least \a n + 1 elements
56
+ GECODE_KERNEL_EXPORT void resize(int n);
57
+ public:
58
+ /// Construct empty representation
59
+ Archive(void);
60
+ /// Destructor
61
+ GECODE_KERNEL_EXPORT ~Archive(void);
62
+ /// Copy constructor
63
+ GECODE_KERNEL_EXPORT Archive(const Archive& e);
64
+ /// Assignment operator
65
+ GECODE_KERNEL_EXPORT Archive& operator =(const Archive& e);
66
+ /// Add \a i to the contents
67
+ void put(unsigned int i);
68
+ /// Return size
69
+ int size(void) const;
70
+ /// Return array element \a i
71
+ unsigned int operator [](int i) const;
72
+ /// Return next element to read
73
+ unsigned int get(void);
74
+ };
75
+
76
+ /** Add \a i to the end of \a e
77
+ * \relates Archive
78
+ */
79
+ Archive&
80
+ operator <<(Archive& e, unsigned int i);
81
+ /** Add \a i to the end of \a e
82
+ * \relates Archive
83
+ */
84
+ Archive&
85
+ operator <<(Archive& e, int i);
86
+ /** Add \a i to the end of \a e
87
+ * \relates Archive
88
+ */
89
+ Archive&
90
+ operator <<(Archive& e, unsigned short i);
91
+ /** Add \a i to the end of \a e
92
+ * \relates Archive
93
+ */
94
+ Archive&
95
+ operator <<(Archive& e, short i);
96
+ /** Add \a i to the end of \a e
97
+ * \relates Archive
98
+ */
99
+ Archive&
100
+ operator <<(Archive& e, unsigned char i);
101
+ /** Add \a i to the end of \a e
102
+ * \relates Archive
103
+ */
104
+ Archive&
105
+ operator <<(Archive& e, char i);
106
+ /** Add \a i to the end of \a e
107
+ * \relates Archive
108
+ */
109
+ Archive&
110
+ operator <<(Archive& e, bool i);
111
+ /** Add \a d to the end of \a e
112
+ * \relates Archive
113
+ */
114
+ Archive&
115
+ operator <<(Archive& e, float d);
116
+ /** Add \a d to the end of \a e
117
+ * \relates Archive
118
+ */
119
+ Archive&
120
+ operator <<(Archive& e, double d);
121
+
122
+ /** Read next element from \a e into \a i
123
+ * \relates Archive
124
+ */
125
+ Archive&
126
+ operator >>(Archive& e, unsigned int& i);
127
+ /** Read next element from \a e into \a i
128
+ * \relates Archive
129
+ */
130
+ Archive&
131
+ operator >>(Archive& e, int& i);
132
+ /** Read next element from \a e into \a i
133
+ * \relates Archive
134
+ */
135
+ Archive&
136
+ operator >>(Archive& e, unsigned short& i);
137
+ /** Read next element from \a e into \a i
138
+ * \relates Archive
139
+ */
140
+ Archive&
141
+ operator >>(Archive& e, short& i);
142
+ /** Read next element from \a e into \a i
143
+ * \relates Archive
144
+ */
145
+ Archive&
146
+ operator >>(Archive& e, unsigned char& i);
147
+ /** Read next element from \a e into \a i
148
+ * \relates Archive
149
+ */
150
+ Archive&
151
+ operator >>(Archive& e, char& i);
152
+ /** Read next element from \a e into \a i
153
+ * \relates Archive
154
+ */
155
+ Archive&
156
+ operator >>(Archive& e, bool& i);
157
+ /** Read next element from \a e into \a d
158
+ * \relates Archive
159
+ */
160
+ Archive&
161
+ operator >>(Archive& e, float& d);
162
+ /** Read next element from \a e into \a d
163
+ * \relates Archive
164
+ */
165
+ Archive&
166
+ operator >>(Archive& e, double& d);
167
+
168
+ /*
169
+ * Implementation
170
+ *
171
+ */
172
+
173
+ forceinline
174
+ Archive::Archive(void) : _size(0), _n(0), _a(NULL), _pos(0) {}
175
+
176
+ forceinline void
177
+ Archive::put(unsigned int i) {
178
+ if (_n==_size)
179
+ resize(_n+1);
180
+ _a[_n++] = i;
181
+ }
182
+
183
+ forceinline int
184
+ Archive::size(void) const { return _n; }
185
+
186
+ forceinline unsigned int
187
+ Archive::operator [](int i) const {
188
+ assert(i < _n);
189
+ return _a[i];
190
+ }
191
+
192
+ forceinline unsigned int
193
+ Archive::get(void) {
194
+ assert(_pos < _n);
195
+ return _a[_pos++];
196
+ }
197
+
198
+ forceinline Archive&
199
+ operator <<(Archive& e, unsigned int i) {
200
+ e.put(i);
201
+ return e;
202
+ }
203
+ forceinline Archive&
204
+ operator <<(Archive& e, int i) {
205
+ e.put(static_cast<unsigned int>(i));
206
+ return e;
207
+ }
208
+ forceinline Archive&
209
+ operator <<(Archive& e, unsigned short i) {
210
+ e.put(i);
211
+ return e;
212
+ }
213
+ forceinline Archive&
214
+ operator <<(Archive& e, short i) {
215
+ e.put(static_cast<unsigned int>(i));
216
+ return e;
217
+ }
218
+ forceinline Archive&
219
+ operator <<(Archive& e, unsigned char i) {
220
+ e.put(i);
221
+ return e;
222
+ }
223
+ forceinline Archive&
224
+ operator <<(Archive& e, char i) {
225
+ e.put(static_cast<unsigned int>(i));
226
+ return e;
227
+ }
228
+ forceinline Archive&
229
+ operator <<(Archive& e, bool i) {
230
+ e.put(static_cast<unsigned int>(i));
231
+ return e;
232
+ }
233
+ forceinline Archive&
234
+ operator <<(Archive& e, float d) {
235
+ for (size_t i=0; i<sizeof(float); i++)
236
+ e.put(static_cast<unsigned int>(reinterpret_cast<char*>(&d)[i]));
237
+ return e;
238
+ }
239
+ forceinline Archive&
240
+ operator <<(Archive& e, double d) {
241
+ for (size_t i=0; i<sizeof(double); i++)
242
+ e.put(static_cast<unsigned int>(reinterpret_cast<char*>(&d)[i]));
243
+ return e;
244
+ }
245
+
246
+ forceinline Archive&
247
+ operator >>(Archive& e, unsigned int& i) {
248
+ i = e.get();
249
+ return e;
250
+ }
251
+ forceinline Archive&
252
+ operator >>(Archive& e, int& i) {
253
+ i = static_cast<int>(e.get());
254
+ return e;
255
+ }
256
+ forceinline Archive&
257
+ operator >>(Archive& e, unsigned short& i) {
258
+ i = static_cast<unsigned short>(e.get());
259
+ return e;
260
+ }
261
+ forceinline Archive&
262
+ operator >>(Archive& e, short& i) {
263
+ i = static_cast<short>(e.get());
264
+ return e;
265
+ }
266
+ forceinline Archive&
267
+ operator >>(Archive& e, unsigned char& i) {
268
+ i = static_cast<unsigned char>(e.get());
269
+ return e;
270
+ }
271
+ forceinline Archive&
272
+ operator >>(Archive& e, char& i) {
273
+ i = static_cast<char>(e.get());
274
+ return e;
275
+ }
276
+ forceinline Archive&
277
+ operator >>(Archive& e, bool& i) {
278
+ i = static_cast<bool>(e.get());
279
+ return e;
280
+ }
281
+ forceinline Archive&
282
+ operator >>(Archive& e, float& d) {
283
+ char* cd = reinterpret_cast<char*>(&d);
284
+ for (size_t i=0; i<sizeof(float); i++)
285
+ cd[i] = static_cast<char>(e.get());
286
+ return e;
287
+ }
288
+ forceinline Archive&
289
+ operator >>(Archive& e, double& d) {
290
+ char* cd = reinterpret_cast<char*>(&d);
291
+ for (size_t i=0; i<sizeof(double); i++)
292
+ cd[i] = static_cast<char>(e.get());
293
+ return e;
294
+ }
295
+
296
+ }
297
+
298
+ // STATISTICS: kernel-branch
@@ -0,0 +1,2133 @@
1
+ /* -*- mode: C++; c-basic-offset: 2; indent-tabs-mode: nil -*- */
2
+ /*
3
+ * Main authors:
4
+ * Christian Schulte <schulte@gecode.org>
5
+ * Guido Tack <tack@gecode.org>
6
+ *
7
+ * Contributing authors:
8
+ * Gregory Crosswhite <gcross@phys.washington.edu>
9
+ *
10
+ * Copyright:
11
+ * Gregory Crosswhite, 2011
12
+ * Christian Schulte, 2003
13
+ * Guido Tack, 2004
14
+ *
15
+ * Last modified:
16
+ * $Date: 2011-08-18 20:10:04 +1000 (Thu, 18 Aug 2011) $ by $Author: tack $
17
+ * $Revision: 12313 $
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
+ #include <cstdarg>
45
+ #include <iostream>
46
+ #include <iterator>
47
+ #include <sstream>
48
+
49
+ namespace Gecode {
50
+
51
+ template<class Var> class VarArray;
52
+ template<class Var> class VarArgArray;
53
+
54
+ /** \brief Traits of arrays in %Gecode
55
+ *
56
+ * This class collects the traits of an array in Gecode.
57
+ * The traits used are the following.
58
+ * - <code>typedef Type StorageType</code> where \c Type is the type
59
+ * of an appropriate storage type for this array.
60
+ * - <code>typedef Type ValueType</code> where \c Type is the type
61
+ * of the elements of this array.
62
+ * - <code>typedef Type ArgsType</code> where \c Type is the type
63
+ * of the appropriate Args-array type (e.g., \c BoolVarArgs if \c A is
64
+ * \c BoolVarArray).
65
+ */
66
+ template<class A>
67
+ class ArrayTraits {};
68
+
69
+ /**
70
+ * \brief %Variable arrays
71
+ *
72
+ * %Variable arrays store variables. They are typically used
73
+ * for storing the variables being part of a solution.
74
+ *
75
+ * Never use them for temporary purposes, use argument arrays
76
+ * instead.
77
+ *
78
+ * %Variable arrays can be enlarged dynamically. For memory efficiency, the
79
+ * initial array is allocated in the space. When adding variables, it is
80
+ * automatically resized and allocated on the heap.
81
+ *
82
+ * \ingroup TaskVar
83
+ */
84
+ template<class Var>
85
+ class VarArray {
86
+ protected:
87
+ /// Number of variables (size)
88
+ int n;
89
+ /// Array of variables
90
+ Var* x;
91
+ public:
92
+ /// \name Associated types
93
+ //@{
94
+ /// Type of the variable stored in this array
95
+ typedef Var value_type;
96
+ /// Type of a reference to the value type
97
+ typedef Var& reference;
98
+ /// Type of a constant reference to the value type
99
+ typedef const Var& const_reference;
100
+ /// Type of a pointer to the value type
101
+ typedef Var* pointer;
102
+ /// Type of a read-only pointer to the value type
103
+ typedef const Var* const_pointer;
104
+ /// Type of the iterator used to iterate through this array's elements
105
+ typedef Var* iterator;
106
+ /// Type of the iterator used to iterate read-only through this array's elements
107
+ typedef const Var* const_iterator;
108
+ /// Type of the iterator used to iterate backwards through this array's elements
109
+ typedef std::reverse_iterator<Var*> reverse_iterator;
110
+ /// Type of the iterator used to iterate backwards and read-only through this array's elements
111
+ typedef std::reverse_iterator<const Var*> const_reverse_iterator;
112
+ //@}
113
+
114
+ //@{
115
+ /// \name Constructors and initialization
116
+ //@{
117
+ /// Default constructor (array of size 0)
118
+ VarArray(void);
119
+ /// Allocate array with \a m variables
120
+ VarArray(Space& home, int m);
121
+ /// Initialize from variable argument array \a a (copy elements)
122
+ VarArray(Space& home, const VarArgArray<Var>&);
123
+ /// Initialize from variable array \a a (share elements)
124
+ VarArray(const VarArray<Var>& a);
125
+ /// Initialize from variable array \a a (share elements)
126
+ const VarArray<Var>& operator =(const VarArray<Var>& a);
127
+ //@}
128
+
129
+ /// \name Array size
130
+ //@{
131
+ /// Return size of array (number of elements)
132
+ int size(void) const;
133
+ //@}
134
+
135
+ /// \name Array elements
136
+ //@{
137
+ /// Return variable at position \a i
138
+ Var& operator [](int i);
139
+ /// Return variable at position \a i
140
+ const Var& operator [](int i) const;
141
+ /** Return slice \f$y\f$ of length at most \a n such that forall \f$0\leq i<n\f$, \f$y_i=x_{\text{start}+i\cdot\text{inc}}\f$
142
+ *
143
+ * If \a n is -1, then all possible elements starting from \a start
144
+ * with increment \a inc are returned.
145
+ */
146
+ typename ArrayTraits<VarArgArray<Var> >::ArgsType
147
+ slice(int start, int inc=1, int n=-1);
148
+ //@}
149
+
150
+ /// \name Array iteration
151
+ //@{
152
+ /// Return an iterator at the beginning of the array
153
+ iterator begin(void);
154
+ /// Return a read-only iterator at the beginning of the array
155
+ const_iterator begin(void) const;
156
+ /// Return an iterator past the end of the array
157
+ iterator end(void);
158
+ /// Return a read-only iterator past the end of the array
159
+ const_iterator end(void) const;
160
+ /// Return a reverse iterator at the end of the array
161
+ reverse_iterator rbegin(void);
162
+ /// Return a reverse and read-only iterator at the end of the array
163
+ const_reverse_iterator rbegin(void) const;
164
+ /// Return a reverse iterator past the beginning of the array
165
+ reverse_iterator rend(void);
166
+ /// Return a reverse and read-only iterator past the beginning of the array
167
+ const_reverse_iterator rend(void) const;
168
+ //@}
169
+
170
+ /// Test if all variables are assigned
171
+ bool assigned(void) const;
172
+
173
+ /// \name Cloning
174
+ //@{
175
+ /**
176
+ * \brief Update array to be a clone of array \a a
177
+ *
178
+ * If \a share is true, sharing is retained for all shared
179
+ * data structures. Otherwise, for each of them an independent
180
+ * copy is created.
181
+ */
182
+ void update(Space&, bool share, VarArray<Var>& a);
183
+ //@}
184
+ private:
185
+ static void* operator new(size_t);
186
+ static void operator delete(void*,size_t);
187
+ };
188
+
189
+ /** Concatenate \a x and \a y and return result
190
+ * \relates VarArray
191
+ */
192
+ template<class T>
193
+ typename ArrayTraits<VarArray<T> >::ArgsType
194
+ operator +(const VarArray<T>& x, const VarArgArray<T>& y);
195
+
196
+ /** Concatenate \a x and \a y and return result
197
+ * \relates VarArray
198
+ */
199
+ template<class T>
200
+ typename ArrayTraits<VarArray<T> >::ArgsType
201
+ operator +(const VarArray<T>& x, const VarArray<T>& y);
202
+
203
+ /** Concatenate \a x and \a y and return result
204
+ * \relates VarArray
205
+ */
206
+ template<class T>
207
+ typename ArrayTraits<VarArray<T> >::ArgsType
208
+ operator +(const VarArgArray<T>& x, const VarArray<T>& y);
209
+
210
+ /** Concatenate \a x and \a y and return result
211
+ * \relates VarArray
212
+ */
213
+ template<class T>
214
+ typename ArrayTraits<VarArray<T> >::ArgsType
215
+ operator +(const VarArray<T>& x, const T& y);
216
+
217
+ /** Concatenate \a x and \a y and return result
218
+ * \relates VarArray
219
+ */
220
+ template<class T>
221
+ typename ArrayTraits<VarArray<T> >::ArgsType
222
+ operator +(const T& x, const VarArray<T>& y);
223
+
224
+ /**
225
+ * \brief View arrays
226
+ *
227
+ * View arrays store views. They are typically used for storing the
228
+ * views with which propagators and branchers compute.
229
+ * \ingroup TaskActor
230
+ */
231
+
232
+ template<class View>
233
+ class ViewArray {
234
+ private:
235
+ /// Number of views (size)
236
+ int n;
237
+ /// Views
238
+ View* x;
239
+ /// Sort order for views
240
+ template<class X>
241
+ class ViewLess {
242
+ public:
243
+ bool operator ()(const X&, const X&);
244
+ };
245
+ /// Sort \a n views \a x according to \a ViewLess
246
+ static void sort(View* x, int n);
247
+ public:
248
+ /// \name Associated types
249
+ //@{
250
+ /// Type of the view stored in this array
251
+ typedef View value_type;
252
+ /// Type of a reference to the value type
253
+ typedef View& reference;
254
+ /// Type of a constant reference to the value type
255
+ typedef const View& const_reference;
256
+ /// Type of a pointer to the value type
257
+ typedef View* pointer;
258
+ /// Type of a read-only pointer to the value type
259
+ typedef const View* const_pointer;
260
+ /// Type of the iterator used to iterate through this array's elements
261
+ typedef View* iterator;
262
+ /// Type of the iterator used to iterate read-only through this array's elements
263
+ typedef const View* const_iterator;
264
+ /// Type of the iterator used to iterate backwards through this array's elements
265
+ typedef std::reverse_iterator<View*> reverse_iterator;
266
+ /// Type of the iterator used to iterate backwards and read-only through this array's elements
267
+ typedef std::reverse_iterator<const View*> const_reverse_iterator;
268
+ //@}
269
+
270
+ /// \name Constructors and initialization
271
+ //@{
272
+ /// Default constructor (array of size 0)
273
+ ViewArray(void);
274
+ /// Allocate array with \a m views
275
+ ViewArray(Space& home, int m);
276
+ /// Allocate array with \a m views
277
+ ViewArray(Region& r, int m);
278
+ /// Initialize from view array \a a (share elements)
279
+ ViewArray(const ViewArray<View>& a);
280
+ /// Initialize from view array \a a (copy elements)
281
+ ViewArray(Space& home, const ViewArray<View>& a);
282
+ /// Initialize from view array \a a (copy elements)
283
+ ViewArray(Region& r, const ViewArray<View>& a);
284
+ /// Initialize from view array \a a (share elements)
285
+ const ViewArray<View>& operator =(const ViewArray<View>& a);
286
+ /**
287
+ * \brief Initialize from variable argument array \a a (copy elements)
288
+ *
289
+ * Note that the view type \a View must provide a constructor
290
+ * for the associated \a Var type.
291
+ */
292
+ template<class Var>
293
+ ViewArray(Space& home, const VarArgArray<Var>& a)
294
+ : n(a.size()) {
295
+ // This may not be in the hpp file (to satisfy the MS compiler)
296
+ if (n>0) {
297
+ x = home.alloc<View>(n);
298
+ for (int i=n; i--; )
299
+ x[i]=a[i];
300
+ } else {
301
+ x = NULL;
302
+ }
303
+ }
304
+ /**
305
+ * \brief Initialize from variable argument array \a a (copy elements)
306
+ *
307
+ * Note that the view type \a View must provide a constructor
308
+ * for the associated \a Var type.
309
+ */
310
+ template<class Var>
311
+ ViewArray(Region& r, const VarArgArray<Var>& a)
312
+ : n(a.size()) {
313
+ // This may not be in the hpp file (to satisfy the MS compiler)
314
+ if (n>0) {
315
+ x = r.alloc<View>(n);
316
+ for (int i=n; i--; )
317
+ x[i]=a[i];
318
+ } else {
319
+ x = NULL;
320
+ }
321
+ }
322
+ //@}
323
+
324
+ /// \name Array size
325
+ //@{
326
+ /// Return size of array (number of elements)
327
+ int size(void) const;
328
+ /// Decrease size of array (number of elements)
329
+ void size(int n);
330
+ //@}
331
+
332
+ /// \name Array elements
333
+ //@{
334
+ /// Return view at position \a i
335
+ View& operator [](int i);
336
+ /// Return view at position \a i
337
+ const View& operator [](int i) const;
338
+ //@}
339
+
340
+ /// \name Array iteration
341
+ //@{
342
+ /// Return an iterator at the beginning of the array
343
+ iterator begin(void);
344
+ /// Return a read-only iterator at the beginning of the array
345
+ const_iterator begin(void) const;
346
+ /// Return an iterator past the end of the array
347
+ iterator end(void);
348
+ /// Return a read-only iterator past the end of the array
349
+ const_iterator end(void) const;
350
+ /// Return a reverse iterator at the end of the array
351
+ reverse_iterator rbegin(void);
352
+ /// Return a reverse and read-only iterator at the end of the array
353
+ const_reverse_iterator rbegin(void) const;
354
+ /// Return a reverse iterator past the beginning of the array
355
+ reverse_iterator rend(void);
356
+ /// Return a reverse and read-only iterator past the beginning of the array
357
+ const_reverse_iterator rend(void) const;
358
+ //@}
359
+
360
+ /// \name Dependencies
361
+ //@{
362
+ /**
363
+ * \brief Subscribe propagator \a p with propagation condition \a pc to variable
364
+ *
365
+ * In case \a process is false, the propagator is just subscribed but
366
+ * not processed for execution (this must be used when creating
367
+ * subscriptions during propagation).
368
+ */
369
+ void subscribe(Space& home, Propagator& p, PropCond pc, bool process=true);
370
+ /// Cancel subscription of propagator \a p with propagation condition \a pc to all views
371
+ void cancel(Space& home, Propagator& p, PropCond pc);
372
+ /// Subscribe advisor \a a to variable
373
+ void subscribe(Space& home, Advisor& a);
374
+ /// Cancel subscription of advisor \a a
375
+ void cancel(Space& home, Advisor& a);
376
+ //@}
377
+
378
+ /// \name Cloning
379
+ //@{
380
+ /**
381
+ * \brief Update array to be a clone of array \a a
382
+ *
383
+ * If \a share is true, sharing is retained for all shared
384
+ * data structures. Otherwise, for each of them an independent
385
+ * copy is created.
386
+ */
387
+ void update(Space&, bool share, ViewArray<View>& a);
388
+ //@}
389
+
390
+
391
+ /// \name Moving elements
392
+ //@{
393
+ /// Move view from position 0 to position \a i (shift elements to the left)
394
+ void move_fst(int i);
395
+ /// Move view from position \c size()-1 to position \a i (truncate array by one)
396
+ void move_lst(int i);
397
+ /** \brief Move view from position 0 to position \a i (shift elements to the left)
398
+ *
399
+ * Before moving, cancel subscription of propagator \a p with
400
+ * propagation condition \a pc to view at position \a i.
401
+ */
402
+ void move_fst(int i, Space& home, Propagator& p, PropCond pc);
403
+ /** \brief Move view from position \c size()-1 to position \a i (truncate array by one)
404
+ *
405
+ * Before moving, cancel subscription of propagator \a p with
406
+ * propagation condition \a pc to view at position \a i.
407
+ */
408
+ void move_lst(int i, Space& home, Propagator& p, PropCond pc);
409
+ /** \brief Move view from position 0 to position \a i (shift elements to the left)
410
+ *
411
+ * Before moving, cancel subscription of advisor \a a
412
+ * to view at position \a i.
413
+ */
414
+ void move_fst(int i, Space& home, Advisor& a);
415
+ /** \brief Move view from position \c size()-1 to position \a i (truncate array by one)
416
+ *
417
+ * Before moving, cancel subscription of advisor \a a to view
418
+ * at position \a i.
419
+ */
420
+ void move_lst(int i, Space& home, Advisor& a);
421
+ //@}
422
+
423
+ /// \name Dropping elements
424
+ //@{
425
+ /// Drop views from positions 0 to \a i-1 from array
426
+ void drop_fst(int i);
427
+ /// Drop views from positions \a i+1 to \c size()-1 from array
428
+ void drop_lst(int i);
429
+ /** \brief Drop views from positions 0 to \a i-1 from array
430
+ *
431
+ * Before moving, cancel subscription of propagator \a p with
432
+ * propagation condition \a pc to views at positions 0 to \a i-1.
433
+ */
434
+ void drop_fst(int i, Space& home, Propagator& p, PropCond pc);
435
+ /** \brief Drop assigned views from positions \a i+1 to \c size()-1 from array
436
+ *
437
+ * Before moving, cancel subscription of propagator \a p with
438
+ * propagation condition \a pc to views at positions \a i+1 to
439
+ * \c size()-1.
440
+ */
441
+ void drop_lst(int i, Space& home, Propagator& p, PropCond pc);
442
+ /** \brief Drop views from positions 0 to \a i-1 from array
443
+ *
444
+ * Before moving, cancel subscription of advisor \a a to views at
445
+ * positions 0 to \a i-1.
446
+ */
447
+ void drop_fst(int i, Space& home, Advisor& a);
448
+ /** \brief Drop assigned views from positions \a i+1 to \c size()-1 from array
449
+ *
450
+ * Before moving, cancel subscription of advisor \a a to views at
451
+ * positions \a i+1 to \c size()-1.
452
+ */
453
+ void drop_lst(int i, Space& home, Advisor& a);
454
+ //@}
455
+
456
+ /// Test if all variables are assigned
457
+ bool assigned(void) const;
458
+
459
+ /// \name View equality
460
+ //@{
461
+ /**
462
+ * \brief Test whether array has multiple occurence of the same view
463
+ *
464
+ * Note that assigned views are ignored.
465
+ */
466
+ bool same(const Space& home) const;
467
+ /**
468
+ * \brief Test whether array contains a view being the same as \a y
469
+ *
470
+ * Note that assigned views are ignored.
471
+ */
472
+ bool same(const Space& home, const View& y) const;
473
+ /// Remove all duplicate views from array (changes element order)
474
+ void unique(const Space& home);
475
+ //@}
476
+
477
+ /// \name View sharing
478
+ //@{
479
+ /**
480
+ * \brief Test whether array contains shared views
481
+ *
482
+ * Note that assigned views are ignored.
483
+ */
484
+ bool shared(const Space& home) const;
485
+ /**
486
+ * \brief Test whether array contains a view being shared with \a y
487
+ *
488
+ * Note that assigned views are ignored.
489
+ */
490
+ template<class ViewY>
491
+ bool shared(const Space& home, const ViewY& y) const;
492
+ /**
493
+ * \brief Test whether array together with array \a y contains shared views
494
+ *
495
+ * Note that assigned views are ignored.
496
+ */
497
+ template<class ViewY>
498
+ bool shared(const Space& home, const ViewArray<ViewY>& y) const;
499
+ //@}
500
+
501
+ private:
502
+ static void* operator new(size_t);
503
+ static void operator delete(void*,size_t);
504
+ };
505
+
506
+ /**
507
+ * \brief Base-class for argument arrays
508
+ *
509
+ * Argument arrays are used as convenient mechanism of passing arguments
510
+ * when calling functions as they combine both the size and the elements
511
+ * of an array. For a small number of elements, memory is allocated by
512
+ * creating an argument array object. Otherwise the memory is allocated
513
+ * from the heap.
514
+ *
515
+ * This base-class is not to be used directly, use PrimArgArray for
516
+ * argument arrays of primitive types, VarArgArray for argument
517
+ * arrays storing variables, and ArgArray for any other type.
518
+ */
519
+ template<class T>
520
+ class ArgArrayBase {
521
+ protected:
522
+ /// Number of elements
523
+ int n;
524
+ /// Allocated size of the array
525
+ int capacity;
526
+ /// Element array
527
+ T* a;
528
+ /// How many elements are possible inside array
529
+ static const int onstack_size = 16;
530
+ /// In-array storage for elements
531
+ T onstack[onstack_size];
532
+ /// Allocate memory for \a n elements
533
+ T* allocate(int n);
534
+ /// Resize to hold at least \a i additional elements
535
+ void resize(int i);
536
+ /// Return this array concatenated with \a x
537
+ template<class A>
538
+ A concat(const ArgArrayBase<T>& x) const;
539
+ /// Return this array concatenated with \a x
540
+ template<class A>
541
+ A concat(const T& x) const;
542
+ /// Insert a new element \a x at the end of the array (increase size by 1)
543
+ template<class A>
544
+ A& append(const T& x);
545
+ /// Append \a x to the end of the array
546
+ template<class A>
547
+ A& append(const ArgArrayBase<T>& x);
548
+ /** Return slice \f$y\f$ of length at most \a n such that forall \f$0\leq i<n\f$, \f$y_i=x_{\text{start}+i\cdot\text{inc}}\f$
549
+ *
550
+ * If \a n is -1, then all possible elements starting from \a start
551
+ * with increment \a inc are returned.
552
+ */
553
+ template<class A>
554
+ A slice(int start, int inc=1, int n=-1);
555
+ public:
556
+ /// \name Associated types
557
+ //@{
558
+ /// Type of the view stored in this array
559
+ typedef T value_type;
560
+ /// Type of a reference to the value type
561
+ typedef T& reference;
562
+ /// Type of a constant reference to the value type
563
+ typedef const T& const_reference;
564
+ /// Type of a pointer to the value type
565
+ typedef T* pointer;
566
+ /// Type of a read-only pointer to the value type
567
+ typedef const T* const_pointer;
568
+ /// Type of the iterator used to iterate through this array's elements
569
+ typedef T* iterator;
570
+ /// Type of the iterator used to iterate read-only through this array's elements
571
+ typedef const T* const_iterator;
572
+ /// Type of the iterator used to iterate backwards through this array's elements
573
+ typedef std::reverse_iterator<T*> reverse_iterator;
574
+ /// Type of the iterator used to iterate backwards and read-only through this array's elements
575
+ typedef std::reverse_iterator<const T*> const_reverse_iterator;
576
+ //@}
577
+
578
+ /// \name Constructors and initialization
579
+ //@{
580
+ /// Allocate empty array
581
+ ArgArrayBase(void);
582
+ /// Allocate array with \a n elements
583
+ explicit ArgArrayBase(int n);
584
+ /// Initialize from argument array \a a (copy elements)
585
+ ArgArrayBase(const ArgArrayBase<T>& a);
586
+ /// Initialize from view array \a a (copy elements)
587
+ const ArgArrayBase<T>& operator =(const ArgArrayBase<T>& a);
588
+ //@}
589
+
590
+ /// \name Array size
591
+ //@{
592
+ /// Return size of array (number of elements)
593
+ int size(void) const;
594
+ //@}
595
+
596
+ /// \name Array elements
597
+ //@{
598
+ /// Return element at position \a i
599
+ T& operator [](int i);
600
+ /// Return element at position \a i
601
+ const T& operator [](int i) const;
602
+ //@}
603
+
604
+ /// \name Array iteration
605
+ //@{
606
+ /// Return an iterator at the beginning of the array
607
+ iterator begin(void);
608
+ /// Return a read-only iterator at the beginning of the array
609
+ const_iterator begin(void) const;
610
+ /// Return an iterator past the end of the array
611
+ iterator end(void);
612
+ /// Return a read-only iterator past the end of the array
613
+ const_iterator end(void) const;
614
+ /// Return a reverse iterator at the end of the array
615
+ reverse_iterator rbegin(void);
616
+ /// Return a reverse and read-only iterator at the end of the array
617
+ const_reverse_iterator rbegin(void) const;
618
+ /// Return a reverse iterator past the beginning of the array
619
+ reverse_iterator rend(void);
620
+ /// Return a reverse and read-only iterator past the beginning of the array
621
+ const_reverse_iterator rend(void) const;
622
+ //@}
623
+
624
+ /// \name Destructor
625
+ //@{
626
+ /// Destructor
627
+ ~ArgArrayBase(void);
628
+ //@}
629
+ private:
630
+ static void* operator new(size_t);
631
+ static void operator delete(void*,size_t);
632
+ };
633
+
634
+ template<class> class PrimArgArray;
635
+
636
+ /** Concatenate \a x and \a y and return result
637
+ * \relates PrimArgArray
638
+ */
639
+ template<class T>
640
+ typename ArrayTraits<PrimArgArray<T> >::ArgsType
641
+ operator +(const PrimArgArray<T>& x, const PrimArgArray<T>& y);
642
+
643
+ /** Concatenate \a x and \a y and return result
644
+ * \relates PrimArgArray
645
+ */
646
+ template<class T>
647
+ typename ArrayTraits<PrimArgArray<T> >::ArgsType
648
+ operator +(const PrimArgArray<T>& x, const T& y);
649
+
650
+ /** Concatenate \a x and \a y and return result
651
+ * \relates PrimArgArray
652
+ */
653
+ template<class T>
654
+ typename ArrayTraits<PrimArgArray<T> >::ArgsType
655
+ operator +(const T& x, const PrimArgArray<T>& y);
656
+
657
+ /**
658
+ * \brief Argument array for primtive types
659
+ *
660
+ * Argument arrays are used as convenient mechanism of passing arguments
661
+ * when calling functions as they combine both the size and the elements
662
+ * of an array. For a small number of elements, memory is allocated by
663
+ * creating an argument array object. Otherwise the memory is allocated
664
+ * from the heap.
665
+ *
666
+ * \ingroup TaskVar
667
+ */
668
+ template<class T>
669
+ class PrimArgArray : public ArgArrayBase<T> {
670
+ protected:
671
+ using ArgArrayBase<T>::a;
672
+ public:
673
+ using ArgArrayBase<T>::size;
674
+ /// \name Constructors and initialization
675
+ //@{
676
+ /// Allocate empty array
677
+ PrimArgArray(void);
678
+ /// Allocate array with \a n elements
679
+ explicit PrimArgArray(int n);
680
+ /// Allocate array with \a n elements and initialize with \a e0, ...
681
+ PrimArgArray(int n, T e0, ...);
682
+ /// Allocate array with \a n elements and initialize with elements from array \a e
683
+ PrimArgArray(int n, const T* e);
684
+ /// Initialize from primitive argument array \a a (copy elements)
685
+ PrimArgArray(const PrimArgArray<T>& a);
686
+ //@}
687
+ /// \name Array elements
688
+ //@{
689
+ /** Return slice \f$y\f$ of length at most \a n such that forall \f$0\leq i<n\f$, \f$y_i=x_{\text{start}+i\cdot\text{inc}}\f$
690
+ *
691
+ * If \a n is -1, then all possible elements starting from \a start
692
+ * with increment \a inc are returned.
693
+ */
694
+ typename ArrayTraits<PrimArgArray<T> >::ArgsType
695
+ slice(int start, int inc=1, int n=-1);
696
+ //@}
697
+ /// \name Appending elements
698
+ //@{
699
+ /// Insert a new element \a x at the end of the array (increase size by 1)
700
+ typename ArrayTraits<PrimArgArray<T> >::ArgsType&
701
+ operator <<(const T& x);
702
+ /// Append \a x to the end of the array
703
+ typename ArrayTraits<PrimArgArray<T> >::ArgsType&
704
+ operator <<(const PrimArgArray<T>& x);
705
+ //@}
706
+
707
+ friend typename ArrayTraits<PrimArgArray<T> >::ArgsType
708
+ operator + <>(const PrimArgArray<T>& x, const PrimArgArray<T>& y);
709
+ friend typename ArrayTraits<PrimArgArray<T> >::ArgsType
710
+ operator + <>(const PrimArgArray<T>& x, const T& y);
711
+ friend
712
+ typename ArrayTraits<PrimArgArray<T> >::ArgsType
713
+ operator + <>(const T& x, const PrimArgArray<T>& y);
714
+ };
715
+
716
+ template<class> class ArgArray;
717
+
718
+ /** Concatenate \a x and \a y and return result
719
+ * \relates ArgArray
720
+ */
721
+ template<class T>
722
+ typename ArrayTraits<ArgArray<T> >::ArgsType
723
+ operator +(const ArgArray<T>& x, const ArgArray<T>& y);
724
+
725
+ /** Concatenate \a x and \a y and return result
726
+ * \relates ArgArray
727
+ */
728
+ template<class T>
729
+ typename ArrayTraits<ArgArray<T> >::ArgsType
730
+ operator +(const ArgArray<T>& x, const T& y);
731
+
732
+ /** Concatenate \a x and \a y and return result
733
+ * \relates ArgArray
734
+ */
735
+ template<class T>
736
+ typename ArrayTraits<ArgArray<T> >::ArgsType
737
+ operator +(const T& x, const ArgArray<T>& y);
738
+
739
+ /**
740
+ * \brief Argument array for non-primitive types
741
+ *
742
+ * Argument arrays are used as convenient mechanism of passing arguments
743
+ * when calling functions as they combine both the size and the elements
744
+ * of an array. For a small number of elements, memory is allocated by
745
+ * creating an argument array object. Otherwise the memory is allocated
746
+ * from the heap.
747
+ *
748
+ * \ingroup TaskVar
749
+ */
750
+ template<class T>
751
+ class ArgArray : public ArgArrayBase<T> {
752
+ protected:
753
+ using ArgArrayBase<T>::a;
754
+ public:
755
+ using ArgArrayBase<T>::size;
756
+ /// \name Constructors and initialization
757
+ //@{
758
+ /// Allocate empty array
759
+ ArgArray(void);
760
+ /// Allocate array with \a n elements
761
+ explicit ArgArray(int n);
762
+ /// Allocate array with \a n elements and initialize with elements from array \a e
763
+ ArgArray(int n, const T* e);
764
+ /// Initialize from primitive argument array \a a (copy elements)
765
+ ArgArray(const ArgArray<T>& a);
766
+ //@}
767
+ /// \name Array elements
768
+ //@{
769
+ /// Return slice \f$y\f$ of length \a n such that forall \f$0\leq i<n\f$, \f$y_i=x_{\text{start}+i\cdot\text{inc}}\f$
770
+ typename ArrayTraits<ArgArray<T> >::ArgsType
771
+ slice(int start, int inc=1, int n=-1);
772
+ //@}
773
+ /// \name Appending elements
774
+ //@{
775
+ /// Insert a new element \a x at the end of the array (increase size by 1)
776
+ typename ArrayTraits<ArgArray<T> >::ArgsType&
777
+ operator <<(const T& x);
778
+ /// Append \a x to the end of the array
779
+ typename ArrayTraits<ArgArray<T> >::ArgsType&
780
+ operator <<(const ArgArray<T>& x);
781
+ //@}
782
+
783
+ friend typename ArrayTraits<ArgArray<T> >::ArgsType
784
+ operator + <>(const ArgArray<T>& x, const ArgArray<T>& y);
785
+ friend typename ArrayTraits<ArgArray<T> >::ArgsType
786
+ operator + <>(const ArgArray<T>& x, const T& y);
787
+ friend
788
+ typename ArrayTraits<ArgArray<T> >::ArgsType
789
+ operator + <>(const T& x, const ArgArray<T>& y);
790
+ };
791
+
792
+ template<class> class VarArgArray;
793
+
794
+ /** Concatenate \a x and \a y and return result
795
+ * \relates ArgArray
796
+ */
797
+ template<class Var>
798
+ typename ArrayTraits<VarArgArray<Var> >::ArgsType
799
+ operator +(const VarArgArray<Var>& x, const VarArgArray<Var>& y);
800
+
801
+ /** Concatenate \a x and \a y and return result
802
+ * \relates ArgArray
803
+ */
804
+ template<class Var>
805
+ typename ArrayTraits<VarArgArray<Var> >::ArgsType
806
+ operator +(const VarArgArray<Var>& x, const Var& y);
807
+
808
+ /** Concatenate \a x and \a y and return result
809
+ * \relates ArgArray
810
+ */
811
+ template<class Var>
812
+ typename ArrayTraits<VarArgArray<Var> >::ArgsType
813
+ operator +(const Var& x, const VarArgArray<Var>& y);
814
+
815
+ /**
816
+ * \brief Argument array for variables
817
+ *
818
+ * Argument arrays are used as convenient mechanism of passing arguments
819
+ * when calling functions as they combine both the size and the elements
820
+ * of an array. For a small number of elements, memory is allocated by
821
+ * creating an argument array object. Otherwise the memory is allocated
822
+ * from the heap.
823
+ *
824
+ * \ingroup TaskVar
825
+ */
826
+ template<class Var>
827
+ class VarArgArray : public ArgArrayBase<Var> {
828
+ protected:
829
+ using ArgArrayBase<Var>::a;
830
+ using ArgArrayBase<Var>::n;
831
+ /// Sort order for variables
832
+ class VarLess {
833
+ public:
834
+ bool operator ()(const Var&, const Var&);
835
+ };
836
+ public:
837
+ using ArgArrayBase<Var>::size;
838
+ /// \name Constructors and initialization
839
+ //@{
840
+ /// Allocate empty array
841
+ VarArgArray(void);
842
+ /// Allocate array with \a n elements
843
+ explicit VarArgArray(int n);
844
+ /// Initialize from variable argument array \a a (copy elements)
845
+ VarArgArray(const VarArgArray<Var>& a);
846
+ /// Initialize from variable array \a a (copy elements)
847
+ VarArgArray(const VarArray<Var>& a);
848
+ //@}
849
+ /// \name Array elements
850
+ //@{
851
+ /// Return slice \f$y\f$ of length \a n such that forall \f$0\leq i<n\f$, \f$y_i=x_{\text{start}+i\cdot\text{inc}}\f$
852
+ typename ArrayTraits<VarArgArray<Var> >::ArgsType
853
+ slice(int start, int inc=1, int n=-1);
854
+ //@}
855
+ /// \name Appending elements
856
+ //@{
857
+ /// Insert a new element \a x at the end of the array (increase size by 1)
858
+ typename ArrayTraits<VarArgArray<Var> >::ArgsType&
859
+ operator <<(const Var& x);
860
+ /// Append \a x to the end of the array
861
+ typename ArrayTraits<VarArgArray<Var> >::ArgsType&
862
+ operator <<(const VarArgArray<Var>& x);
863
+ //@}
864
+
865
+ /// Test if all variables are assigned
866
+ bool assigned(void) const;
867
+
868
+ friend typename ArrayTraits<VarArgArray<Var> >::ArgsType
869
+ operator + <>(const VarArgArray<Var>& x, const VarArgArray<Var>& y);
870
+ friend typename ArrayTraits<VarArgArray<Var> >::ArgsType
871
+ operator + <>(const VarArgArray<Var>& x, const Var& y);
872
+ friend
873
+ typename ArrayTraits<VarArgArray<Var> >::ArgsType
874
+ operator + <>(const Var& x, const VarArgArray<Var>& y);
875
+
876
+ /// \name Variable equality
877
+ //@{
878
+ /**
879
+ * \brief Test whether array contains same variable multiply
880
+ *
881
+ * Note that assigned variables are ignored.
882
+ */
883
+ bool same(const Space& home) const;
884
+ /**
885
+ * \brief Test whether array contains variable \a y
886
+ *
887
+ * Note that assigned variables are ignored.
888
+ */
889
+ bool same(const Space& home, const Var& y) const;
890
+ /**
891
+ * \brief Test whether all elements from array and \a y contains same variable multiply
892
+ *
893
+ * Note that assigned variables are ignored.
894
+ */
895
+ bool same(const Space& home, const VarArgArray<Var>& y) const;
896
+ //@}
897
+ };
898
+
899
+ /**
900
+ * \brief Print array elements enclosed in curly brackets
901
+ * \relates VarArray
902
+ */
903
+ template<class Char, class Traits, class Var>
904
+ std::basic_ostream<Char,Traits>&
905
+ operator <<(std::basic_ostream<Char,Traits>& os,
906
+ const VarArray<Var>& x);
907
+
908
+ /**
909
+ * \brief Print array elements enclosed in curly brackets
910
+ * \relates ViewArray
911
+ */
912
+ template<class Char, class Traits, class View>
913
+ std::basic_ostream<Char,Traits>&
914
+ operator <<(std::basic_ostream<Char,Traits>& os, const ViewArray<View>& x);
915
+
916
+ /**
917
+ * \brief Print array elements enclosed in curly brackets
918
+ * \relates ArgArrayBase
919
+ */
920
+ template<class Char, class Traits, class T>
921
+ std::basic_ostream<Char,Traits>&
922
+ operator <<(std::basic_ostream<Char,Traits>& os, const ArgArrayBase<T>& x);
923
+
924
+
925
+ /*
926
+ * Implementation
927
+ *
928
+ */
929
+
930
+ /*
931
+ * Variable arrays
932
+ *
933
+ * These arrays are usually allocated in the space, but if they are resized,
934
+ * the new array is allocated on the heap. The size (n) and capacity show
935
+ * where the array is allocated: it is in the space if and only if
936
+ * n==capacity.
937
+ *
938
+ */
939
+
940
+ template<class Var>
941
+ forceinline
942
+ VarArray<Var>::VarArray(void) : n(0), x(NULL) {}
943
+
944
+ template<class Var>
945
+ forceinline
946
+ VarArray<Var>::VarArray(Space& home, int n0)
947
+ : n(n0) {
948
+ // Allocate from space
949
+ x = (n>0) ? home.alloc<Var>(n) : NULL;
950
+ }
951
+
952
+ template<class Var>
953
+ forceinline
954
+ VarArray<Var>::VarArray(const VarArray<Var>& a) {
955
+ n = a.n; x = a.x;
956
+ }
957
+
958
+ template<class Var>
959
+ inline const VarArray<Var>&
960
+ VarArray<Var>::operator =(const VarArray<Var>& a) {
961
+ n = a.n; x = a.x;
962
+ return *this;
963
+ }
964
+
965
+ template<class Var>
966
+ forceinline int
967
+ VarArray<Var>::size(void) const {
968
+ return n;
969
+ }
970
+
971
+ template<class Var>
972
+ forceinline Var&
973
+ VarArray<Var>::operator [](int i) {
974
+ assert((i >= 0) && (i < size()));
975
+ return x[i];
976
+ }
977
+
978
+ template<class Var>
979
+ forceinline const Var&
980
+ VarArray<Var>::operator [](int i) const {
981
+ assert((i >= 0) && (i < size()));
982
+ return x[i];
983
+ }
984
+
985
+ template<class Var>
986
+ typename ArrayTraits<VarArgArray<Var> >::ArgsType
987
+ VarArray<Var>::slice(int start, int inc, int maxN) {
988
+ assert(n==0 || start < n);
989
+ if (n==0 || maxN<0)
990
+ maxN = n;
991
+ int s;
992
+ if (inc == 0)
993
+ s = n-start;
994
+ else if (inc > 0)
995
+ s = (n-start)/inc + ((n-start) % inc == 0 ? 0 : 1);
996
+ else
997
+ s = (start+1)/-inc + ((start+1) % -inc == 0 ? 0 : 1);
998
+ typename ArrayTraits<VarArgArray<Var> >::ArgsType r(std::min(maxN,s));
999
+ for (int i=0; i<r.size(); i++, start+=inc)
1000
+ r[i] = x[start];
1001
+ return r;
1002
+ }
1003
+
1004
+ template<class Var>
1005
+ forceinline typename VarArray<Var>::iterator
1006
+ VarArray<Var>::begin(void) {
1007
+ return x;
1008
+ }
1009
+
1010
+ template<class Var>
1011
+ forceinline typename VarArray<Var>::const_iterator
1012
+ VarArray<Var>::begin(void) const {
1013
+ return x;
1014
+ }
1015
+
1016
+ template<class Var>
1017
+ forceinline typename VarArray<Var>::iterator
1018
+ VarArray<Var>::end(void) {
1019
+ return x+n;
1020
+ }
1021
+
1022
+ template<class Var>
1023
+ forceinline typename VarArray<Var>::const_iterator
1024
+ VarArray<Var>::end(void) const {
1025
+ return x+n;
1026
+ }
1027
+
1028
+ template<class Var>
1029
+ forceinline typename VarArray<Var>::reverse_iterator
1030
+ VarArray<Var>::rbegin(void) {
1031
+ return reverse_iterator(x+n);
1032
+ }
1033
+
1034
+ template<class Var>
1035
+ forceinline typename VarArray<Var>::const_reverse_iterator
1036
+ VarArray<Var>::rbegin(void) const {
1037
+ return const_reverse_iterator(x+n);
1038
+ }
1039
+
1040
+ template<class Var>
1041
+ forceinline typename VarArray<Var>::reverse_iterator
1042
+ VarArray<Var>::rend(void) {
1043
+ return reverse_iterator(x);
1044
+ }
1045
+
1046
+ template<class Var>
1047
+ forceinline typename VarArray<Var>::const_reverse_iterator
1048
+ VarArray<Var>::rend(void) const {
1049
+ return const_reverse_iterator(x);
1050
+ }
1051
+
1052
+ template<class Var>
1053
+ forceinline void
1054
+ VarArray<Var>::update(Space& home, bool share, VarArray<Var>& a) {
1055
+ n = a.n;
1056
+ if (n > 0) {
1057
+ x = home.alloc<Var>(n);
1058
+ for (int i = n; i--;)
1059
+ x[i].update(home, share, a.x[i]);
1060
+ } else {
1061
+ x = NULL;
1062
+ }
1063
+ }
1064
+
1065
+ template<class Var>
1066
+ forceinline bool
1067
+ VarArray<Var>::assigned(void) const {
1068
+ for (int i = n; i--;)
1069
+ if (!x[i].assigned())
1070
+ return false;
1071
+ return true;
1072
+ }
1073
+
1074
+ template<class Var>
1075
+ void*
1076
+ VarArray<Var>::operator new(size_t) {
1077
+ return NULL;
1078
+ }
1079
+
1080
+ template<class Var>
1081
+ void
1082
+ VarArray<Var>::operator delete(void*,size_t) {
1083
+ }
1084
+
1085
+ template<class Var>
1086
+ typename ArrayTraits<VarArray<Var> >::ArgsType
1087
+ operator +(const VarArray<Var>& x, const VarArray<Var>& y) {
1088
+ typename ArrayTraits<VarArray<Var> >::ArgsType r(x.size()+y.size());
1089
+ for (int i=x.size(); i--;)
1090
+ r[i] = x[i];
1091
+ for (int i=y.size(); i--;)
1092
+ r[x.size()+i] = y[i];
1093
+ return r;
1094
+ }
1095
+
1096
+ template<class Var>
1097
+ typename ArrayTraits<VarArray<Var> >::ArgsType
1098
+ operator +(const VarArray<Var>& x, const VarArgArray<Var>& y) {
1099
+ typename ArrayTraits<VarArray<Var> >::ArgsType r(x.size()+y.size());
1100
+ for (int i=x.size(); i--;)
1101
+ r[i] = x[i];
1102
+ for (int i=y.size(); i--;)
1103
+ r[x.size()+i] = y[i];
1104
+ return r;
1105
+ }
1106
+
1107
+ template<class Var>
1108
+ typename ArrayTraits<VarArray<Var> >::ArgsType
1109
+ operator +(const VarArgArray<Var>& x, const VarArray<Var>& y) {
1110
+ typename ArrayTraits<VarArray<Var> >::ArgsType r(x.size()+y.size());
1111
+ for (int i=x.size(); i--;)
1112
+ r[i] = x[i];
1113
+ for (int i=y.size(); i--;)
1114
+ r[x.size()+i] = y[i];
1115
+ return r;
1116
+ }
1117
+
1118
+ template<class Var>
1119
+ typename ArrayTraits<VarArray<Var> >::ArgsType
1120
+ operator +(const VarArray<Var>& x, const Var& y) {
1121
+ typename ArrayTraits<VarArray<Var> >::ArgsType r(x.size()+1);
1122
+ for (int i=x.size(); i--;)
1123
+ r[i] = x[i];
1124
+ r[x.size()] = y;
1125
+ return r;
1126
+ }
1127
+
1128
+ template<class Var>
1129
+ typename ArrayTraits<VarArray<Var> >::ArgsType
1130
+ operator +(const Var& x, const VarArray<Var>& y) {
1131
+ typename ArrayTraits<VarArray<Var> >::ArgsType r(y.size()+1);
1132
+ r[0] = x;
1133
+ for (int i=y.size(); i--;)
1134
+ r[1+i] = y[i];
1135
+ return r;
1136
+ }
1137
+
1138
+ /*
1139
+ * View arrays
1140
+ *
1141
+ */
1142
+
1143
+ template<class View>
1144
+ forceinline
1145
+ ViewArray<View>::ViewArray(void) : n(0), x(NULL) {}
1146
+
1147
+ template<class View>
1148
+ forceinline
1149
+ ViewArray<View>::ViewArray(Space& home, int n0)
1150
+ : n(n0) {
1151
+ x = (n>0) ? home.alloc<View>(n) : NULL;
1152
+ }
1153
+ template<class View>
1154
+ forceinline
1155
+ ViewArray<View>::ViewArray(Region& r, int n0)
1156
+ : n(n0) {
1157
+ x = (n>0) ? r.alloc<View>(n) : NULL;
1158
+ }
1159
+
1160
+ template<class View>
1161
+ ViewArray<View>::ViewArray(Space& home, const ViewArray<View>& a)
1162
+ : n(a.size()) {
1163
+ if (n>0) {
1164
+ x = home.alloc<View>(n);
1165
+ for (int i = n; i--; )
1166
+ x[i] = a[i];
1167
+ } else {
1168
+ x = NULL;
1169
+ }
1170
+ }
1171
+ template<class View>
1172
+ ViewArray<View>::ViewArray(Region& r, const ViewArray<View>& a)
1173
+ : n(a.size()) {
1174
+ if (n>0) {
1175
+ x = r.alloc<View>(n);
1176
+ for (int i = n; i--; )
1177
+ x[i] = a[i];
1178
+ } else {
1179
+ x = NULL;
1180
+ }
1181
+ }
1182
+
1183
+ template<class View>
1184
+ forceinline
1185
+ ViewArray<View>::ViewArray(const ViewArray<View>& a)
1186
+ : n(a.n), x(a.x) {}
1187
+
1188
+ template<class View>
1189
+ forceinline const ViewArray<View>&
1190
+ ViewArray<View>::operator =(const ViewArray<View>& a) {
1191
+ n = a.n; x = a.x;
1192
+ return *this;
1193
+ }
1194
+
1195
+ template<class View>
1196
+ forceinline int
1197
+ ViewArray<View>::size(void) const {
1198
+ return n;
1199
+ }
1200
+
1201
+ template<class View>
1202
+ forceinline void
1203
+ ViewArray<View>::size(int n0) {
1204
+ n = n0;
1205
+ }
1206
+
1207
+ template<class View>
1208
+ forceinline View&
1209
+ ViewArray<View>::operator [](int i) {
1210
+ assert((i >= 0) && (i < size()));
1211
+ return x[i];
1212
+ }
1213
+
1214
+ template<class View>
1215
+ forceinline const View&
1216
+ ViewArray<View>::operator [](int i) const {
1217
+ assert((i >= 0) && (i < size()));
1218
+ return x[i];
1219
+ }
1220
+
1221
+ template<class View>
1222
+ forceinline typename ViewArray<View>::iterator
1223
+ ViewArray<View>::begin(void) {
1224
+ return x;
1225
+ }
1226
+
1227
+ template<class View>
1228
+ forceinline typename ViewArray<View>::const_iterator
1229
+ ViewArray<View>::begin(void) const {
1230
+ return x;
1231
+ }
1232
+
1233
+ template<class View>
1234
+ forceinline typename ViewArray<View>::iterator
1235
+ ViewArray<View>::end(void) {
1236
+ return x+n;
1237
+ }
1238
+
1239
+ template<class View>
1240
+ forceinline typename ViewArray<View>::const_iterator
1241
+ ViewArray<View>::end(void) const {
1242
+ return x+n;
1243
+ }
1244
+
1245
+ template<class View>
1246
+ forceinline typename ViewArray<View>::reverse_iterator
1247
+ ViewArray<View>::rbegin(void) {
1248
+ return reverse_iterator(x+n);
1249
+ }
1250
+
1251
+ template<class View>
1252
+ forceinline typename ViewArray<View>::const_reverse_iterator
1253
+ ViewArray<View>::rbegin(void) const {
1254
+ return const_reverse_iterator(x+n);
1255
+ }
1256
+
1257
+ template<class View>
1258
+ forceinline typename ViewArray<View>::reverse_iterator
1259
+ ViewArray<View>::rend(void) {
1260
+ return reverse_iterator(x);
1261
+ }
1262
+
1263
+ template<class View>
1264
+ forceinline typename ViewArray<View>::const_reverse_iterator
1265
+ ViewArray<View>::rend(void) const {
1266
+ return const_reverse_iterator(x);
1267
+ }
1268
+
1269
+ template<class View>
1270
+ forceinline void
1271
+ ViewArray<View>::move_fst(int i) {
1272
+ x[i]=x[0]; x++; n--;
1273
+ }
1274
+
1275
+ template<class View>
1276
+ forceinline void
1277
+ ViewArray<View>::move_lst(int i) {
1278
+ n--; x[i]=x[n];
1279
+ }
1280
+
1281
+ template<class View>
1282
+ forceinline void
1283
+ ViewArray<View>::drop_fst(int i) {
1284
+ assert(i>=0);
1285
+ x += i; n -= i;
1286
+ }
1287
+
1288
+ template<class View>
1289
+ forceinline void
1290
+ ViewArray<View>::drop_lst(int i) {
1291
+ assert(i<n);
1292
+ n = i+1;
1293
+ }
1294
+
1295
+ template<class View>
1296
+ forceinline void
1297
+ ViewArray<View>::move_fst(int i, Space& home, Propagator& p, PropCond pc) {
1298
+ // Move x[0] to x[i]
1299
+ x[i].cancel(home,p,pc);
1300
+ x[i]=x[0]; x++; n--;
1301
+ }
1302
+
1303
+ template<class View>
1304
+ forceinline void
1305
+ ViewArray<View>::move_lst(int i, Space& home, Propagator& p, PropCond pc) {
1306
+ // Move x[n-1] to x[i]
1307
+ x[i].cancel(home,p,pc);
1308
+ n--; x[i]=x[n];
1309
+ }
1310
+
1311
+ template<class View>
1312
+ void
1313
+ ViewArray<View>::drop_fst(int i, Space& home, Propagator& p, PropCond pc) {
1314
+ // Drop elements from 0..i-1
1315
+ assert(i>=0);
1316
+ for (int j=i; j--; )
1317
+ x[j].cancel(home,p,pc);
1318
+ x += i; n -= i;
1319
+ }
1320
+
1321
+ template<class View>
1322
+ void
1323
+ ViewArray<View>::drop_lst(int i, Space& home, Propagator& p, PropCond pc) {
1324
+ // Drop elements from i+1..n-1
1325
+ assert(i<n);
1326
+ for (int j=i+1; j<n; j++)
1327
+ x[j].cancel(home,p,pc);
1328
+ n = i+1;
1329
+ }
1330
+
1331
+ template<class View>
1332
+ forceinline void
1333
+ ViewArray<View>::move_fst(int i, Space& home, Advisor& a) {
1334
+ // Move x[0] to x[i]
1335
+ x[i].cancel(home,a);
1336
+ x[i]=x[0]; x++; n--;
1337
+ }
1338
+
1339
+ template<class View>
1340
+ forceinline void
1341
+ ViewArray<View>::move_lst(int i, Space& home, Advisor& a) {
1342
+ // Move x[n-1] to x[i]
1343
+ x[i].cancel(home,a);
1344
+ n--; x[i]=x[n];
1345
+ }
1346
+
1347
+ template<class View>
1348
+ void
1349
+ ViewArray<View>::drop_fst(int i, Space& home, Advisor& a) {
1350
+ // Drop elements from 0..i-1
1351
+ assert(i>=0);
1352
+ for (int j=i; j--; )
1353
+ x[j].cancel(home,a);
1354
+ x += i; n -= i;
1355
+ }
1356
+
1357
+ template<class View>
1358
+ void
1359
+ ViewArray<View>::drop_lst(int i, Space& home, Advisor& a) {
1360
+ // Drop elements from i+1..n-1
1361
+ assert(i<n);
1362
+ for (int j=i+1; j<n; j++)
1363
+ x[j].cancel(home,a);
1364
+ n = i+1;
1365
+ }
1366
+
1367
+ template<class View>
1368
+ void
1369
+ ViewArray<View>::update(Space& home, bool share, ViewArray<View>& y) {
1370
+ n = y.n;
1371
+ if (n > 0) {
1372
+ x = home.alloc<View>(n);
1373
+ for (int i = n; i--; )
1374
+ x[i].update(home, share, y.x[i]);
1375
+ } else {
1376
+ x = NULL;
1377
+ }
1378
+ }
1379
+
1380
+ template<class View>
1381
+ void
1382
+ ViewArray<View>::subscribe(Space& home, Propagator& p, PropCond pc,
1383
+ bool process) {
1384
+ for (int i = n; i--; )
1385
+ x[i].subscribe(home,p,pc,process);
1386
+ }
1387
+
1388
+ template<class View>
1389
+ void
1390
+ ViewArray<View>::cancel(Space& home, Propagator& p, PropCond pc) {
1391
+ for (int i = n; i--; )
1392
+ x[i].cancel(home,p,pc);
1393
+ }
1394
+
1395
+ template<class View>
1396
+ void
1397
+ ViewArray<View>::subscribe(Space& home, Advisor& a) {
1398
+ for (int i = n; i--; )
1399
+ x[i].subscribe(home,a);
1400
+ }
1401
+
1402
+ template<class View>
1403
+ void
1404
+ ViewArray<View>::cancel(Space& home, Advisor& a) {
1405
+ for (int i = n; i--; )
1406
+ x[i].cancel(home,a);
1407
+ }
1408
+
1409
+ template<class View>
1410
+ forceinline bool
1411
+ ViewArray<View>::assigned(void) const {
1412
+ for (int i = n; i--;)
1413
+ if (!x[i].assigned())
1414
+ return false;
1415
+ return true;
1416
+ }
1417
+
1418
+ template<class View>
1419
+ forceinline bool
1420
+ __before(const View& x, const View& y) {
1421
+ return before(x,y);
1422
+ }
1423
+
1424
+ template<class View> template<class X>
1425
+ forceinline bool
1426
+ ViewArray<View>::ViewLess<X>::operator ()(const X& a, const X& b) {
1427
+ return __before(a,b);
1428
+ }
1429
+
1430
+ template<class View>
1431
+ void
1432
+ ViewArray<View>::sort(View* y, int m) {
1433
+ ViewLess<View> vl;
1434
+ Support::quicksort<View,ViewLess<View> >(y,m,vl);
1435
+ }
1436
+
1437
+ template<class X, class Y>
1438
+ forceinline bool
1439
+ __same(const X& x, const Y& y) {
1440
+ return same(x,y);
1441
+ }
1442
+ template<class X, class Y>
1443
+ forceinline bool
1444
+ __shared(const X& x, const Y& y) {
1445
+ return shared(x,y);
1446
+ }
1447
+
1448
+ template<class View>
1449
+ bool
1450
+ ViewArray<View>::same(const Space& home) const {
1451
+ if (n < 2)
1452
+ return false;
1453
+ Region r(home);
1454
+ View* y = r.alloc<View>(n);
1455
+ for (int i = n; i--; )
1456
+ y[i] = x[i];
1457
+ sort(y,n);
1458
+ for (int i = n-1; i--; )
1459
+ if (!y[i].assigned() && __same(y[i+1],y[i])) {
1460
+ r.free<View>(y,n);
1461
+ return true;
1462
+ }
1463
+ r.free<View>(y,n);
1464
+ return false;
1465
+ }
1466
+
1467
+ template<class View>
1468
+ bool
1469
+ ViewArray<View>::same(const Space&, const View& y) const {
1470
+ if (y.assigned())
1471
+ return false;
1472
+ for (int i = n; i--; )
1473
+ if (__same(x[i],y))
1474
+ return true;
1475
+ return false;
1476
+ }
1477
+
1478
+ template<class View>
1479
+ void
1480
+ ViewArray<View>::unique(const Space&) {
1481
+ if (n < 2)
1482
+ return;
1483
+ sort(x,n);
1484
+ int j = 0;
1485
+ for (int i = 1; i<n; i++)
1486
+ if (!__same(x[j],x[i]))
1487
+ x[++j] = x[i];
1488
+ n = j+1;
1489
+ }
1490
+
1491
+ template<class View>
1492
+ bool
1493
+ ViewArray<View>::shared(const Space& home) const {
1494
+ if (n < 2)
1495
+ return false;
1496
+ Region r(home);
1497
+ View* y = r.alloc<View>(n);
1498
+ for (int i = n; i--; )
1499
+ y[i] = x[i];
1500
+ sort(y,n);
1501
+ for (int i = n-1; i--; )
1502
+ if (!y[i].assigned() && __shared(y[i+1],y[i])) {
1503
+ r.free<View>(y,n);
1504
+ return true;
1505
+ }
1506
+ r.free<View>(y,n);
1507
+ return false;
1508
+ }
1509
+
1510
+ template<class View> template<class ViewY>
1511
+ bool
1512
+ ViewArray<View>::shared(const Space&, const ViewY& y) const {
1513
+ if (y.assigned())
1514
+ return false;
1515
+ for (int i = n; i--; )
1516
+ if (!x[i].assigned() && __shared(x[i],y))
1517
+ return true;
1518
+ return false;
1519
+ }
1520
+
1521
+ template<class View> template<class ViewY>
1522
+ bool
1523
+ ViewArray<View>::shared(const Space& home, const ViewArray<ViewY>& y) const {
1524
+ if ((size() < 1) || (y.size() < 1))
1525
+ return false;
1526
+ Region r(home);
1527
+ View* xs = r.alloc<View>(size());
1528
+ for (int i=size(); i--; )
1529
+ xs[i] = x[i];
1530
+ ViewLess<View> xvl;
1531
+ Support::quicksort<View,ViewLess<View> >(xs,size(),xvl);
1532
+ ViewY* ys = r.alloc<ViewY>(y.size());
1533
+ for (int j=y.size(); j--; )
1534
+ ys[j] = y[j];
1535
+ ViewLess<ViewY> yvl;
1536
+ Support::quicksort<ViewY,ViewLess<ViewY> >(ys,y.size(),yvl);
1537
+ {
1538
+ int i=0, j=0;
1539
+ while ((i < size()) && (j < y.size()))
1540
+ if (!x[i].assigned() && __shared(x[i],y[j])) {
1541
+ r.free<View>(xs,size());
1542
+ r.free<ViewY>(ys,y.size());
1543
+ return true;
1544
+ } else if (before(x[i],y[j])) {
1545
+ i++;
1546
+ } else {
1547
+ j++;
1548
+ }
1549
+ }
1550
+ r.free<View>(xs,size());
1551
+ r.free<ViewY>(ys,y.size());
1552
+ return false;
1553
+ }
1554
+
1555
+ template<class View>
1556
+ void*
1557
+ ViewArray<View>::operator new(size_t) {
1558
+ return NULL;
1559
+ }
1560
+
1561
+ template<class View>
1562
+ void
1563
+ ViewArray<View>::operator delete(void*,size_t) {
1564
+ }
1565
+
1566
+
1567
+ /*
1568
+ * Argument arrays: base class
1569
+ *
1570
+ */
1571
+
1572
+ template<class T>
1573
+ forceinline T*
1574
+ ArgArrayBase<T>::allocate(int n) {
1575
+ return (n > onstack_size) ?
1576
+ heap.alloc<T>(static_cast<unsigned int>(n)) : &onstack[0];
1577
+ }
1578
+
1579
+ template<class T>
1580
+ forceinline void
1581
+ ArgArrayBase<T>::resize(int i) {
1582
+ if (n+i >= capacity) {
1583
+ assert(n+i >= onstack_size);
1584
+ int newCapacity = (3*capacity)/2;
1585
+ if (newCapacity <= n+i)
1586
+ newCapacity = n+i;
1587
+ T* newA = allocate(newCapacity);
1588
+ heap.copy<T>(newA,a,n);
1589
+ if (capacity > onstack_size)
1590
+ heap.free(a,capacity);
1591
+ capacity = newCapacity;
1592
+ a = newA;
1593
+ }
1594
+ }
1595
+
1596
+ template<class T>
1597
+ forceinline
1598
+ ArgArrayBase<T>::ArgArrayBase(void)
1599
+ : n(0), capacity(onstack_size), a(allocate(0)) {}
1600
+
1601
+ template<class T>
1602
+ forceinline
1603
+ ArgArrayBase<T>::ArgArrayBase(int n0)
1604
+ : n(n0), capacity(n < onstack_size ? onstack_size : n), a(allocate(n)) {}
1605
+
1606
+ template<class T>
1607
+ inline
1608
+ ArgArrayBase<T>::ArgArrayBase(const ArgArrayBase<T>& aa)
1609
+ : n(aa.n), capacity(n < onstack_size ? onstack_size : n), a(allocate(n)) {
1610
+ heap.copy<T>(a,aa.a,n);
1611
+ }
1612
+
1613
+ template<class T>
1614
+ forceinline
1615
+ ArgArrayBase<T>::~ArgArrayBase(void) {
1616
+ if (capacity > onstack_size)
1617
+ heap.free(a,capacity);
1618
+ }
1619
+
1620
+ template<class T>
1621
+ forceinline const ArgArrayBase<T>&
1622
+ ArgArrayBase<T>::operator =(const ArgArrayBase<T>& aa) {
1623
+ if (&aa != this) {
1624
+ if (capacity > onstack_size)
1625
+ heap.free(a,capacity);
1626
+ n = aa.n;
1627
+ capacity = (n < onstack_size ? onstack_size : n);
1628
+ a = allocate(aa.n);
1629
+ heap.copy<T>(a,aa.a,n);
1630
+ }
1631
+ return *this;
1632
+ }
1633
+
1634
+ template<class T>
1635
+ forceinline int
1636
+ ArgArrayBase<T>::size(void) const {
1637
+ return n;
1638
+ }
1639
+
1640
+ template<class T>
1641
+ forceinline T&
1642
+ ArgArrayBase<T>::operator [](int i) {
1643
+ assert((i>=0) && (i < n));
1644
+ return a[i];
1645
+ }
1646
+
1647
+ template<class T>
1648
+ forceinline const T&
1649
+ ArgArrayBase<T>::operator [](int i) const {
1650
+ assert((i>=0) && (i < n));
1651
+ return a[i];
1652
+ }
1653
+
1654
+ template<class T>
1655
+ forceinline typename ArgArrayBase<T>::iterator
1656
+ ArgArrayBase<T>::begin(void) {
1657
+ return a;
1658
+ }
1659
+
1660
+ template<class T>
1661
+ forceinline typename ArgArrayBase<T>::const_iterator
1662
+ ArgArrayBase<T>::begin(void) const {
1663
+ return a;
1664
+ }
1665
+
1666
+ template<class T>
1667
+ forceinline typename ArgArrayBase<T>::iterator
1668
+ ArgArrayBase<T>::end(void) {
1669
+ return a+n;
1670
+ }
1671
+
1672
+ template<class T>
1673
+ forceinline typename ArgArrayBase<T>::const_iterator
1674
+ ArgArrayBase<T>::end(void) const {
1675
+ return a+n;
1676
+ }
1677
+
1678
+ template<class T>
1679
+ forceinline typename ArgArrayBase<T>::reverse_iterator
1680
+ ArgArrayBase<T>::rbegin(void) {
1681
+ return reverse_iterator(a+n);
1682
+ }
1683
+
1684
+ template<class T>
1685
+ forceinline typename ArgArrayBase<T>::const_reverse_iterator
1686
+ ArgArrayBase<T>::rbegin(void) const {
1687
+ return const_reverse_iterator(a+n);
1688
+ }
1689
+
1690
+ template<class T>
1691
+ forceinline typename ArgArrayBase<T>::reverse_iterator
1692
+ ArgArrayBase<T>::rend(void) {
1693
+ return reverse_iterator(a);
1694
+ }
1695
+
1696
+ template<class T>
1697
+ forceinline typename ArgArrayBase<T>::const_reverse_iterator
1698
+ ArgArrayBase<T>::rend(void) const {
1699
+ return const_reverse_iterator(a);
1700
+ }
1701
+
1702
+ template<class T> template<class A>
1703
+ A
1704
+ ArgArrayBase<T>::slice(int start, int inc, int maxN) {
1705
+ assert(n==0 || start < n);
1706
+ if (n==0 || maxN<0)
1707
+ maxN = n;
1708
+ int s;
1709
+ if (inc == 0)
1710
+ s = n-start;
1711
+ else if (inc > 0)
1712
+ s = (n-start)/inc + ((n-start) % inc == 0 ? 0 : 1);
1713
+ else
1714
+ s = (start+1)/-inc + ((start+1) % -inc == 0 ? 0 : 1);
1715
+ A r(std::min(maxN,s));
1716
+ for (int i=0; i<r.size(); i++, start+=inc)
1717
+ new (&r[i]) T(a[start]);
1718
+ return r;
1719
+ }
1720
+
1721
+ template<class T> template<class A>
1722
+ inline A&
1723
+ ArgArrayBase<T>::append(const T& x) {
1724
+ resize(1);
1725
+ new (&a[n++]) T(x);
1726
+ return static_cast<A&>(*this);
1727
+ }
1728
+
1729
+ template<class T> template<class A>
1730
+ inline A&
1731
+ ArgArrayBase<T>::append(const ArgArrayBase<T>& x) {
1732
+ resize(x.size());
1733
+ for (int i=0; i<x.size(); i++)
1734
+ new (&a[n++]) T(x[i]);
1735
+ return static_cast<A&>(*this);
1736
+ }
1737
+
1738
+ template<class T> template<class A>
1739
+ inline A
1740
+ ArgArrayBase<T>::concat(const ArgArrayBase<T>& x) const {
1741
+ A r(n+x.n);
1742
+ for (int i=n; i--;)
1743
+ new (&r[i]) T(a[i]);
1744
+ for (int i=x.n; i--;)
1745
+ new (&r[n+i]) T(x.a[i]);
1746
+ return r;
1747
+ }
1748
+
1749
+ template<class T> template<class A>
1750
+ inline A
1751
+ ArgArrayBase<T>::concat(const T& x) const {
1752
+ A r(n+1);
1753
+ for (int i=n; i--;)
1754
+ new (&r[i]) T(a[i]);
1755
+ new (&r[n]) T(x);
1756
+ return r;
1757
+ }
1758
+
1759
+ /*
1760
+ * Argument arrays for primitive types
1761
+ *
1762
+ */
1763
+
1764
+ template<class T>
1765
+ forceinline
1766
+ PrimArgArray<T>::PrimArgArray(void) {}
1767
+
1768
+ template<class T>
1769
+ forceinline
1770
+ PrimArgArray<T>::PrimArgArray(int n) : ArgArrayBase<T>(n) {}
1771
+
1772
+ template<class T>
1773
+ PrimArgArray<T>::PrimArgArray(int n, T a0, ...)
1774
+ : ArgArrayBase<T>(n) {
1775
+ va_list args;
1776
+ va_start(args, a0);
1777
+ a[0] = a0;
1778
+ for (int i = 1; i < n; i++)
1779
+ a[i] = va_arg(args,T);
1780
+ va_end(args);
1781
+ }
1782
+
1783
+ template<class T>
1784
+ PrimArgArray<T>::PrimArgArray(int n, const T* a0)
1785
+ : ArgArrayBase<T>(n) {
1786
+ for (int i=n; i--; )
1787
+ a[i] = a0[i];
1788
+ }
1789
+
1790
+ template<class T>
1791
+ forceinline
1792
+ PrimArgArray<T>::PrimArgArray(const PrimArgArray<T>& aa)
1793
+ : ArgArrayBase<T>(aa) {}
1794
+
1795
+ template<class T>
1796
+ forceinline typename ArrayTraits<PrimArgArray<T> >::ArgsType
1797
+ PrimArgArray<T>::slice(int start, int inc, int maxN) {
1798
+ return ArgArrayBase<T>::template slice
1799
+ <typename ArrayTraits<PrimArgArray<T> >::ArgsType>
1800
+ (start,inc,maxN);
1801
+ }
1802
+
1803
+ template<class T>
1804
+ forceinline typename ArrayTraits<PrimArgArray<T> >::ArgsType&
1805
+ PrimArgArray<T>::operator <<(const T& x) {
1806
+ return
1807
+ ArgArrayBase<T>::template append
1808
+ <typename ArrayTraits<PrimArgArray<T> >::ArgsType>(x);
1809
+ }
1810
+
1811
+ template<class T>
1812
+ forceinline typename ArrayTraits<PrimArgArray<T> >::ArgsType&
1813
+ PrimArgArray<T>::operator <<(const PrimArgArray<T>& x) {
1814
+ return
1815
+ ArgArrayBase<T>::template append
1816
+ <typename ArrayTraits<PrimArgArray<T> >::ArgsType>(x);
1817
+ }
1818
+
1819
+ template<class T>
1820
+ typename ArrayTraits<PrimArgArray<T> >::ArgsType
1821
+ operator +(const PrimArgArray<T>& x, const PrimArgArray<T>& y) {
1822
+ return x.template concat
1823
+ <typename ArrayTraits<PrimArgArray<T> >::ArgsType>(y);
1824
+ }
1825
+
1826
+ template<class T>
1827
+ typename ArrayTraits<PrimArgArray<T> >::ArgsType
1828
+ operator +(const PrimArgArray<T>& x, const T& y) {
1829
+ return x.template concat
1830
+ <typename ArrayTraits<PrimArgArray<T> >::ArgsType>(y);
1831
+ }
1832
+
1833
+ template<class T>
1834
+ typename ArrayTraits<PrimArgArray<T> >::ArgsType
1835
+ operator +(const T& x, const PrimArgArray<T>& y) {
1836
+ return PrimArgArray<T>(1,x).template concat
1837
+ <typename ArrayTraits<PrimArgArray<T> >::ArgsType>(y);
1838
+ }
1839
+
1840
+
1841
+ /*
1842
+ * Argument arrays for non-primitive types
1843
+ *
1844
+ */
1845
+
1846
+ template<class T>
1847
+ forceinline
1848
+ ArgArray<T>::ArgArray(void) {}
1849
+
1850
+ template<class T>
1851
+ forceinline
1852
+ ArgArray<T>::ArgArray(int n) : ArgArrayBase<T>(n) {}
1853
+
1854
+ template<class T>
1855
+ ArgArray<T>::ArgArray(int n, const T* a0)
1856
+ : ArgArrayBase<T>(n) {
1857
+ for (int i=n; i--; )
1858
+ a[i] = a0[i];
1859
+ }
1860
+
1861
+ template<class T>
1862
+ forceinline
1863
+ ArgArray<T>::ArgArray(const ArgArray<T>& aa)
1864
+ : ArgArrayBase<T>(aa) {}
1865
+
1866
+ template<class T>
1867
+ forceinline typename ArrayTraits<ArgArray<T> >::ArgsType
1868
+ ArgArray<T>::slice(int start, int inc, int maxN) {
1869
+ return ArgArrayBase<T>::template slice
1870
+ <typename ArrayTraits<ArgArray<T> >::ArgsType>
1871
+ (start,inc,maxN);
1872
+ }
1873
+
1874
+ template<class T>
1875
+ forceinline typename ArrayTraits<ArgArray<T> >::ArgsType&
1876
+ ArgArray<T>::operator <<(const T& x) {
1877
+ return
1878
+ ArgArrayBase<T>::template append
1879
+ <typename ArrayTraits<ArgArray<T> >::ArgsType>(x);
1880
+ }
1881
+
1882
+ template<class T>
1883
+ forceinline typename ArrayTraits<ArgArray<T> >::ArgsType&
1884
+ ArgArray<T>::operator <<(const ArgArray<T>& x) {
1885
+ return
1886
+ ArgArrayBase<T>::template append
1887
+ <typename ArrayTraits<ArgArray<T> >::ArgsType>(x);
1888
+ }
1889
+
1890
+ template<class T>
1891
+ typename ArrayTraits<ArgArray<T> >::ArgsType
1892
+ operator +(const ArgArray<T>& x, const ArgArray<T>& y) {
1893
+ return x.template concat
1894
+ <typename ArrayTraits<ArgArray<T> >::ArgsType>(y);
1895
+ }
1896
+
1897
+ template<class T>
1898
+ typename ArrayTraits<ArgArray<T> >::ArgsType
1899
+ operator +(const ArgArray<T>& x, const T& y) {
1900
+ return x.template concat
1901
+ <typename ArrayTraits<ArgArray<T> >::ArgsType>(y);
1902
+ }
1903
+
1904
+ template<class T>
1905
+ typename ArrayTraits<ArgArray<T> >::ArgsType
1906
+ operator +(const T& x, const ArgArray<T>& y) {
1907
+ ArgArray<T> xa(1);
1908
+ xa[0] = x;
1909
+ return xa.template concat
1910
+ <typename ArrayTraits<ArgArray<T> >::ArgsType>(y);
1911
+ }
1912
+
1913
+ /*
1914
+ * Argument arrays for variables
1915
+ *
1916
+ */
1917
+
1918
+ template<class Var>
1919
+ forceinline
1920
+ VarArgArray<Var>::VarArgArray(void) {}
1921
+
1922
+ template<class Var>
1923
+ forceinline
1924
+ VarArgArray<Var>::VarArgArray(int n) : ArgArrayBase<Var>(n) {}
1925
+
1926
+ template<class Var>
1927
+ forceinline
1928
+ VarArgArray<Var>::VarArgArray(const VarArgArray<Var>& aa)
1929
+ : ArgArrayBase<Var>(aa) {}
1930
+
1931
+ template<class Var>
1932
+ inline
1933
+ VarArgArray<Var>::VarArgArray(const VarArray<Var>& x)
1934
+ : ArgArrayBase<Var>(x.size()) {
1935
+ for (int i=x.size(); i--; )
1936
+ a[i]=x[i];
1937
+ }
1938
+
1939
+ template<class Var>
1940
+ forceinline typename ArrayTraits<VarArgArray<Var> >::ArgsType
1941
+ VarArgArray<Var>::slice(int start, int inc, int maxN) {
1942
+ return ArgArrayBase<Var>::template slice
1943
+ <typename ArrayTraits<VarArgArray<Var> >::ArgsType>
1944
+ (start,inc,maxN);
1945
+ }
1946
+
1947
+ template<class Var>
1948
+ forceinline typename ArrayTraits<VarArgArray<Var> >::ArgsType&
1949
+ VarArgArray<Var>::operator <<(const Var& x) {
1950
+ return
1951
+ ArgArrayBase<Var>::template append
1952
+ <typename ArrayTraits<VarArgArray<Var> >::ArgsType>(x);
1953
+ }
1954
+
1955
+ template<class Var>
1956
+ forceinline typename ArrayTraits<VarArgArray<Var> >::ArgsType&
1957
+ VarArgArray<Var>::operator <<(const VarArgArray<Var>& x) {
1958
+ return
1959
+ ArgArrayBase<Var>::template append
1960
+ <typename ArrayTraits<VarArgArray<Var> >::ArgsType>(x);
1961
+ }
1962
+
1963
+ template<class Var>
1964
+ typename ArrayTraits<VarArgArray<Var> >::ArgsType
1965
+ operator +(const VarArgArray<Var>& x, const VarArgArray<Var>& y) {
1966
+ return x.template concat
1967
+ <typename ArrayTraits<VarArgArray<Var> >::ArgsType>(y);
1968
+ }
1969
+
1970
+ template<class Var>
1971
+ typename ArrayTraits<VarArgArray<Var> >::ArgsType
1972
+ operator +(const VarArgArray<Var>& x, const Var& y) {
1973
+ return x.template concat
1974
+ <typename ArrayTraits<VarArgArray<Var> >::ArgsType>(y);
1975
+ }
1976
+
1977
+ template<class Var>
1978
+ typename ArrayTraits<VarArgArray<Var> >::ArgsType
1979
+ operator +(const Var& x, const VarArgArray<Var>& y) {
1980
+ VarArgArray<Var> xa(1);
1981
+ xa[0] = x;
1982
+ return xa.template concat
1983
+ <typename ArrayTraits<VarArgArray<Var> >::ArgsType>(y);
1984
+ }
1985
+
1986
+ template<class Var>
1987
+ forceinline bool
1988
+ VarArgArray<Var>::VarLess::operator ()(const Var& a, const Var& b) {
1989
+ return a.varimp() < b.varimp();
1990
+ }
1991
+
1992
+ template<class Var>
1993
+ forceinline bool
1994
+ VarArgArray<Var>::assigned(void) const {
1995
+ for (int i = n; i--;)
1996
+ if (!a[i].assigned())
1997
+ return false;
1998
+ return true;
1999
+ }
2000
+
2001
+ template<class Var>
2002
+ bool
2003
+ VarArgArray<Var>::same(const Space& home) const {
2004
+ if (n < 2)
2005
+ return false;
2006
+ Region r(home);
2007
+ Var* y = r.alloc<Var>(n);
2008
+ for (int i = n; i--; )
2009
+ y[i] = a[i];
2010
+ VarLess vl;
2011
+ Support::quicksort<Var,VarLess>(y,n,vl);
2012
+ for (int i = n-1; i--; )
2013
+ if (!y[i].assigned() && (y[i+1].varimp() == y[i].varimp())) {
2014
+ r.free<Var>(y,n);
2015
+ return true;
2016
+ }
2017
+ r.free<Var>(y,n);
2018
+ return false;
2019
+ }
2020
+
2021
+ template<class Var>
2022
+ bool
2023
+ VarArgArray<Var>::same(const Space& home, const VarArgArray<Var>& y) const {
2024
+ int m = n + y.n;
2025
+ if (m < 2)
2026
+ return false;
2027
+ Region r(home);
2028
+ Var* z = r.alloc<Var>(m);
2029
+ for (int i = n; i--; )
2030
+ z[i] = a[i];
2031
+ for (int i = y.n; i--; )
2032
+ z[i+n] = y.a[i];
2033
+ VarLess vl;
2034
+ Support::quicksort<Var,VarLess>(z,m,vl);
2035
+ for (int i = m-1; i--; )
2036
+ if (!z[i].assigned() && (z[i+1].varimp() == z[i].varimp())) {
2037
+ r.free<Var>(z,m);
2038
+ return true;
2039
+ }
2040
+ r.free<Var>(z,m);
2041
+ return false;
2042
+ }
2043
+
2044
+ template<class Var>
2045
+ bool
2046
+ VarArgArray<Var>::same(const Space&, const Var& y) const {
2047
+ if (y.assigned())
2048
+ return false;
2049
+ for (int i = n; i--; )
2050
+ if (a[i].varimp() == y.varimp())
2051
+ return true;
2052
+ return false;
2053
+ }
2054
+
2055
+
2056
+
2057
+
2058
+
2059
+
2060
+ /*
2061
+ * Interdependent code
2062
+ *
2063
+ */
2064
+
2065
+ template<class Var>
2066
+ inline
2067
+ VarArray<Var>::VarArray(Space& home, const VarArgArray<Var>& a)
2068
+ : n(a.size()) {
2069
+ if (n>0) {
2070
+ x = home.alloc<Var>(n);
2071
+ for (int i=n; i--;)
2072
+ x[i] = a[i];
2073
+ } else {
2074
+ x = NULL;
2075
+ }
2076
+ }
2077
+
2078
+
2079
+ /*
2080
+ * Printing of arrays
2081
+ *
2082
+ */
2083
+ template<class Char, class Traits, class Var>
2084
+ std::basic_ostream<Char,Traits>&
2085
+ operator <<(std::basic_ostream<Char,Traits>& os,
2086
+ const VarArray<Var>& x) {
2087
+ std::basic_ostringstream<Char,Traits> s;
2088
+ s.copyfmt(os); s.width(0);
2089
+ s << '{';
2090
+ if (x.size() > 0) {
2091
+ s << x[0];
2092
+ for (int i=1; i<x.size(); i++)
2093
+ s << ", " << x[i];
2094
+ }
2095
+ s << '}';
2096
+ return os << s.str();
2097
+ }
2098
+
2099
+ template<class Char, class Traits, class View>
2100
+ std::basic_ostream<Char,Traits>&
2101
+ operator <<(std::basic_ostream<Char,Traits>& os,
2102
+ const ViewArray<View>& x) {
2103
+ std::basic_ostringstream<Char,Traits> s;
2104
+ s.copyfmt(os); s.width(0);
2105
+ s << '{';
2106
+ if (x.size() > 0) {
2107
+ s << x[0];
2108
+ for (int i=1; i<x.size(); i++)
2109
+ s << ", " << x[i];
2110
+ }
2111
+ s << '}';
2112
+ return os << s.str();
2113
+ }
2114
+
2115
+ template<class Char, class Traits, class T>
2116
+ std::basic_ostream<Char,Traits>&
2117
+ operator <<(std::basic_ostream<Char,Traits>& os,
2118
+ const ArgArrayBase<T>& x) {
2119
+ std::basic_ostringstream<Char,Traits> s;
2120
+ s.copyfmt(os); s.width(0);
2121
+ s << '{';
2122
+ if (x.size() > 0) {
2123
+ s << x[0];
2124
+ for (int i=1; i<x.size(); i++)
2125
+ s << ", " << x[i];
2126
+ }
2127
+ s << '}';
2128
+ return os << s.str();
2129
+ }
2130
+
2131
+ }
2132
+
2133
+ // STATISTICS: kernel-other