pygambit 16.2.2__tar.gz → 16.3.1__tar.gz

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 (304) hide show
  1. {pygambit-16.2.2/src/pygambit.egg-info → pygambit-16.3.1}/PKG-INFO +3 -5
  2. {pygambit-16.2.2 → pygambit-16.3.1}/pyproject.toml +1 -1
  3. {pygambit-16.2.2 → pygambit-16.3.1}/setup.py +62 -24
  4. pygambit-16.3.1/src/core/array.h +285 -0
  5. {pygambit-16.2.2 → pygambit-16.3.1}/src/core/function.cc +3 -3
  6. pygambit-16.3.1/src/core/list.h +132 -0
  7. {pygambit-16.2.2 → pygambit-16.3.1}/src/core/matrix.imp +2 -2
  8. {pygambit-16.2.2 → pygambit-16.3.1}/src/core/rational.cc +2 -2
  9. {pygambit-16.2.2 → pygambit-16.3.1}/src/core/rational.h +3 -0
  10. {pygambit-16.2.2 → pygambit-16.3.1}/src/core/recarray.h +2 -2
  11. pygambit-16.3.1/src/core/vector.h +167 -0
  12. {pygambit-16.2.2 → pygambit-16.3.1}/src/gambit.h +6 -0
  13. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/behavmixed.cc +68 -26
  14. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/behavmixed.h +16 -11
  15. pygambit-16.3.1/src/games/behavpure.cc +175 -0
  16. pygambit-16.3.1/src/games/behavpure.h +141 -0
  17. pygambit-16.3.1/src/games/behavspt.cc +262 -0
  18. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/behavspt.h +43 -37
  19. pygambit-16.3.1/src/games/file.cc +804 -0
  20. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/game.cc +43 -57
  21. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/game.h +36 -14
  22. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/gameagg.cc +9 -18
  23. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/gameagg.h +18 -10
  24. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/gamebagg.cc +5 -15
  25. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/gamebagg.h +17 -9
  26. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/gameexpl.cc +3 -3
  27. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/gameobject.h +1 -1
  28. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/gametable.cc +49 -99
  29. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/gametable.h +0 -4
  30. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/gametree.cc +110 -231
  31. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/gametree.h +1 -11
  32. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/nash.cc +106 -121
  33. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/nash.h +4 -2
  34. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/stratmixed.h +4 -5
  35. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/stratpure.cc +32 -77
  36. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/stratpure.h +34 -41
  37. pygambit-16.3.1/src/games/stratspt.cc +301 -0
  38. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/stratspt.h +27 -78
  39. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/writer.cc +42 -38
  40. pygambit-16.3.1/src/games/writer.h +95 -0
  41. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/__init__.py +1 -2
  42. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/gambit.cpp +63929 -53684
  43. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/gambit.pxd +88 -26
  44. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/game.pxi +311 -9
  45. pygambit-16.3.1/src/pygambit/nash.h +107 -0
  46. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/nash.pxi +147 -28
  47. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/nash.py +159 -23
  48. pygambit-16.3.1/src/pygambit/nashlrs.py +60 -0
  49. pygambit-16.3.1/src/pygambit/nashphc.py +256 -0
  50. pygambit-16.3.1/src/pygambit/qre.py +329 -0
  51. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/stratspt.pxi +74 -30
  52. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/supports.py +8 -3
  53. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/util.h +60 -2
  54. pygambit-16.3.1/src/pygambit/util.py +24 -0
  55. {pygambit-16.2.2 → pygambit-16.3.1/src/pygambit.egg-info}/PKG-INFO +3 -5
  56. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit.egg-info/SOURCES.txt +21 -73
  57. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit.egg-info/requires.txt +0 -1
  58. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/enummixed/clique.cc +1 -1
  59. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/enummixed/enummixed.cc +15 -15
  60. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/enummixed/enummixed.h +0 -21
  61. pygambit-16.3.1/src/solvers/enumpoly/behavextend.cc +460 -0
  62. pygambit-16.3.1/src/solvers/enumpoly/behavextend.h +53 -0
  63. pygambit-16.3.1/src/solvers/enumpoly/efgpoly.cc +231 -0
  64. pygambit-16.3.1/src/solvers/enumpoly/enumpoly.h +72 -0
  65. pygambit-16.3.1/src/solvers/enumpoly/gameseq.cc +132 -0
  66. pygambit-16.3.1/src/solvers/enumpoly/gameseq.h +301 -0
  67. pygambit-16.3.1/src/solvers/enumpoly/indexproduct.h +89 -0
  68. pygambit-16.3.1/src/solvers/enumpoly/ndarray.h +92 -0
  69. pygambit-16.3.1/src/solvers/enumpoly/nfgpoly.cc +177 -0
  70. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/enumpoly/poly.cc +9 -3
  71. pygambit-16.3.1/src/solvers/enumpoly/poly.h +339 -0
  72. pygambit-16.3.1/src/solvers/enumpoly/poly.imp +293 -0
  73. pygambit-16.3.1/src/solvers/enumpoly/polyfeasible.h +107 -0
  74. pygambit-16.3.1/src/solvers/enumpoly/polypartial.h +107 -0
  75. pygambit-16.3.1/src/solvers/enumpoly/polypartial.imp +199 -0
  76. pygambit-16.3.1/src/solvers/enumpoly/polysolver.cc +226 -0
  77. pygambit-16.3.1/src/solvers/enumpoly/polysolver.h +103 -0
  78. pygambit-16.3.1/src/solvers/enumpoly/polysystem.h +113 -0
  79. pygambit-16.3.1/src/solvers/enumpoly/rectangle.h +188 -0
  80. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/enumpure/enumpure.h +6 -6
  81. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/gtracer/gtracer.cc +4 -5
  82. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/lcp/efglcp.cc +1 -1
  83. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/lcp/nfglcp.cc +1 -1
  84. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/liap/efgliap.cc +9 -2
  85. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/basis.cc +15 -9
  86. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/btableau.imp +5 -5
  87. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/lemketab.imp +17 -17
  88. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/lhtab.imp +4 -4
  89. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/lpsolve.imp +19 -99
  90. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/lptab.cc +2 -6
  91. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/lptab.h +13 -28
  92. pygambit-16.3.1/src/solvers/linalg/lptab.imp +418 -0
  93. pygambit-16.2.2/src/solvers/enumpoly/gsolver.cc → pygambit-16.3.1/src/solvers/linalg/ludecomp.cc +8 -5
  94. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/ludecomp.h +26 -55
  95. pygambit-16.3.1/src/solvers/linalg/ludecomp.imp +352 -0
  96. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/tableau.cc +27 -27
  97. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/tableau.h +1 -1
  98. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/vertenum.h +11 -17
  99. pygambit-16.3.1/src/solvers/linalg/vertenum.imp +115 -0
  100. pygambit-16.3.1/src/solvers/logit/efglogit.cc +425 -0
  101. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/logit/logbehav.h +25 -53
  102. pygambit-16.3.1/src/solvers/logit/logbehav.imp +275 -0
  103. pygambit-16.3.1/src/solvers/logit/logit.h +128 -0
  104. pygambit-16.3.1/src/solvers/logit/nfglogit.cc +337 -0
  105. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/logit/path.cc +17 -35
  106. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/logit/path.h +26 -59
  107. pygambit-16.3.1/src/solvers/nashsupport/efgsupport.cc +91 -0
  108. pygambit-16.2.2/src/solvers/enumpoly/nfgensup.h → pygambit-16.3.1/src/solvers/nashsupport/nashsupport.h +22 -11
  109. pygambit-16.3.1/src/solvers/nashsupport/nfgsupport.cc +265 -0
  110. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/simpdiv/simpdiv.cc +61 -25
  111. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/simpdiv/simpdiv.h +12 -12
  112. pygambit-16.3.1/tests/test_file.py +135 -0
  113. {pygambit-16.2.2 → pygambit-16.3.1}/tests/test_game.py +69 -8
  114. pygambit-16.3.1/tests/test_game_resolve.py +171 -0
  115. pygambit-16.3.1/tests/test_io.py +91 -0
  116. pygambit-16.3.1/tests/test_nash.py +226 -0
  117. pygambit-16.3.1/tests/test_node.py +406 -0
  118. pygambit-16.3.1/tests/test_stratprofiles.py +80 -0
  119. pygambit-16.2.2/src/core/array.h +0 -333
  120. pygambit-16.2.2/src/core/dvector.cc +0 -27
  121. pygambit-16.2.2/src/core/dvector.h +0 -69
  122. pygambit-16.2.2/src/core/dvector.imp +0 -115
  123. pygambit-16.2.2/src/core/list.h +0 -444
  124. pygambit-16.2.2/src/core/pvector.cc +0 -28
  125. pygambit-16.2.2/src/core/pvector.h +0 -85
  126. pygambit-16.2.2/src/core/pvector.imp +0 -297
  127. pygambit-16.2.2/src/core/vector.cc +0 -30
  128. pygambit-16.2.2/src/core/vector.h +0 -78
  129. pygambit-16.2.2/src/core/vector.imp +0 -199
  130. pygambit-16.2.2/src/games/behavpure.cc +0 -226
  131. pygambit-16.2.2/src/games/behavpure.h +0 -130
  132. pygambit-16.2.2/src/games/behavspt.cc +0 -579
  133. pygambit-16.2.2/src/games/file.cc +0 -1064
  134. pygambit-16.2.2/src/games/stratspt.cc +0 -432
  135. pygambit-16.2.2/src/games/writer.h +0 -77
  136. pygambit-16.2.2/src/pygambit/gte.py +0 -130
  137. pygambit-16.2.2/src/pygambit/nash.h +0 -72
  138. pygambit-16.2.2/src/pygambit/pctrace.py +0 -469
  139. pygambit-16.2.2/src/pygambit/qre.py +0 -431
  140. pygambit-16.2.2/src/solvers/enummixed/lrsenum.cc +0 -947
  141. pygambit-16.2.2/src/solvers/enumpoly/behavextend.cc +0 -565
  142. pygambit-16.2.2/src/solvers/enumpoly/behavextend.h +0 -42
  143. pygambit-16.2.2/src/solvers/enumpoly/efgensup.cc +0 -678
  144. pygambit-16.2.2/src/solvers/enumpoly/efgensup.h +0 -130
  145. pygambit-16.2.2/src/solvers/enumpoly/efgpoly.cc +0 -401
  146. pygambit-16.2.2/src/solvers/enumpoly/gcomplex.cc +0 -83
  147. pygambit-16.2.2/src/solvers/enumpoly/gcomplex.h +0 -85
  148. pygambit-16.2.2/src/solvers/enumpoly/gnarray.h +0 -59
  149. pygambit-16.2.2/src/solvers/enumpoly/gnarray.imp +0 -150
  150. pygambit-16.2.2/src/solvers/enumpoly/gpartltr.cc +0 -50
  151. pygambit-16.2.2/src/solvers/enumpoly/gpartltr.h +0 -118
  152. pygambit-16.2.2/src/solvers/enumpoly/gpartltr.imp +0 -505
  153. pygambit-16.2.2/src/solvers/enumpoly/gpoly.cc +0 -50
  154. pygambit-16.2.2/src/solvers/enumpoly/gpoly.h +0 -205
  155. pygambit-16.2.2/src/solvers/enumpoly/gpoly.imp +0 -1075
  156. pygambit-16.2.2/src/solvers/enumpoly/gpolylst.cc +0 -37
  157. pygambit-16.2.2/src/solvers/enumpoly/gpolylst.h +0 -131
  158. pygambit-16.2.2/src/solvers/enumpoly/gpolylst.imp +0 -611
  159. pygambit-16.2.2/src/solvers/enumpoly/gsolver.h +0 -54
  160. pygambit-16.2.2/src/solvers/enumpoly/gsolver.imp +0 -212
  161. pygambit-16.2.2/src/solvers/enumpoly/gtree.h +0 -90
  162. pygambit-16.2.2/src/solvers/enumpoly/gtree.imp +0 -185
  163. pygambit-16.2.2/src/solvers/enumpoly/ideal.cc +0 -37
  164. pygambit-16.2.2/src/solvers/enumpoly/ideal.h +0 -86
  165. pygambit-16.2.2/src/solvers/enumpoly/ideal.imp +0 -240
  166. pygambit-16.2.2/src/solvers/enumpoly/ineqsolv.cc +0 -26
  167. pygambit-16.2.2/src/solvers/enumpoly/ineqsolv.h +0 -93
  168. pygambit-16.2.2/src/solvers/enumpoly/ineqsolv.imp +0 -177
  169. pygambit-16.2.2/src/solvers/enumpoly/interval.h +0 -89
  170. pygambit-16.2.2/src/solvers/enumpoly/linrcomb.cc +0 -28
  171. pygambit-16.2.2/src/solvers/enumpoly/linrcomb.h +0 -68
  172. pygambit-16.2.2/src/solvers/enumpoly/linrcomb.imp +0 -200
  173. pygambit-16.2.2/src/solvers/enumpoly/monomial.cc +0 -27
  174. pygambit-16.2.2/src/solvers/enumpoly/monomial.h +0 -66
  175. pygambit-16.2.2/src/solvers/enumpoly/monomial.imp +0 -134
  176. pygambit-16.2.2/src/solvers/enumpoly/nfgcpoly.cc +0 -359
  177. pygambit-16.2.2/src/solvers/enumpoly/nfgcpoly.h +0 -85
  178. pygambit-16.2.2/src/solvers/enumpoly/nfgensup.cc +0 -187
  179. pygambit-16.2.2/src/solvers/enumpoly/nfghs.cc +0 -698
  180. pygambit-16.2.2/src/solvers/enumpoly/nfghs.h +0 -120
  181. pygambit-16.2.2/src/solvers/enumpoly/nfgpoly.cc +0 -504
  182. pygambit-16.2.2/src/solvers/enumpoly/odometer.cc +0 -224
  183. pygambit-16.2.2/src/solvers/enumpoly/odometer.h +0 -112
  184. pygambit-16.2.2/src/solvers/enumpoly/poly.h +0 -150
  185. pygambit-16.2.2/src/solvers/enumpoly/poly.imp +0 -883
  186. pygambit-16.2.2/src/solvers/enumpoly/prepoly.cc +0 -679
  187. pygambit-16.2.2/src/solvers/enumpoly/prepoly.h +0 -199
  188. pygambit-16.2.2/src/solvers/enumpoly/quiksolv.cc +0 -25
  189. pygambit-16.2.2/src/solvers/enumpoly/quiksolv.h +0 -162
  190. pygambit-16.2.2/src/solvers/enumpoly/quiksolv.imp +0 -665
  191. pygambit-16.2.2/src/solvers/enumpoly/rectangl.cc +0 -26
  192. pygambit-16.2.2/src/solvers/enumpoly/rectangl.h +0 -84
  193. pygambit-16.2.2/src/solvers/enumpoly/rectangl.imp +0 -307
  194. pygambit-16.2.2/src/solvers/enumpoly/sfg.cc +0 -291
  195. pygambit-16.2.2/src/solvers/enumpoly/sfg.h +0 -74
  196. pygambit-16.2.2/src/solvers/enumpoly/sfstrat.cc +0 -249
  197. pygambit-16.2.2/src/solvers/enumpoly/sfstrat.h +0 -150
  198. pygambit-16.2.2/src/solvers/linalg/lptab.imp +0 -757
  199. pygambit-16.2.2/src/solvers/linalg/ludecomp.cc +0 -37
  200. pygambit-16.2.2/src/solvers/linalg/ludecomp.imp +0 -465
  201. pygambit-16.2.2/src/solvers/linalg/vertenum.imp +0 -181
  202. pygambit-16.2.2/src/solvers/logit/efglogit.cc +0 -375
  203. pygambit-16.2.2/src/solvers/logit/efglogit.h +0 -96
  204. pygambit-16.2.2/src/solvers/logit/logbehav.imp +0 -411
  205. pygambit-16.2.2/src/solvers/logit/nfglogit.cc +0 -429
  206. pygambit-16.2.2/src/solvers/logit/nfglogit.h +0 -125
  207. pygambit-16.2.2/src/solvers/lrs/lrslib.c +0 -5620
  208. pygambit-16.2.2/src/solvers/lrs/lrslib.h +0 -354
  209. pygambit-16.2.2/src/solvers/lrs/lrsmp.c +0 -1078
  210. pygambit-16.2.2/src/solvers/lrs/lrsmp.h +0 -232
  211. pygambit-16.2.2/src/solvers/lrs/lrsnashlib.c +0 -1195
  212. pygambit-16.2.2/src/solvers/lrs/lrsnashlib.h +0 -68
  213. pygambit-16.2.2/tests/test_file.py +0 -115
  214. pygambit-16.2.2/tests/test_game_resolve_functions.py +0 -109
  215. pygambit-16.2.2/tests/test_nash.py +0 -145
  216. pygambit-16.2.2/tests/test_node.py +0 -432
  217. pygambit-16.2.2/tests/test_stratprofiles.py +0 -81
  218. {pygambit-16.2.2 → pygambit-16.3.1}/AUTHORS +0 -0
  219. {pygambit-16.2.2 → pygambit-16.3.1}/COPYING +0 -0
  220. {pygambit-16.2.2 → pygambit-16.3.1}/MANIFEST.in +0 -0
  221. {pygambit-16.2.2 → pygambit-16.3.1}/README.md +0 -0
  222. {pygambit-16.2.2 → pygambit-16.3.1}/setup.cfg +0 -0
  223. {pygambit-16.2.2 → pygambit-16.3.1}/src/README.rst +0 -0
  224. {pygambit-16.2.2 → pygambit-16.3.1}/src/core/function.h +0 -0
  225. {pygambit-16.2.2 → pygambit-16.3.1}/src/core/integer.cc +0 -0
  226. {pygambit-16.2.2 → pygambit-16.3.1}/src/core/integer.h +0 -0
  227. {pygambit-16.2.2 → pygambit-16.3.1}/src/core/matrix.cc +0 -0
  228. {pygambit-16.2.2 → pygambit-16.3.1}/src/core/matrix.h +0 -0
  229. {pygambit-16.2.2 → pygambit-16.3.1}/src/core/sqmatrix.cc +0 -0
  230. {pygambit-16.2.2 → pygambit-16.3.1}/src/core/sqmatrix.h +0 -0
  231. {pygambit-16.2.2 → pygambit-16.3.1}/src/core/sqmatrix.imp +0 -0
  232. {pygambit-16.2.2 → pygambit-16.3.1}/src/core/tinyxml.cc +0 -0
  233. {pygambit-16.2.2 → pygambit-16.3.1}/src/core/tinyxml.h +0 -0
  234. {pygambit-16.2.2 → pygambit-16.3.1}/src/core/tinyxmlerror.cc +0 -0
  235. {pygambit-16.2.2 → pygambit-16.3.1}/src/core/tinyxmlparser.cc +0 -0
  236. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/agg/agg.cc +0 -0
  237. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/agg/agg.h +0 -0
  238. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/agg/bagg.cc +0 -0
  239. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/agg/bagg.h +0 -0
  240. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/agg/gray.h +0 -0
  241. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/agg/proj_func.h +0 -0
  242. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/agg/trie_map.cc +0 -0
  243. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/agg/trie_map.h +0 -0
  244. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/agg/trie_map.imp +0 -0
  245. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/gameexpl.h +0 -0
  246. {pygambit-16.2.2 → pygambit-16.3.1}/src/games/number.h +0 -0
  247. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/action.pxi +0 -0
  248. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/behavmixed.pxi +0 -0
  249. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/enumeration.py +0 -0
  250. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/error.py +0 -0
  251. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/gambit.pyx +0 -0
  252. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/gameiter.py +0 -0
  253. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/infoset.pxi +0 -0
  254. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/levelk.py +0 -0
  255. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/node.pxi +0 -0
  256. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/outcome.pxi +0 -0
  257. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/player.pxi +0 -0
  258. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/profiles.py +0 -0
  259. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/strategy.pxi +0 -0
  260. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit/stratmixed.pxi +0 -0
  261. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit.egg-info/dependency_links.txt +0 -0
  262. {pygambit-16.2.2 → pygambit-16.3.1}/src/pygambit.egg-info/top_level.txt +0 -0
  263. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/enummixed/clique.h +0 -0
  264. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/gnm/gnm.cc +0 -0
  265. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/gnm/gnm.h +0 -0
  266. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/gtracer/aggame.cc +0 -0
  267. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/gtracer/aggame.h +0 -0
  268. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/gtracer/cmatrix.cc +0 -0
  269. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/gtracer/cmatrix.h +0 -0
  270. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/gtracer/gnm.cc +0 -0
  271. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/gtracer/gnmgame.cc +0 -0
  272. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/gtracer/gnmgame.h +0 -0
  273. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/gtracer/gtracer.h +0 -0
  274. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/gtracer/ipa.cc +0 -0
  275. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/gtracer/nfgame.cc +0 -0
  276. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/gtracer/nfgame.h +0 -0
  277. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/ipa/ipa.cc +0 -0
  278. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/ipa/ipa.h +0 -0
  279. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/lcp/lcp.h +0 -0
  280. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/liap/liap.h +0 -0
  281. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/liap/nfgliap.cc +0 -0
  282. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/basis.h +0 -0
  283. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/bfs.h +0 -0
  284. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/btableau.cc +0 -0
  285. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/btableau.h +0 -0
  286. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/lemketab.cc +0 -0
  287. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/lemketab.h +0 -0
  288. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/lhtab.cc +0 -0
  289. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/lhtab.h +0 -0
  290. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/lpsolve.cc +0 -0
  291. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/linalg/lpsolve.h +0 -0
  292. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/lp/efglp.cc +0 -0
  293. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/lp/efglp.h +0 -0
  294. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/lp/nfglp.cc +0 -0
  295. {pygambit-16.2.2 → pygambit-16.3.1}/src/solvers/lp/nfglp.h +0 -0
  296. {pygambit-16.2.2 → pygambit-16.3.1}/tests/test_actions.py +0 -0
  297. {pygambit-16.2.2 → pygambit-16.3.1}/tests/test_behav.py +0 -0
  298. {pygambit-16.2.2 → pygambit-16.3.1}/tests/test_extensive.py +0 -0
  299. {pygambit-16.2.2 → pygambit-16.3.1}/tests/test_infosets.py +0 -0
  300. {pygambit-16.2.2 → pygambit-16.3.1}/tests/test_mixed.py +0 -0
  301. {pygambit-16.2.2 → pygambit-16.3.1}/tests/test_outcomes.py +0 -0
  302. {pygambit-16.2.2 → pygambit-16.3.1}/tests/test_players.py +0 -0
  303. {pygambit-16.2.2 → pygambit-16.3.1}/tests/test_strategic.py +0 -0
  304. {pygambit-16.2.2 → pygambit-16.3.1}/tests/test_userguide.py +0 -0
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pygambit
3
- Version: 16.2.2
3
+ Version: 16.3.1
4
4
  Summary: The package for computation in game theory
