pygambit 16.2.0__tar.gz → 16.3.0__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.
- {pygambit-16.2.0/src/pygambit.egg-info → pygambit-16.3.0}/PKG-INFO +3 -4
- {pygambit-16.2.0 → pygambit-16.3.0}/pyproject.toml +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/setup.py +62 -24
- pygambit-16.3.0/src/core/array.h +285 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/core/function.cc +4 -4
- {pygambit-16.2.0 → pygambit-16.3.0}/src/core/function.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/core/integer.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/core/integer.h +1 -1
- pygambit-16.3.0/src/core/list.h +132 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/core/matrix.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/core/matrix.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/core/matrix.imp +3 -3
- {pygambit-16.2.0 → pygambit-16.3.0}/src/core/rational.cc +4 -4
- {pygambit-16.2.0 → pygambit-16.3.0}/src/core/rational.h +4 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/core/recarray.h +3 -3
- {pygambit-16.2.0 → pygambit-16.3.0}/src/core/sqmatrix.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/core/sqmatrix.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/core/sqmatrix.imp +1 -1
- pygambit-16.3.0/src/core/vector.h +167 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/gambit.h +7 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/agg/agg.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/agg/agg.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/agg/bagg.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/agg/gray.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/agg/proj_func.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/agg/trie_map.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/agg/trie_map.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/agg/trie_map.imp +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/behavmixed.cc +75 -33
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/behavmixed.h +17 -12
- pygambit-16.3.0/src/games/behavpure.cc +175 -0
- pygambit-16.3.0/src/games/behavpure.h +141 -0
- pygambit-16.3.0/src/games/behavspt.cc +262 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/behavspt.h +44 -38
- pygambit-16.3.0/src/games/file.cc +804 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/game.cc +43 -57
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/game.h +37 -15
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/gameagg.cc +10 -19
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/gameagg.h +19 -11
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/gamebagg.cc +6 -16
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/gamebagg.h +18 -10
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/gameexpl.cc +4 -4
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/gameexpl.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/gameobject.h +2 -2
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/gametable.cc +50 -100
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/gametable.h +1 -5
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/gametree.cc +112 -232
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/gametree.h +2 -12
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/nash.cc +107 -122
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/nash.h +5 -3
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/number.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/stratmixed.h +5 -6
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/stratpure.cc +33 -78
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/stratpure.h +35 -42
- pygambit-16.3.0/src/games/stratspt.cc +301 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/stratspt.h +28 -79
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/writer.cc +43 -39
- pygambit-16.3.0/src/games/writer.h +95 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/__init__.py +2 -3
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/action.pxi +12 -4
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/behavmixed.pxi +71 -39
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/enumeration.py +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/error.py +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/gambit.cpp +64574 -51008
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/gambit.pxd +88 -26
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/gambit.pyx +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/game.pxi +411 -96
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/gameiter.py +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/infoset.pxi +40 -31
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/levelk.py +1 -1
- pygambit-16.3.0/src/pygambit/nash.h +107 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/nash.pxi +157 -56
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/nash.py +160 -24
- pygambit-16.3.0/src/pygambit/nashlrs.py +60 -0
- pygambit-16.3.0/src/pygambit/nashphc.py +256 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/node.pxi +33 -37
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/outcome.pxi +26 -8
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/player.pxi +54 -37
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/profiles.py +1 -1
- pygambit-16.3.0/src/pygambit/qre.py +329 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/strategy.pxi +13 -7
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/stratmixed.pxi +54 -30
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/stratspt.pxi +85 -39
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/supports.py +9 -4
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit/util.h +62 -4
- pygambit-16.3.0/src/pygambit/util.py +24 -0
- {pygambit-16.2.0 → pygambit-16.3.0/src/pygambit.egg-info}/PKG-INFO +3 -4
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit.egg-info/SOURCES.txt +21 -73
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit.egg-info/requires.txt +0 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/enummixed/clique.cc +2 -2
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/enummixed/clique.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/enummixed/enummixed.cc +16 -16
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/enummixed/enummixed.h +1 -22
- pygambit-16.3.0/src/solvers/enumpoly/behavextend.cc +460 -0
- pygambit-16.3.0/src/solvers/enumpoly/behavextend.h +53 -0
- pygambit-16.3.0/src/solvers/enumpoly/efgpoly.cc +231 -0
- pygambit-16.3.0/src/solvers/enumpoly/enumpoly.h +72 -0
- pygambit-16.3.0/src/solvers/enumpoly/gameseq.cc +132 -0
- pygambit-16.3.0/src/solvers/enumpoly/gameseq.h +301 -0
- pygambit-16.3.0/src/solvers/enumpoly/indexproduct.h +89 -0
- pygambit-16.3.0/src/solvers/enumpoly/ndarray.h +92 -0
- pygambit-16.3.0/src/solvers/enumpoly/nfgpoly.cc +177 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/enumpoly/poly.cc +10 -4
- pygambit-16.3.0/src/solvers/enumpoly/poly.h +339 -0
- pygambit-16.3.0/src/solvers/enumpoly/poly.imp +293 -0
- pygambit-16.3.0/src/solvers/enumpoly/polyfeasible.h +107 -0
- pygambit-16.3.0/src/solvers/enumpoly/polypartial.h +107 -0
- pygambit-16.3.0/src/solvers/enumpoly/polypartial.imp +199 -0
- pygambit-16.3.0/src/solvers/enumpoly/polysolver.cc +226 -0
- pygambit-16.3.0/src/solvers/enumpoly/polysolver.h +103 -0
- pygambit-16.3.0/src/solvers/enumpoly/polysystem.h +113 -0
- pygambit-16.3.0/src/solvers/enumpoly/rectangle.h +188 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/enumpure/enumpure.h +7 -7
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/gnm/gnm.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/gnm/gnm.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/gtracer/aggame.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/gtracer/aggame.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/gtracer/cmatrix.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/gtracer/cmatrix.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/gtracer/gnm.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/gtracer/gnmgame.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/gtracer/gnmgame.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/gtracer/gtracer.cc +5 -6
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/gtracer/gtracer.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/gtracer/ipa.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/gtracer/nfgame.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/gtracer/nfgame.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/ipa/ipa.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/ipa/ipa.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/lcp/efglcp.cc +2 -2
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/lcp/lcp.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/lcp/nfglcp.cc +2 -2
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/liap/efgliap.cc +10 -3
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/liap/liap.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/liap/nfgliap.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/basis.cc +16 -10
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/basis.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/bfs.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/btableau.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/btableau.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/btableau.imp +6 -6
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/lemketab.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/lemketab.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/lemketab.imp +18 -18
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/lhtab.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/lhtab.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/lhtab.imp +5 -5
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/lpsolve.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/lpsolve.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/lpsolve.imp +20 -100
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/lptab.cc +3 -7
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/lptab.h +14 -29
- pygambit-16.3.0/src/solvers/linalg/lptab.imp +418 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/ludecomp.cc +4 -12
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/ludecomp.h +27 -56
- pygambit-16.3.0/src/solvers/linalg/ludecomp.imp +352 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/tableau.cc +28 -28
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/tableau.h +2 -2
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/linalg/vertenum.h +12 -18
- pygambit-16.3.0/src/solvers/linalg/vertenum.imp +115 -0
- pygambit-16.3.0/src/solvers/logit/efglogit.cc +425 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/logit/logbehav.h +26 -54
- pygambit-16.3.0/src/solvers/logit/logbehav.imp +275 -0
- pygambit-16.3.0/src/solvers/logit/logit.h +128 -0
- pygambit-16.3.0/src/solvers/logit/nfglogit.cc +337 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/logit/path.cc +18 -36
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/logit/path.h +27 -60
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/lp/efglp.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/lp/efglp.h +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/lp/nfglp.cc +1 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/lp/nfglp.h +1 -1
- pygambit-16.3.0/src/solvers/nashsupport/efgsupport.cc +91 -0
- pygambit-16.3.0/src/solvers/nashsupport/nashsupport.h +48 -0
- pygambit-16.3.0/src/solvers/nashsupport/nfgsupport.cc +265 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/simpdiv/simpdiv.cc +62 -26
- {pygambit-16.2.0 → pygambit-16.3.0}/src/solvers/simpdiv/simpdiv.h +13 -13
- {pygambit-16.2.0 → pygambit-16.3.0}/tests/test_actions.py +2 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/tests/test_behav.py +2 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/tests/test_extensive.py +2 -1
- pygambit-16.3.0/tests/test_file.py +135 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/tests/test_game.py +76 -9
- pygambit-16.3.0/tests/test_game_resolve.py +171 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/tests/test_infosets.py +2 -1
- pygambit-16.3.0/tests/test_io.py +91 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/tests/test_mixed.py +2 -1
- pygambit-16.3.0/tests/test_nash.py +226 -0
- pygambit-16.3.0/tests/test_node.py +358 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/tests/test_outcomes.py +2 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/tests/test_players.py +2 -1
- {pygambit-16.2.0 → pygambit-16.3.0}/tests/test_strategic.py +2 -1
- pygambit-16.3.0/tests/test_stratprofiles.py +80 -0
- pygambit-16.2.0/src/core/array.h +0 -333
- pygambit-16.2.0/src/core/dvector.cc +0 -27
- pygambit-16.2.0/src/core/dvector.h +0 -56
- pygambit-16.2.0/src/core/dvector.imp +0 -114
- pygambit-16.2.0/src/core/list.h +0 -455
- pygambit-16.2.0/src/core/pvector.cc +0 -28
- pygambit-16.2.0/src/core/pvector.h +0 -85
- pygambit-16.2.0/src/core/pvector.imp +0 -297
- pygambit-16.2.0/src/core/vector.cc +0 -30
- pygambit-16.2.0/src/core/vector.h +0 -78
- pygambit-16.2.0/src/core/vector.imp +0 -199
- pygambit-16.2.0/src/games/behavpure.cc +0 -226
- pygambit-16.2.0/src/games/behavpure.h +0 -130
- pygambit-16.2.0/src/games/behavspt.cc +0 -579
- pygambit-16.2.0/src/games/file.cc +0 -1060
- pygambit-16.2.0/src/games/stratspt.cc +0 -432
- pygambit-16.2.0/src/games/writer.h +0 -77
- pygambit-16.2.0/src/pygambit/gte.py +0 -130
- pygambit-16.2.0/src/pygambit/nash.h +0 -72
- pygambit-16.2.0/src/pygambit/pctrace.py +0 -469
- pygambit-16.2.0/src/pygambit/qre.py +0 -431
- pygambit-16.2.0/src/solvers/enummixed/lrsenum.cc +0 -947
- pygambit-16.2.0/src/solvers/enumpoly/behavextend.cc +0 -565
- pygambit-16.2.0/src/solvers/enumpoly/behavextend.h +0 -42
- pygambit-16.2.0/src/solvers/enumpoly/efgensup.cc +0 -678
- pygambit-16.2.0/src/solvers/enumpoly/efgensup.h +0 -130
- pygambit-16.2.0/src/solvers/enumpoly/efgpoly.cc +0 -401
- pygambit-16.2.0/src/solvers/enumpoly/gcomplex.cc +0 -83
- pygambit-16.2.0/src/solvers/enumpoly/gcomplex.h +0 -85
- pygambit-16.2.0/src/solvers/enumpoly/gnarray.h +0 -59
- pygambit-16.2.0/src/solvers/enumpoly/gnarray.imp +0 -150
- pygambit-16.2.0/src/solvers/enumpoly/gpartltr.cc +0 -50
- pygambit-16.2.0/src/solvers/enumpoly/gpartltr.h +0 -118
- pygambit-16.2.0/src/solvers/enumpoly/gpartltr.imp +0 -505
- pygambit-16.2.0/src/solvers/enumpoly/gpoly.cc +0 -50
- pygambit-16.2.0/src/solvers/enumpoly/gpoly.h +0 -205
- pygambit-16.2.0/src/solvers/enumpoly/gpoly.imp +0 -1075
- pygambit-16.2.0/src/solvers/enumpoly/gpolylst.cc +0 -37
- pygambit-16.2.0/src/solvers/enumpoly/gpolylst.h +0 -131
- pygambit-16.2.0/src/solvers/enumpoly/gpolylst.imp +0 -611
- pygambit-16.2.0/src/solvers/enumpoly/gsolver.cc +0 -26
- pygambit-16.2.0/src/solvers/enumpoly/gsolver.h +0 -54
- pygambit-16.2.0/src/solvers/enumpoly/gsolver.imp +0 -212
- pygambit-16.2.0/src/solvers/enumpoly/gtree.h +0 -90
- pygambit-16.2.0/src/solvers/enumpoly/gtree.imp +0 -185
- pygambit-16.2.0/src/solvers/enumpoly/ideal.cc +0 -37
- pygambit-16.2.0/src/solvers/enumpoly/ideal.h +0 -86
- pygambit-16.2.0/src/solvers/enumpoly/ideal.imp +0 -240
- pygambit-16.2.0/src/solvers/enumpoly/ineqsolv.cc +0 -26
- pygambit-16.2.0/src/solvers/enumpoly/ineqsolv.h +0 -93
- pygambit-16.2.0/src/solvers/enumpoly/ineqsolv.imp +0 -177
- pygambit-16.2.0/src/solvers/enumpoly/interval.h +0 -89
- pygambit-16.2.0/src/solvers/enumpoly/linrcomb.cc +0 -28
- pygambit-16.2.0/src/solvers/enumpoly/linrcomb.h +0 -68
- pygambit-16.2.0/src/solvers/enumpoly/linrcomb.imp +0 -200
- pygambit-16.2.0/src/solvers/enumpoly/monomial.cc +0 -27
- pygambit-16.2.0/src/solvers/enumpoly/monomial.h +0 -66
- pygambit-16.2.0/src/solvers/enumpoly/monomial.imp +0 -134
- pygambit-16.2.0/src/solvers/enumpoly/nfgcpoly.cc +0 -359
- pygambit-16.2.0/src/solvers/enumpoly/nfgcpoly.h +0 -85
- pygambit-16.2.0/src/solvers/enumpoly/nfgensup.cc +0 -187
- pygambit-16.2.0/src/solvers/enumpoly/nfgensup.h +0 -37
- pygambit-16.2.0/src/solvers/enumpoly/nfghs.cc +0 -698
- pygambit-16.2.0/src/solvers/enumpoly/nfghs.h +0 -120
- pygambit-16.2.0/src/solvers/enumpoly/nfgpoly.cc +0 -504
- pygambit-16.2.0/src/solvers/enumpoly/odometer.cc +0 -224
- pygambit-16.2.0/src/solvers/enumpoly/odometer.h +0 -112
- pygambit-16.2.0/src/solvers/enumpoly/poly.h +0 -150
- pygambit-16.2.0/src/solvers/enumpoly/poly.imp +0 -883
- pygambit-16.2.0/src/solvers/enumpoly/prepoly.cc +0 -679
- pygambit-16.2.0/src/solvers/enumpoly/prepoly.h +0 -199
- pygambit-16.2.0/src/solvers/enumpoly/quiksolv.cc +0 -25
- pygambit-16.2.0/src/solvers/enumpoly/quiksolv.h +0 -162
- pygambit-16.2.0/src/solvers/enumpoly/quiksolv.imp +0 -665
- pygambit-16.2.0/src/solvers/enumpoly/rectangl.cc +0 -26
- pygambit-16.2.0/src/solvers/enumpoly/rectangl.h +0 -84
- pygambit-16.2.0/src/solvers/enumpoly/rectangl.imp +0 -307
- pygambit-16.2.0/src/solvers/enumpoly/sfg.cc +0 -291
- pygambit-16.2.0/src/solvers/enumpoly/sfg.h +0 -74
- pygambit-16.2.0/src/solvers/enumpoly/sfstrat.cc +0 -249
- pygambit-16.2.0/src/solvers/enumpoly/sfstrat.h +0 -150
- pygambit-16.2.0/src/solvers/linalg/lptab.imp +0 -757
- pygambit-16.2.0/src/solvers/linalg/ludecomp.imp +0 -465
- pygambit-16.2.0/src/solvers/linalg/vertenum.imp +0 -181
- pygambit-16.2.0/src/solvers/logit/efglogit.cc +0 -375
- pygambit-16.2.0/src/solvers/logit/efglogit.h +0 -96
- pygambit-16.2.0/src/solvers/logit/logbehav.imp +0 -411
- pygambit-16.2.0/src/solvers/logit/nfglogit.cc +0 -429
- pygambit-16.2.0/src/solvers/logit/nfglogit.h +0 -125
- pygambit-16.2.0/src/solvers/lrs/lrslib.c +0 -5620
- pygambit-16.2.0/src/solvers/lrs/lrslib.h +0 -354
- pygambit-16.2.0/src/solvers/lrs/lrsmp.c +0 -1078
- pygambit-16.2.0/src/solvers/lrs/lrsmp.h +0 -232
- pygambit-16.2.0/src/solvers/lrs/lrsnashlib.c +0 -1195
- pygambit-16.2.0/src/solvers/lrs/lrsnashlib.h +0 -68
- pygambit-16.2.0/tests/test_file.py +0 -109
- pygambit-16.2.0/tests/test_game_resolve_functions.py +0 -109
- pygambit-16.2.0/tests/test_nash.py +0 -145
- pygambit-16.2.0/tests/test_node.py +0 -386
- pygambit-16.2.0/tests/test_stratprofiles.py +0 -90
- {pygambit-16.2.0 → pygambit-16.3.0}/AUTHORS +0 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/COPYING +0 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/MANIFEST.in +0 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/README.md +0 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/setup.cfg +0 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/README.rst +0 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/core/tinyxml.cc +0 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/core/tinyxml.h +0 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/core/tinyxmlerror.cc +0 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/core/tinyxmlparser.cc +0 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/games/agg/bagg.cc +0 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit.egg-info/dependency_links.txt +0 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/src/pygambit.egg-info/top_level.txt +0 -0
- {pygambit-16.2.0 → pygambit-16.3.0}/tests/test_userguide.py +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pygambit
|
|
3
|
-
Version: 16.
|
|
3
|
+
Version: 16.3.0
|
|
4
4
|
Summary: The package for computation in game theory
|
|
5
|
-
Home-page:
|
|
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,14 +13,13 @@ 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.
|
|
22
|
+
Requires-Python: >=3.9
|
|
24
23
|
License-File: COPYING
|
|
25
24
|
License-File: AUTHORS
|
|
26
25
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#
|
|
2
2
|
# This file is part of Gambit
|
|
3
|
-
# Copyright (c) 1994-
|
|
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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
34
|
-
"
|
|
46
|
+
cppgambit_games = (
|
|
47
|
+
"cppgambit_games",
|
|
35
48
|
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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.
|
|
110
|
+
version="16.3.0",
|
|
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="
|
|
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.
|
|
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=[
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
2
|
// This file is part of Gambit
|
|
3
|
-
// Copyright (c) 1994-
|
|
3
|
+
// Copyright (c) 1994-2025, The Gambit Project (https://www.gambit-project.org)
|
|
4
4
|
//
|
|
5
5
|
// FILE: src/libgambit/function.cc
|
|
6
6
|
// Implementation of function and function minimization routines
|
|
@@ -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.
|
|
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.
|
|
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.
|
|
333
|
+
iter = (iter + 1) % x.size();
|
|
334
334
|
|
|
335
335
|
if (iter == 0) {
|
|
336
336
|
p = gradient;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
2
|
// This file is part of Gambit
|
|
3
|
-
// Copyright (c) 1994-
|
|
3
|
+
// Copyright (c) 1994-2025, The Gambit Project (https://www.gambit-project.org)
|
|
4
4
|
//
|
|
5
5
|
// FILE: src/libgambit/function.h
|
|
6
6
|
// Interface to function and function minimization routines
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
2
|
// This file is part of Gambit
|
|
3
|
-
// Copyright (c) 1994-
|
|
3
|
+
// Copyright (c) 1994-2025, The Gambit Project (https://www.gambit-project.org)
|
|
4
4
|
//
|
|
5
5
|
// FILE: src/libgambit/integer.cc
|
|
6
6
|
// Implementation of an arbitrary-length integer class
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
2
|
// This file is part of Gambit
|
|
3
|
-
// Copyright (c) 1994-
|
|
3
|
+
// Copyright (c) 1994-2025, The Gambit Project (https://www.gambit-project.org)
|
|
4
4
|
//
|
|
5
5
|
// FILE: src/libgambit/integer.h
|
|
6
6
|
// Interface to an arbitrary-length integer class
|
|
@@ -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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
2
|
// This file is part of Gambit
|
|
3
|
-
// Copyright (c) 1994-
|
|
3
|
+
// Copyright (c) 1994-2025, The Gambit Project (https://www.gambit-project.org)
|
|
4
4
|
//
|
|
5
5
|
// FILE: src/libgambit/matrix.cc
|
|
6
6
|
// Instantiation of common matrix types
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//
|
|
2
2
|
// This file is part of Gambit
|
|
3
|
-
// Copyright (c) 1994-
|
|
3
|
+
// Copyright (c) 1994-2025, The Gambit Project (https://www.gambit-project.org)
|
|
4
4
|
//
|
|
5
5
|
// FILE: src/libgambit/matrix.h
|
|
6
6
|
// Interface to a matrix class
|