Browse Source

OVI helper: fixed spacing in source code, changed two while loops to for loops

main
Tim Quatmann 5 years ago
parent
commit
fd77b71084
  1. 13
      src/storm/solver/helper/OptimisticValueIterationHelper.h

13
src/storm/solver/helper/OptimisticValueIterationHelper.h

@ -166,7 +166,7 @@ namespace storm {
// Upper bound iteration // Upper bound iteration
singleIterationCallback(upperX, auxVector, overallIterations); singleIterationCallback(upperX, auxVector, overallIterations);
// At this point,h auxVector contains the old values for the upper bound whereas upperX contains the new ones.
// At this point, auxVector contains the old values for the upper bound whereas upperX contains the new ones.
// Compare the new upper bound candidate with the old one // Compare the new upper bound candidate with the old one
bool newUpperBoundAlwaysHigherEqual = true; bool newUpperBoundAlwaysHigherEqual = true;
@ -176,30 +176,25 @@ namespace storm {
for (uint64_t i = 0; i < upperX->size() & !cancelOuterScan; ++i) { for (uint64_t i = 0; i < upperX->size() & !cancelOuterScan; ++i) {
if ((*upperX)[i] < (*auxVector)[i]) { if ((*upperX)[i] < (*auxVector)[i]) {
newUpperBoundAlwaysHigherEqual = false; newUpperBoundAlwaysHigherEqual = false;
++i;
while (i < upperX->size()) {
for (++i; i < upperX->size(); ++i) {
if ((*upperX)[i] > (*auxVector)[i]) { if ((*upperX)[i] > (*auxVector)[i]) {
newUpperBoundAlwaysLowerEqual = false; newUpperBoundAlwaysLowerEqual = false;
cancelOuterScan = true; cancelOuterScan = true;
break; break;
} }
++i;
} }
} else if ((*upperX)[i] != (*auxVector)[i]) { } else if ((*upperX)[i] != (*auxVector)[i]) {
newUpperBoundAlwaysLowerEqual = false; newUpperBoundAlwaysLowerEqual = false;
++i;
while (i < upperX->size()) {
for (++i; i < upperX->size(); ++i) {
if ((*upperX)[i] < (*auxVector)[i]) { if ((*upperX)[i] < (*auxVector)[i]) {
newUpperBoundAlwaysHigherEqual = false; newUpperBoundAlwaysHigherEqual = false;
cancelOuterScan = true; cancelOuterScan = true;
break; break;
} }
++i;
} }
} }
} }
}
else {
} else {
for (uint64_t i = 0; i < upperX->size(); ++i) { for (uint64_t i = 0; i < upperX->size(); ++i) {
if ((*upperX)[i] < (*auxVector)[i]) { if ((*upperX)[i] < (*auxVector)[i]) {
newUpperBoundAlwaysHigherEqual = false; newUpperBoundAlwaysHigherEqual = false;

Loading…
Cancel
Save