From 0e0c20e34a42f7e70589c27d31a6fa9bab9f06a2 Mon Sep 17 00:00:00 2001 From: Theodore Turocy Date: Mon, 23 Mar 2026 11:14:57 +0000 Subject: [PATCH 1/4] Tidy signs in simpdiv --- src/core/matrix.h | 4 ++-- src/solvers/simpdiv/simpdiv.cc | 16 ++++++++++------ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/core/matrix.h b/src/core/matrix.h index c07af4f80..8ff58c777 100644 --- a/src/core/matrix.h +++ b/src/core/matrix.h @@ -86,9 +86,9 @@ template class Matrix { /// @brief Highest valid column index int MaxCol() const { return m_data.MaxCol(); } /// @brief Number of rows in the matrix - int NumRows() const { return m_data.NumRows(); } + size_t NumRows() const { return m_data.NumRows(); } /// @brief Number of columns in the matrix - int NumColumns() const { return m_data.NumColumns(); } + size_t NumColumns() const { return m_data.NumColumns(); } /// @brief Check if the matrix is a square matrix (num rows == num columns) bool IsSquare() const { return MinRow() == MinCol() && MaxRow() == MaxCol(); } diff --git a/src/solvers/simpdiv/simpdiv.cc b/src/solvers/simpdiv/simpdiv.cc index 135898254..b9fc15f27 100644 --- a/src/solvers/simpdiv/simpdiv.cc +++ b/src/solvers/simpdiv/simpdiv.cc @@ -105,7 +105,8 @@ Rational NashSimpdivStrategySolver::Simplex(MixedStrategyProfile &y, v.SetFlattened(y.GetProbVector()); besty.SetFlattened(y.GetProbVector()); int i = 0; - int j, k, h, jj, hh, ii, kk, tot; + int jj, ii; + size_t j, h, hh, tot, k, kk; Rational maxz; // Label step0 not currently used, hence commented @@ -113,7 +114,7 @@ Rational NashSimpdivStrategySolver::Simplex(MixedStrategyProfile &y, TT = 0; U = 0; ab = Rational(0); - for (j = 1; j <= static_cast(game->NumPlayers()); j++) { + for (j = 1; j <= game->NumPlayers(); j++) { const GamePlayer player = game->GetPlayer(j); for (h = 1; h <= nstrats[j]; h++) { if (v.segment(j)[h] == Rational(0)) { @@ -149,7 +150,8 @@ Rational NashSimpdivStrategySolver::Simplex(MixedStrategyProfile &y, /* case1b */ else if (TT.segment(j)[h]) { i = 1; - while (labels(i, 1) != j || labels(i, 2) != h || i == state.ibar) { + while (labels(i, 1) != static_cast(j) || labels(i, 2) != static_cast(h) || + i == state.ibar) { i++; } goto step3; @@ -168,7 +170,8 @@ Rational NashSimpdivStrategySolver::Simplex(MixedStrategyProfile &y, } else { i = 1; - while ((pi(i, 1) != j || pi(i, 2) != k) && i <= state.t) { + while ((pi(i, 1) != static_cast(j) || pi(i, 2) != static_cast(k)) && + i <= state.t) { i++; } } @@ -293,7 +296,7 @@ Rational NashSimpdivStrategySolver::Simplex(MixedStrategyProfile &y, pi.RotateUp(i - 1, state.t); state.t--; ii = 1; - while (labels(ii, 1) != j || labels(ii, 2) != h) { + while (labels(ii, 1) != static_cast(j) || labels(ii, 2) != static_cast(h)) { ii++; } i = ii; @@ -339,7 +342,8 @@ void NashSimpdivStrategySolver::update(State &state, RectArray &pi, RectArr SegmentedVector &ab, const SegmentedVector &U, int j, int i) { - int jj, hh, k, f = 1; + int jj, f = 1; + size_t k, hh; if (i >= 2 && i <= state.t) { pi.SwitchRows(i, i - 1); From 86638be19964deb7a66fc3681f9f8e0caba3f1b9 Mon Sep 17 00:00:00 2001 From: Theodore Turocy Date: Mon, 23 Mar 2026 12:09:22 +0000 Subject: [PATCH 2/4] Tidy signs in nfgsupport --- src/solvers/nashsupport/nfgsupport.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solvers/nashsupport/nfgsupport.cc b/src/solvers/nashsupport/nfgsupport.cc index 4f8955f38..8f1c1d63b 100644 --- a/src/solvers/nashsupport/nfgsupport.cc +++ b/src/solvers/nashsupport/nfgsupport.cc @@ -201,7 +201,7 @@ void GenerateSupportProfiles(const Game &game, /// Solve over supports with a total number of strategies `size` and a maximum difference /// in player support size of `diff`. -void GenerateSizeDiff(const Game &game, int size, int diff, CallbackFunction callback) +void GenerateSizeDiff(const Game &game, int size, size_t diff, CallbackFunction callback) { auto players = game->GetPlayers(); CartesianRange range(game->GetStrategies().shape_array()); From 2ac8ea160e2b1987c356ad0676bfa68d8ecd04a9 Mon Sep 17 00:00:00 2001 From: Theodore Turocy Date: Mon, 23 Mar 2026 12:15:37 +0000 Subject: [PATCH 3/4] Tidy signs --- src/core/function.cc | 4 ++-- src/games/gamebagg.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/function.cc b/src/core/function.cc index 0df3b2cab..60fb0fefe 100644 --- a/src/core/function.cc +++ b/src/core/function.cc @@ -48,11 +48,11 @@ void FunctionOnSimplices::Project(Vector &x, const Array &length int index = 1; for (size_t part = 1; part <= lengths.size(); part++) { double avg = 0.0; - int j; + size_t j; for (j = 1; j <= lengths[part]; j++, index++) { avg += x[index]; } - avg /= (double)lengths[part]; + avg /= static_cast(lengths[part]); index -= lengths[part]; for (j = 1; j <= lengths[part]; j++, index++) { x[index] -= avg; diff --git a/src/games/gamebagg.cc b/src/games/gamebagg.cc index fcc669357..dee69915a 100644 --- a/src/games/gamebagg.cc +++ b/src/games/gamebagg.cc @@ -108,7 +108,7 @@ template T BAGGMixedStrategyProfileRep::GetPayoff(int pl) const bplayer = i; btype = tp; } - for (int j = 0; j < ns[g.baggPtr->typeOffset[i] + tp]; ++j, ++offs) { + for (size_t j = 0; j < ns[g.baggPtr->typeOffset[i] + tp]; ++j, ++offs) { const GameStrategy strategy = this->m_support.GetGame() ->GetPlayer(g.baggPtr->typeOffset[i] + tp + 1) ->GetStrategy(j + 1); From 70410663accd6fa5625188b842c96d9c2d272aab Mon Sep 17 00:00:00 2001 From: Theodore Turocy Date: Mon, 23 Mar 2026 12:17:14 +0000 Subject: [PATCH 4/4] Remove unneeded paths from MANIFEST --- MANIFEST.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 69fed7e1d..142e32010 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,6 @@ -recursive-include src/core *.cc *.h *.imp +recursive-include src/core *.cc *.h recursive-include src/games *.cc *.h *.imp -recursive-include src/solvers *.c *.cc *.h *.imp +recursive-include src/solvers *.cc *.h *.imp recursive-include catalog * include src/gambit.h include src/pygambit/*.pxd