9template<
typename ValueType>
11 : forwardTransitionMatrixRef(forwardTransitionMatrix),
17template<
typename ValueType>
20 : forwardTransitionMatrixRef(forwardTransitionMatrix),
22 backwardTransitions(
std::make_shared<
std::optional<
SparseMatrix<ValueType>>>(
std::move(backwardTransitionMatrix))) {
26template<
typename ValueType>
28 STORM_LOG_ASSERT(this->backwardTransitions !=
nullptr,
"Backward transitions should never be nullptr");
30 this->backwardTransitions->emplace(forwardTransitionMatrixRef.transpose(
true, keepZeros));
32 return **this->backwardTransitions;
35template<
typename ValueType>
37 STORM_LOG_ASSERT(this->backwardTransitions !=
nullptr,
"Backward transitions should never be nullptr");
38 this->backwardTransitions->reset();
41template<
typename ValueType>
43 STORM_LOG_ASSERT(this->backwardTransitions !=
nullptr,
"Backward transitions should never be nullptr");
44 return this->backwardTransitions->has_value();
This class caches the backward transitions of a given forward transition matrix.
bool isCached() const
Retrieves whether the backward transitions are currently cached.
BackwardTransitionCache()=delete
void clearCache() const
Clears the cache (for this and all copies of this cache).
SparseMatrix< ValueType > const & get() const
Retrieves the backward transitions.
A class that holds a possibly non-square matrix in the compressed row storage format.
#define STORM_LOG_ASSERT(cond, message)