|
|
@ -49,7 +49,7 @@ public: |
|
|
|
mrmc::storage::SquareSparseMatrix<Type> tmpMatrix(*this->getModel().getTransitionProbabilityMatrix()); |
|
|
|
|
|
|
|
// Make all rows absorbing that violate both sub-formulas or satisfy the second sub-formula. |
|
|
|
tmpMatrix.makeRowsAbsorbing(~(*leftStates & *rightStates) | *rightStates); |
|
|
|
tmpMatrix.makeRowsAbsorbing(~(*leftStates | *rightStates) | *rightStates); |
|
|
|
|
|
|
|
// Transform the transition probability matrix to the gmm++ format to use its arithmetic. |
|
|
|
gmm::csr_matrix<Type>* gmmxxMatrix = tmpMatrix.toGMMXXSparseMatrix(); |
|
|
@ -59,9 +59,15 @@ public: |
|
|
|
mrmc::utility::setVectorValues(result, *rightStates, static_cast<Type>(1.0)); |
|
|
|
|
|
|
|
// Now perform matrix-vector multiplication as long as we meet the bound of the formula. |
|
|
|
std::vector<Type>* swap = nullptr; |
|
|
|
std::vector<Type>* tmpResult = new std::vector<Type>(this->getModel().getNumberOfStates()); |
|
|
|
for (uint_fast64_t i = 0; i < formula.getBound(); ++i) { |
|
|
|
gmm::mult(*gmmxxMatrix, *result, *result); |
|
|
|
gmm::mult(*gmmxxMatrix, *result, *tmpResult); |
|
|
|
swap = tmpResult; |
|
|
|
tmpResult = result; |
|
|
|
result = swap; |
|
|
|
} |
|
|
|
delete tmpResult; |
|
|
|
|
|
|
|
// Delete intermediate results and return result. |
|
|
|
delete leftStates; |
|
|
|