5
- Home-page: http://www.gambit-project.org
5
+ Home-page: https://www.gambit-project.org
6
6
  Author: Theodore Turocy
7
7
  Author-email: ted.turocy@gmail.com
8
8
  License: GPL2+
@@ -13,17 +13,15 @@ Keywords: game theory Nash equilibrium
13
13
  Classifier: Development Status :: 5 - Production/Stable
14
14
  Classifier: Intended Audience :: Science/Research
15
15
  Classifier: License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)
16
- Classifier: Programming Language :: Python :: 3.8
17
16
  Classifier: Programming Language :: Python :: 3.9
18
17
  Classifier: Programming Language :: Python :: 3.10
19
18
  Classifier: Programming Language :: Python :: 3.11
20
19
  Classifier: Programming Language :: Python :: 3.12
21
20
  Classifier: Programming Language :: Python :: Implementation :: CPython
22
21
  Classifier: Topic :: Scientific/Engineering :: Mathematics
23
- Requires-Python: >=3.8
22
+ Requires-Python: >=3.9
24
23
  License-File: COPYING
25
24
  License-File: AUTHORS
26
- Requires-Dist: lxml
27
25
  Requires-Dist: numpy
28
26
  Requires-Dist: scipy
29
27
  Requires-Dist: deprecated
