Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/core/function.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ void FunctionOnSimplices::Project(Vector<double> &x, const Array<size_t> &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<double>(lengths[part]);
index -= lengths[part];
for (j = 1; j <= lengths[part]; j++, index++) {
x[index] -= avg;
Expand Down
4 changes: 2 additions & 2 deletions src/core/matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ template <class T> 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(); }
Expand Down
2 changes: 1 addition & 1 deletion src/games/gamebagg.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ template <class T> T BAGGMixedStrategyProfileRep<T>::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);
Expand Down
2 changes: 1 addition & 1 deletion src/solvers/nashsupport/nfgsupport.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
16 changes: 10 additions & 6 deletions src/solvers/simpdiv/simpdiv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,16 @@ Rational NashSimpdivStrategySolver::Simplex(MixedStrategyProfile<Rational> &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
// step0:
TT = 0;
U = 0;
ab = Rational(0);
for (j = 1; j <= static_cast<int>(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)) {
Expand Down Expand Up @@ -149,7 +150,8 @@ Rational NashSimpdivStrategySolver::Simplex(MixedStrategyProfile<Rational> &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<int>(j) || labels(i, 2) != static_cast<int>(h) ||
i == state.ibar) {
i++;
}
goto step3;
Expand All @@ -168,7 +170,8 @@ Rational NashSimpdivStrategySolver::Simplex(MixedStrategyProfile<Rational> &y,
}
else {
i = 1;
while ((pi(i, 1) != j || pi(i, 2) != k) && i <= state.t) {
while ((pi(i, 1) != static_cast<int>(j) || pi(i, 2) != static_cast<int>(k)) &&
i <= state.t) {
i++;
}
}
Expand Down Expand Up @@ -293,7 +296,7 @@ Rational NashSimpdivStrategySolver::Simplex(MixedStrategyProfile<Rational> &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<int>(j) || labels(ii, 2) != static_cast<int>(h)) {
ii++;
}
i = ii;
Expand Down Expand Up @@ -339,7 +342,8 @@ void NashSimpdivStrategySolver::update(State &state, RectArray<int> &pi, RectArr
SegmentedVector<Rational> &ab,
const SegmentedVector<int> &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);
Expand Down
Loading