From d76d34e3f95a63d86eb4ca112bb567d0170714b7 Mon Sep 17 00:00:00 2001 From: dehnert Date: Tue, 10 Jan 2017 22:32:19 +0100 Subject: [PATCH] optimized ADD::toMatrix to avoid a duplicate operation --- src/storm/storage/dd/Add.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/storm/storage/dd/Add.cpp b/src/storm/storage/dd/Add.cpp index 2e72e8329..93039e480 100644 --- a/src/storm/storage/dd/Add.cpp +++ b/src/storm/storage/dd/Add.cpp @@ -453,12 +453,9 @@ namespace storm { ++i; } - // Use the toMatrix function to compute the number of elements in each row. Using the flag, we prevent - // it from actually generating the entries in the entry vector. - internalAdd.toMatrixComponents(trivialRowGroupIndices, rowIndications, columnsAndValues, rowOdd, columnOdd, ddRowVariableIndices, ddColumnVariableIndices, false); - - // TODO: counting might be faster by just summing over the primed variables and then using the ODD to convert - // the resulting (DD) vector to an explicit vector. + // Count the number of elements in the rows. + rowIndications = this->notZero().template toAdd().sumAbstract(columnMetaVariables).toVector(rowOdd); + rowIndications.emplace_back(); // Now that we computed the number of entries in each row, compute the corresponding offsets in the entry vector. uint_fast64_t tmp = 0;