Browse Source

Performance improvement for our matrix multiplication.

tempestpy_adaptions
dehnert 12 years ago
parent
commit
64a27bb871
  1. 6
      src/storage/SparseMatrix.h

6
src/storage/SparseMatrix.h

@ -961,12 +961,12 @@ public:
// product of the corresponding row with the input vector.
// Note that only the end iterator has to be moved by one row, because the other iterator
// is automatically moved forward one row by the inner loop.
for (uint_fast64_t i = 0; i < result.size(); ++i, elementIte.moveToNextRow()) {
result[i] = storm::utility::constGetZero<T>();
for (auto it = result.begin(), ite = result.end(); it != ite; ++it, elementIte.moveToNextRow()) {
*it = storm::utility::constGetZero<T>();
// Perform the scalar product.
for (; elementIt != elementIte; ++elementIt) {
result[i] += elementIt.value() * vector[elementIt.column()];
*it += elementIt.value() * vector[elementIt.column()];
}
}
}

Loading…
Cancel
Save