@@ -4,7 +4,7 @@ requires = ["setuptools", "wheel", "Cython"]
4
4
  [tool.ruff]
5
5
  line-length = 99
6
6
  indent-width = 4
7
- target-version = "py38"
7
+ target-version = "py39"
8
8
  include = ["setup.py", "src/pygambit/**/*.py", "tests/**/*.py"]
9
9
  exclude = ["contrib/**.py"]
10
10
 
@@ -1,6 +1,6 @@
1
1
  #
2
2
  # This file is part of Gambit
3
- # Copyright (c) 1994-2025, The Gambit Project (http://www.gambit-project.org)
3
+ # Copyright (c) 1994-2025, The Gambit Project (https://www.gambit-project.org)
4
4
  #
5
5
  # FILE: src/python/setup.py
6
6
  # Setuptools configuration file for Gambit Python extension
@@ -26,29 +26,67 @@ import platform
26
26
  import Cython.Build
27
27
  import setuptools
28
28
 
29
- # By compiling this separately as a C library, we avoid problems
30
- # with passing C++-specific flags when building the extension
31
- lrslib = ("lrslib", {"sources": glob.glob("src/solvers/lrs/*.c")})
29
+ cppgambit_include_dirs = ["src"]
30
+ cppgambit_cflags = (
31
+ ["-std=c++17"] if platform.system() == "Darwin"
32
+ else ["/std:c++17"] if platform.system() == "Windows"
33
+ else []
34
+ )
35
+
36
+ cppgambit_core = (
37
+ "cppgambit_core",
38
+ {
39
+ "sources": glob.glob("src/core/*.cc"),
40
+ "obj_deps": {"": glob.glob("src/core/*.h") + glob.glob("src/core/*.imp")},
41
+ "include_dirs": cppgambit_include_dirs,
42
+ "cflags": cppgambit_cflags,
43
+ }
44
+ )
32
45
 
