Browse Source

fixed SOR and gaussseidel linear equation solver methods

tempestpy_adaptions
TimQu 7 years ago
parent
commit
6fa4e6b455
  1. 6
      src/storm/storage/SparseMatrix.cpp

6
src/storm/storage/SparseMatrix.cpp

@ -1493,8 +1493,9 @@ namespace storm {
typename std::vector<ValueType>::iterator resultIterator = x.end() - 1; typename std::vector<ValueType>::iterator resultIterator = x.end() - 1;
typename std::vector<ValueType>::iterator resultIteratorEnd = x.begin() - 1; typename std::vector<ValueType>::iterator resultIteratorEnd = x.begin() - 1;
index_type currentRow = 0;
index_type currentRow = getRowCount();
for (; resultIterator != resultIteratorEnd; --rowIterator, --resultIterator, --bIt) { for (; resultIterator != resultIteratorEnd; --rowIterator, --resultIterator, --bIt) {
--currentRow;
ValueType tmpValue = storm::utility::zero<ValueType>(); ValueType tmpValue = storm::utility::zero<ValueType>();
ValueType diagonalElement = storm::utility::zero<ValueType>(); ValueType diagonalElement = storm::utility::zero<ValueType>();
@ -1505,9 +1506,8 @@ namespace storm {
diagonalElement += it->getValue(); diagonalElement += it->getValue();
} }
} }
assert(!storm::utility::isZero(diagonalElement));
*resultIterator = ((storm::utility::one<ValueType>() - omega) * *resultIterator) + (omega / diagonalElement) * (*bIt - tmpValue); *resultIterator = ((storm::utility::one<ValueType>() - omega) * *resultIterator) + (omega / diagonalElement) * (*bIt - tmpValue);
++currentRow;
} }
} }

Loading…
Cancel
Save