Skip to content

Commit d191e25

Browse files
committed
More sign comparisons.
1 parent 6b08c93 commit d191e25

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/games/behavmixed.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ void MixedBehaviorProfile<T>::RealizationProbs(const MixedStrategyProfile<T> &mp
9494
{
9595
T prob;
9696

97-
for (int i = 1; i <= node->m_children.size(); i++) {
97+
for (size_t i = 1; i <= node->m_children.size(); i++) {
9898
if (node->GetPlayer() && !node->GetPlayer()->IsChance()) {
9999
if (node->GetPlayer() == player) {
100100
if (actions[node->GetInfoset()->GetNumber()] == i) {

src/games/gametree.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,9 +600,9 @@ GameInfoset GameTreeNodeRep::AppendMove(GameInfoset p_infoset)
600600
m_efg->IncrementVersion();
601601
m_infoset = dynamic_cast<GameTreeInfosetRep *>(p_infoset.operator->());
602602
m_infoset->AddMember(this);
603-
for (const auto &_ : m_infoset->m_actions) {
604-
m_children.push_back(new GameTreeNodeRep(m_efg, this));
605-
}
603+
std::for_each(
604+
m_infoset->m_actions.begin(), m_infoset->m_actions.end(),
605+
[this](const GameActionRep *) { m_children.push_back(new GameTreeNodeRep(m_efg, this)); });
606606
m_efg->ClearComputedValues();
607607
m_efg->Canonicalize();
608608
return m_infoset;

src/solvers/linalg/lpsolve.imp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ LPSolve<T>::LPSolve(const Matrix<T> &A, const Vector<T> &b, const Vector<T> &c,
9494
tab.SetCost(cost);
9595

9696
// set xx to be initial feasible solution to phase II
97-
for (int i = 1; i <= xx.size(); i++) {
97+
for (size_t i = 1; i <= xx.size(); i++) {
9898
if (LB[i]) {
9999
xx[i] = lb[i];
100100
}
@@ -106,7 +106,7 @@ LPSolve<T>::LPSolve(const Matrix<T> &A, const Vector<T> &b, const Vector<T> &c,
106106
}
107107
}
108108
tab.BasisVector(x);
109-
for (int i = 1; i <= x.size(); i++) {
109+
for (size_t i = 1; i <= x.size(); i++) {
110110
xlab = tab.Label(i);
111111
if (xlab < 0) {
112112
xlab = nvars - xlab;
@@ -179,7 +179,7 @@ template <class T> void LPSolve<T>::Solve(int phase)
179179
outlab = tab.Label(out);
180180
}
181181
// update xx
182-
for (int i = 1; i <= x.size(); i++) {
182+
for (size_t i = 1; i <= x.size(); i++) {
183183
xlab = tab.Label(i);
184184
if (xlab < 0) {
185185
xlab = nvars - xlab;

src/solvers/linalg/lptab.imp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ template <> void LPTableau<double>::SetCost(const Vector<double> &c)
7878
if (c.first_index() != cost.first_index()) {
7979
throw DimensionException();
8080
}
81-
if (c.last_index() != (cost.last_index() + unitcost.size())) {
81+
if (c.last_index() != static_cast<int>(cost.last_index() + unitcost.size())) {
8282
throw DimensionException();
8383
}
8484
for (int i = c.first_index(); i <= cost.last_index(); i++) {

0 commit comments

Comments
 (0)