33
- cppgambit = (
34
- "cppgambit",
46
+ cppgambit_games = (
47
+ "cppgambit_games",
35
48
  {
36
- "sources": (
37
- glob.glob("src/core/*.cc") +
38
- glob.glob("src/games/*.cc") +
39
- glob.glob("src/games/agg/*.cc") +
40
- [fn for fn in glob.glob("src/solvers/*/*.cc") if "enumpoly" not in fn]
41
- ),
42
- "include_dirs": ["src"],
43
- "cflags": (
44
- ["-std=c++17"] if platform.system() == "Darwin"
45
- else ["/std:c++17"] if platform.system() == "Windows"
46
- else []
47
- )
49
+ "sources": glob.glob("src/games/*.cc") + glob.glob("src/games/agg/*.cc"),
50
+ "obj_deps": {
51
+ "": (
52
+ glob.glob("src/core/*.h") + glob.glob("src/core/*.imp") +
53
+ glob.glob("src/games/*.h") + glob.glob("src/games/*.imp") +
54
+ glob.glob("src/games/agg/*.h")
55
+ )
56
+ },
57
+ "include_dirs": cppgambit_include_dirs,
58
+ "cflags": cppgambit_cflags,
48
59
  }
49
60
  )
50
61
 
51
62
 
63
+ def solver_library_config(library_name: str, paths: list) -> tuple:
64
+ return (
65
+ library_name,
66
+ {
67
+ "sources": [fn for solver in paths for fn in glob.glob(f"src/solvers/{solver}/*.cc")],
68
+ "obj_deps": {
69
+ "": (
70
+ glob.glob("src/core/*.h") + glob.glob("src/games/*.h") +
71
+ glob.glob("src/games/agg/*.h") +
72
+ [fn for solver in paths for fn in glob.glob(f"src/solvers/{solver}/*.h")]
73
+ )
74
+ },
75
+ "include_dirs": cppgambit_include_dirs,
76
+ "cflags": cppgambit_cflags,
77
+ }
78
+ )
79
+
80
+
81
+ cppgambit_bimatrix = solver_library_config("cppgambit_bimatrix",
82
+ ["linalg", "lp", "lcp", "enummixed"])
83
+ cppgambit_liap = solver_library_config("cppgambit_liap", ["liap"])
84
+ cppgambit_logit = solver_library_config("cppgambit_logit", ["logit"])
85
+ cppgambit_gtracer = solver_library_config("cppgambit_gtracer", ["gtracer", "ipa", "gnm"])
86
+ cppgambit_simpdiv = solver_library_config("cppgambit_simpdiv", ["simpdiv"])
87
+ cppgambit_enumpoly = solver_library_config("cppgambit_enumpoly", ["nashsupport", "enumpoly"])
88
+
89
+
52
90
  libgambit = setuptools.Extension(
53
91
  "pygambit.gambit",
54
92
  sources=["src/pygambit/gambit.pyx"],
@@ -69,14 +107,13 @@ def readme():
69
107
 
70
108
  setuptools.setup(
71
109
  name="pygambit",
72
- version="16.2.2",
110
+ version="16.3.1",
73
111
  description="The package for computation in game theory",
74
112
  long_description=readme(),
75
113
  classifiers=[
76
114
  "Development Status :: 5 - Production/Stable",
77
115
  "Intended Audience :: Science/Research",
78
116
  "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
79
- "Programming Language :: Python :: 3.8",
80
117
  "Programming Language :: Python :: 3.9",
81
118
  "Programming Language :: Python :: 3.10",
82
119
  "Programming Language :: Python :: 3.11",
@@ -88,20 +125,21 @@ setuptools.setup(
88
125
  license="GPL2+",
89
126
  author="Theodore Turocy",
90
127
  author_email="ted.turocy@gmail.com",
91
- url="http://www.gambit-project.org",
128
+ url="https://www.gambit-project.org",
92
129
  project_urls={
93
130
  "Documentation": "https://gambitproject.readthedocs.io/",
94
131
  "Source": "https://github.com/gambitproject/gambit",
95
132
  "Tracker": "https://github.com/gambitproject/gambit/issues",
96
133
  },
97
- python_requires=">=3.8",
134
+ python_requires=">=3.9",
98
135
  install_requires=[
99
- "lxml", # used for reading/writing GTE files
100
136
  "numpy",
101
137
  "scipy",
102
138
  "deprecated",
103
139
  ],
104
- libraries=[cppgambit, lrslib],
140
+ libraries=[cppgambit_bimatrix, cppgambit_liap, cppgambit_logit, cppgambit_simpdiv,
141
+ cppgambit_gtracer, cppgambit_enumpoly,
142
+ cppgambit_games, cppgambit_core],
105
143
  package_dir={"": "src"},
106
144
  packages=["pygambit"],
107
145
  ext_modules=Cython.Build.cythonize(libgambit,
@@ -0,0 +1,285 @@
1
+ //
2
+ // This file is part of Gambit
3
+ // Copyright (c) 1994-2025, The Gambit Project (https://www.gambit-project.org)
4
+ //
5
+ // FILE: src/libgambit/array.h
6
+ // A basic bounds-checked array type
7
+ //
8
+ // This program is free software; you can redistribute it and/or modify
9
+ // it under the terms of the GNU General Public License as published by
10
+ // the Free Software Foundation; either version 2 of the License, or
11
+ // (at your option) any later version.
12
+ //
13
+ // This program is distributed in the hope that it will be useful,
14
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ // GNU General Public License for more details.
17
+ //
18
+ // You should have received a copy of the GNU General Public License
19
+ // along with this program; if not, write to the Free Software
20
+ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
+ //
22
+
23
+ #ifndef LIBGAMBIT_ARRAY_H
24
+ #define LIBGAMBIT_ARRAY_H
25
+
26
+ #include <vector>
27
+ #include <iterator>
28
+
29
+ namespace Gambit {
30
+
31
+ /// \brief An extension of std::vector to have arbitrary offset index
32
+ ///
33
+ /// This is a variation on std::vector, which allows for the index of the first
34
+ /// element to be something other than zero.
35
+ template <class T> class Array {
36
+ protected:
37
+ int m_offset, m_length;
38
+ T *m_data;
39
+
40
+ int InsertAt(const T &t, int n)
41
+ {
42
+ if (this->m_offset > n || n > this->last_index() + 1) {
43
+ throw IndexException();
44
+ }
45
+
46
+ T *new_data = new T[++this->m_length] - this->m_offset;
47
+
48
+ int i;
49
+ for (i = this->m_offset; i <= n - 1; i++) {
50
+ new_data[i] = this->m_data[i];
51
+ }
52
+ new_data[i++] = t;
53
+ for (; i <= this->last_index(); i++) {
54
+ new_data[i] = this->m_data[i - 1];
55
+ }
56
+
57
+ if (this->m_data) {
58
+ delete[] (this->m_data + this->m_offset);
59
+ }
60
+ this->m_data = new_data;
61
+
62
+ return n;
63
+ }
64
+
65
+ T Remove(int n)
66
+ {
67
+ if (n < this->m_offset || n > this->last_index()) {
68
+ throw IndexException();
69
+ }
70
+
71
+ T ret(this->m_data[n]);
72
+ T *new_data = (--this->m_length > 0) ? new T[this->m_length] - this->m_offset : nullptr;
73
+
74
+ int i;
75
+ for (i = this->m_offset; i < n; i++) {
76
+ new_data[i] = this->m_data[i];
77
+ }
78
+ for (; i <= this->last_index(); i++) {
79
+ new_data[i] = this->m_data[i + 1];
80
+ }
81
+
82
+ delete[] (this->m_data + this->m_offset);
83
+ this->m_data = new_data;
84
+
85
+ return ret;
86
+ }
87
+
88
+ public:
89
+ class iterator {
90
+ friend class Array;
91
+
92
+ private:
93
+ Array *m_array;
94
+ int m_index;
95
+
96
+ public:
97
+ using iterator_category = std::bidirectional_iterator_tag;
98
+ using difference_type = std::ptrdiff_t;
99
+ using value_type = T;
100
+ using pointer = value_type *;
101
+ using reference = value_type &;
102
+
103
+ iterator(Array *p_array = 0, int p_index = 0) : m_array(p_array), m_index(p_index) {}
104
+ reference operator*() { return (*m_array)[m_index]; }
105
+ pointer operator->() { return &(*m_array)[m_index]; }
106
+ iterator &operator++()
107
+ {
108
+ m_index++;
109
+ return *this;
110
+ }
111
+ iterator &operator--()
112
+ {
113
+ m_index--;
114
+ return *this;
115
+ }
116
+ iterator operator++(int)
117
+ {
118
+ auto ret = *this;
119
+ m_index++;
120
+ return ret;
121
+ }
122
+ bool operator==(const iterator &it) const
123
+ {
124
+ return (m_array == it.m_array) && (m_index == it.m_index);
125
+ }
126
+ bool operator!=(const iterator &it) const { return !(*this == it); }
127
+ };
128
+
129
+ class const_iterator {
130
+ friend class Array;
131
+
132
+ private:
133
+ const Array *m_array;
134
+ int m_index;
135
+
136
+ public:
137
+ using iterator_category = std::bidirectional_iterator_tag;
138
+ using difference_type = std::ptrdiff_t;
139
+ using value_type = T;
140
+ using pointer = value_type *;
141
+ using reference = value_type &;
142
+
143
+ const_iterator(const Array *p_array, int p_index) : m_array(p_array), m_index(p_index) {}
144
+ const T &operator*() const { return (*m_array)[m_index]; }
145
+ const T &operator->() const { return (*m_array)[m_index]; }
146
+ const_iterator &operator++()
147
+ {
148
+ m_index++;
149
+ return *this;
150
+ }
151
+ const_iterator &operator--()
152
+ {
153
+ m_index--;
154
+ return *this;
155
+ }
156
+ const_iterator operator++(int)
157
+ {
158
+ auto ret = *this;
159
+ m_index++;
160
+ return ret;
161
+ }
162
+ bool operator==(const const_iterator &it) const
163
+ {
164
+ return (m_array == it.m_array) && (m_index == it.m_index);
165
+ }
166
+ bool operator!=(const const_iterator &it) const { return !(*this == it); }
167
+ };
168
+
169
+ explicit Array(unsigned int len = 0)
170
+ : m_offset(1), m_length(len), m_data((len) ? new T[len] - 1 : nullptr)
171
+ {
172
+ }
173
+ Array(int lo, int hi) : m_offset(lo), m_length(hi - lo + 1)
174
+ {
175
+ if (m_length < 0) {
176
+ throw RangeException();
177
+ }
178
+ m_data = (m_length > 0) ? new T[m_length] - m_offset : nullptr;
179
+ }
180
+ Array(const Array<T> &a)
181
+ : m_offset(a.m_offset), m_length(a.m_length),
182
+ m_data((m_length > 0) ? new T[m_length] - m_offset : nullptr)
183
+ {
184
+ for (int i = m_offset; i <= last_index(); i++) {
185
+ m_data[i] = a.m_data[i];
186
+ }
187
+ }
188
+ virtual ~Array()
189
+ {
190
+ if (m_length > 0) {
191
+ delete[] (m_data + m_offset);
192
+ }
193
+ }
194
+
195
+ Array<T> &operator=(const Array<T> &a)
196
+ {
197
+ if (this != &a) {
198
+ // We only reallocate if necessary.
199
+ if (!m_data || (m_data && (m_offset != a.m_offset || m_length != a.m_length))) {
200
+ if (m_data) {
201
+ delete[] (m_data + m_offset);
202
+ }
203
+ m_offset = a.m_offset;
204
+ m_length = a.m_length;
205
+ m_data = (m_length > 0) ? new T[m_length] - m_offset : nullptr;
206
+ }
207
+
208
+ for (int i = m_offset; i <= last_index(); i++) {
209
+ m_data[i] = a.m_data[i];
210
+ }
211
+ }
212
+
213
+ return *this;
214
+ }
215
+
216
+ bool operator==(const Array<T> &a) const
217
+ {
218
+ if (m_offset != a.m_offset || m_length != a.m_length) {
219
+ return false;
220
+ }
221
+ for (int i = m_offset; i <= last_index(); i++) {
222
+ if ((*this)[i] != a[i]) {
223
+ return false;
224
+ }
225
+ }
226
+ return true;
227
+ }
228
+
229
+ bool operator!=(const Array<T> &a) const { return !(*this == a); }
230
+
231
+ const T &operator[](int index) const
232
+ {
233
+ if (index < m_offset || index > last_index()) {
234
+ throw IndexException();
235
+ }
236
+ return m_data[index];
237
+ }
238
+
239
+ T &operator[](int index)
240
+ {
241
+ if (index < m_offset || index > last_index()) {
242
+ throw IndexException();
243
+ }
244
+ return m_data[index];
245
+ }
246
+ const T &front() const { return m_data[m_offset]; }
247
+ T &front() { return m_data[m_offset]; }
248
+ const T &back() const { return m_data[last_index()]; }
249
+ T &back() { return m_data[last_index()]; }
250
+
251
+ iterator begin() { return {this, m_offset}; }
252
+ const_iterator begin() const { return {this, m_offset}; }
253
+ iterator end() { return {this, m_offset + m_length}; }
254
+ const_iterator end() const { return {this, m_offset + m_length}; }
255
+ const_iterator cbegin() const { return {this, m_offset}; }
256
+ const_iterator cend() const { return {this, m_offset + m_length}; }
257
+
258
+ bool empty() const { return this->m_length == 0; }
259
+ size_t size() const { return m_length; }
260
+ int first_index() const { return m_offset; }
261
+ int last_index() const { return m_offset + m_length - 1; }
262
+
263
+ void clear()
264
+ {
265
+ if (m_length > 0) {
266
+ delete[] (m_data + m_offset);
267
+ }
268
+ m_data = nullptr;
269
+ m_length = 0;
270
+ }
271
+ void insert(const_iterator pos, const T &value) { InsertAt(value, pos.m_index); }
272
+ void erase(iterator pos) { Remove(pos.m_index); }
273
+ void push_back(const T &val) { InsertAt(val, this->last_index() + 1); }
274
+ void pop_back() { Remove(last_index()); }
275
+ };
276
+
277
+ /// Convenience function to erase the element at `p_index`
278
+ template <class T> void erase_atindex(Array<T> &p_array, int p_index)
279
+ {
280
+ p_array.erase(std::next(p_array.begin(), p_index - p_array.first_index()));
281
+ }
282
+
283
+ } // end namespace Gambit
284
+
285
+ #endif // LIBGAMBIT_ARRAY_H
@@ -46,7 +46,7 @@ using namespace Gambit;
46
46
  void FunctionOnSimplices::Project(Vector<double> &x, const Array<int> &lengths) const
47
47
  {
48
48
  int index = 1;
49
- for (int part = 1; part <= lengths.Length(); part++) {
49
+ for (int part = 1; part <= lengths.size(); part++) {
50
50
  double avg = 0.0;
51
51
  int j;
52
52
  for (j = 1; j <= lengths[part]; j++, index++) {
@@ -70,7 +70,7 @@ void FunctionOnSimplices::Project(Vector<double> &x, const Array<int> &lengths)
70
70
 
71
71
  void ConjugatePRMinimizer::AlphaXPlusY(double alpha, const Vector<double> &x, Vector<double> &y)
72
72
  {
73
- for (int i = 1; i <= y.Length(); i++) {
73
+ for (int i = 1; i <= y.size(); i++) {
74
74
  y[i] += alpha * x[i];
75
75
  }
76
76
  }
@@ -330,7 +330,7 @@ bool ConjugatePRMinimizer::Iterate(const Function &fdf, Vector<double> &x, doubl
330
330
  x = x2;
331
331
 
332
332
  /* Choose a new conjugate direction for the next step */
333
- iter = (iter + 1) % x.Length();
333
+ iter = (iter + 1) % x.size();
334
334
 
335
335
  if (iter == 0) {
336
336
  p = gradient;
@@ -0,0 +1,132 @@
1
+ //
2
+ // This file is part of Gambit
3
+ // Copyright (c) 1994-2025, The Gambit Project (https://www.gambit-project.org)
4
+ //
5
+ // FILE: src/libgambit/list.h
6
+ // A generic linked-list container class
7
+ //
8
+ // This program is free software; you can redistribute it and/or modify
9
+ // it under the terms of the GNU General Public License as published by
10
+ // the Free Software Foundation; either version 2 of the License, or
11
+ // (at your option) any later version.
12
+ //
13
+ // This program is distributed in the hope that it will be useful,
14
+ // but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ // GNU General Public License for more details.
17
+ //
18
+ // You should have received a copy of the GNU General Public License
19
+ // along with this program; if not, write to the Free Software
20
+ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
+ //
22
+
23
+ #ifndef LIBGAMBIT_LIST_H
24
+ #define LIBGAMBIT_LIST_H
25
+
26
+ #include <list>
27
+
28
+ namespace Gambit {
29
+
30
+ /// @brief A linked-list container
31
+ ///
32
+ /// This is a lightweight wrapper around std::list. It exists as a transitional
33
+ /// class between Gambit's legacy linked-list implementation Gambit::List and
34
+ /// STL's list.
35
+ ///
36
+ /// Gambit's List container supported the index operator [], which is not defined
37
+ /// on STL lists. Therefore this class provides such an operator by wrapping
38
+ /// an appropriate iterator-based operation. This is very inefficient! However,
39
+ /// the [] operator and indexing is tightly embedded in the remaining uses of this
40
+ /// class, so this operator provides a refactoring path while the remaining uses
41
+ /// are rewritten.
42
+ ///
43
+ /// Note importantly that the index operator [] is **1-based** - that is, the first
44
+ /// element of the list is 1, not 0.
45
+ template <class T> class List {
46
+ private:
47
+ std::list<T> m_list;
48
+
49
+ public:
50
+ using iterator = typename std::list<T>::iterator;
51
+ using const_iterator = typename std::list<T>::const_iterator;
52
+ using value_type = typename std::list<T>::value_type;
53
+ using size_type = typename std::list<T>::size_type;
54
+
55
+ List() = default;
56
+ List(const List<T> &) = default;
57
+ ~List() = default;
58
+
59
+ List<T> &operator=(const List<T> &) = default;
60
+
61
+ const T &operator[](size_type p_index) const
62
+ {
63
+ if (p_index < 1 || p_index > m_list.size()) {
64
+ throw IndexException();
65
+ }
66
+ return *std::next(m_list.cbegin(), p_index - 1);
67
+ }
68
+
69
+ T &operator[](size_type p_index)
70
+ {
71
+ if (p_index < 1 || p_index > m_list.size()) {
72
+ throw IndexException();
73
+ }
74
+ return *std::next(m_list.begin(), p_index - 1);
75
+ }
76
+
77
+ /// @name STL-style interface
78
+ ///
79
+ /// These operations forward STL-type operations to the underlying list.
80
+ /// This does not provide all operations on std::list, only ones used in
81
+ /// existing code. Rather than adding new functions here, existing code
82
+ /// should be rewritten to use std::list directly.
83
+ ///@{
84
+ /// Return whether the list container is empty (has size 0).
85
+ bool empty() const { return m_list.empty(); }
86
+ /// Return the number of elements in the list container.
87
+ size_type size() const { return m_list.size(); }
88
+ /// Adds a new element at the beginning of the list container
89
+ void push_front(const T &val) { m_list.push_front(val); }
90
+ /// Adds a new element at the end of the list container, after its
91
+ /// current last element.
92
+ void push_back(const T &val) { m_list.push_back(val); }
93
+ /// Removes the last element
94
+ void pop_back() { m_list.pop_back(); }
95
+ /// Inserts the value at the specified position
96
+ void insert(iterator pos, const T &value) { m_list.insert(pos, value); }
97
+ /// Erases the element at the specified position
98
+ void erase(iterator pos) { m_list.erase(pos); }
99
+
100
+ /// Removes all elements from the list container (which are destroyed),
101
+ /// leaving the container with a size of 0.
102
+ void clear() { m_list.clear(); }
103
+ /// Returns a reference to the first element in the list container.
104
+ T &front() { return m_list.front(); }
105
+ /// Returns a reference to the first element in the list container.
106
+ const T &front() const { return m_list.front(); }
107
+ /// Returns a reference to the last element in the list container.
108
+ T &back() { return m_list.back(); }
109
+ /// Returns a reference to the last element in the list container.
110
+ const T &back() const { return m_list.back(); }
111
+
112
+ bool operator==(const List<T> &b) const { return m_list == b.m_list; }
113
+ bool operator!=(const List<T> &b) const { return m_list != b.m_list; }
114
+
115
+ /// Return a forward iterator starting at the beginning of the list
116
+ iterator begin() { return m_list.begin(); }
117
+ /// Return a forward iterator past the end of the list
118
+ iterator end() { return m_list.end(); }
119
+ /// Return a const forward iterator starting at the beginning of the list
120
+ const_iterator begin() const { return m_list.begin(); }
121
+ /// Return a const forward iterator past the end of the list
122
+ const_iterator end() const { return m_list.end(); }
123
+ /// Return a const forward iterator starting at the beginning of the list
124
+ const_iterator cbegin() const { return m_list.cbegin(); }
125
+ /// Return a const forward iterator past the end of the list
126
+ const_iterator cend() const { return m_list.cend(); }
127
+ ///@}
128
+ };
129
+
130
+ } // namespace Gambit
131
+
132
+ #endif // LIBGAMBIT_LIST_H
@@ -169,7 +169,7 @@ template <class T> void Matrix<T>::CMultiply(const Vector<T> &in, Vector<T> &out
169
169
  T sum = (T)0;
170
170
 
171
171
  T *src1 = this->data[i] + this->mincol;
172
- T *src2 = in.data + this->mincol;
172
+ auto src2 = in.begin();
173
173
  int j = this->maxcol - this->mincol + 1;
174
174
  while (j--) {
175
175
  sum += *(src1++) * *(src2++);
@@ -217,7 +217,7 @@ template <class T> void Matrix<T>::RMultiply(const Vector<T> &in, Vector<T> &out
217
217
  T k = in[i];
218
218
 
219
219
  T *src = this->data[i] + this->mincol;
220
- T *dst = out.data + this->mincol;
220
+ auto dst = out.begin();
221
221
  int j = this->maxcol - this->mincol + 1;
222
222
  while (j--) {
223
223
  *(dst++) += *(src++) * k;
@@ -401,6 +401,8 @@ Rational::Rational(long n) : num(n), den(&OneRep) {}
401
401
 
402
402
  Rational::Rational(int n) : num(n), den(&OneRep) {}
403
403
 
404
+ Rational::Rational(size_t n) : num(int(n)), den(&OneRep) {}
405
+
404
406
  Rational::Rational(long n, long d) : num(n), den(d)
405
407
  {
406
408
  if (d == 0) {
@@ -437,8 +439,6 @@ bool Rational::operator>(const Rational &y) const { return compare(*this, y) > 0
437
439
 
438
440
  bool Rational::operator>=(const Rational &y) const { return compare(*this, y) >= 0; }
439
441
 
440
- int sign(const Rational &x) { return sign(x.num); }
441
-
442
442
  void Rational::negate() { num.negate(); }
443
443
 
444
444
  Rational &Rational::operator+=(const Rational &y)
@@ -44,6 +44,7 @@ public:
44
44
  Rational();
45
45
  explicit Rational(double);
46
46
  explicit Rational(int);
47
+ explicit Rational(size_t);
47
48
  explicit Rational(long n);
48
49
  Rational(int n, int d);
49
50
  Rational(long n, long d);
@@ -115,6 +116,8 @@ public:
115
116
  // Naming compatible with Boost's lexical_cast concept for potential future compatibility.
116
117
  template <> Rational lexical_cast(const std::string &);
117
118
 
119
+ inline int sign(const Rational &x) { return sign(x.num); }
120
+
118
121
  } // end namespace Gambit
119
122
 
120
123
  #endif // LIBGAMBIT_RATIONAL_H