Storm 2.0.0.3
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::storage::BackwardTransitionCache< ValueType > Class Template Reference

This class caches the backward transitions of a given forward transition matrix. More...

#include <BackwardTransitionCache.h>

Public Member Functions

 BackwardTransitionCache (SparseMatrix< ValueType > const &forwardTransitionMatrix, bool keepZeros=false)
 BackwardTransitionCache (SparseMatrix< ValueType > const &forwardTransitionMatrix, SparseMatrix< ValueType > &&backwardTransitionMatrix, bool keepZeros=false)
 BackwardTransitionCache ()=delete
 BackwardTransitionCache (BackwardTransitionCache const &)=default
 BackwardTransitionCache (BackwardTransitionCache &&)=default
BackwardTransitionCache & operator= (BackwardTransitionCache const &)=delete
BackwardTransitionCache & operator= (BackwardTransitionCache &&)=delete
SparseMatrix< ValueType > const & get () const
 Retrieves the backward transitions.
void clearCache () const
 Clears the cache (for this and all copies of this cache).
bool isCached () const
 Retrieves whether the backward transitions are currently cached.

Detailed Description

template<typename ValueType>
class storm::storage::BackwardTransitionCache< ValueType >

This class caches the backward transitions of a given forward transition matrix.

The backward transitions are computed (using SparseMatrix::transpose) the first time they are requested. They have a trivial row grouping, i.e., there is one row for each state. By default, forward transitions with value zero are dropped, i.e., the backward transitions only contain entries for non-zero forward transitions (see parameter keepZeros of the constructors). The forward transition matrix reference needs to remain valid throughout the lifetime of this cache. The cache can be copied and moved (but not assigned), and the actual backward transitions are shared. This means that if the matrix is computed (or cleared) in one of the copies, this is also the case for all other copies.

Template Parameters
ValueType

Definition at line 22 of file BackwardTransitionCache.h.

Constructor & Destructor Documentation

◆ BackwardTransitionCache() [1/5]

template<typename ValueType>
storm::storage::BackwardTransitionCache< ValueType >::BackwardTransitionCache ( SparseMatrix< ValueType > const & forwardTransitionMatrix,
bool keepZeros = false )
explicit
Parameters
forwardTransitionMatrixthe forward transitions
keepZerosif true, zero entries of the forward transition matrix are also contained in the backward transitions. Otherwise, they are dropped.

Definition at line 10 of file BackwardTransitionCache.cpp.

◆ BackwardTransitionCache() [2/5]

template<typename ValueType>
storm::storage::BackwardTransitionCache< ValueType >::BackwardTransitionCache ( SparseMatrix< ValueType > const & forwardTransitionMatrix,
SparseMatrix< ValueType > && backwardTransitionMatrix,
bool keepZeros = false )
explicit
Parameters
forwardTransitionMatrixthe forward transitions
backwardTransitionMatrixthe (already computed) backward transitions
keepZerosif true, zero entries are kept when the backward transitions have to be recomputed (after clearing the cache).

Definition at line 18 of file BackwardTransitionCache.cpp.

◆ BackwardTransitionCache() [3/5]

template<typename ValueType>
storm::storage::BackwardTransitionCache< ValueType >::BackwardTransitionCache ( )
delete

◆ BackwardTransitionCache() [4/5]

template<typename ValueType>
storm::storage::BackwardTransitionCache< ValueType >::BackwardTransitionCache ( BackwardTransitionCache< ValueType > const & )
default

◆ BackwardTransitionCache() [5/5]

template<typename ValueType>
storm::storage::BackwardTransitionCache< ValueType >::BackwardTransitionCache ( BackwardTransitionCache< ValueType > && )
default

Member Function Documentation

◆ clearCache()

template<typename ValueType>
void storm::storage::BackwardTransitionCache< ValueType >::clearCache ( ) const

Clears the cache (for this and all copies of this cache).

Definition at line 36 of file BackwardTransitionCache.cpp.

◆ get()

template<typename ValueType>
SparseMatrix< ValueType > const & storm::storage::BackwardTransitionCache< ValueType >::get ( ) const

Retrieves the backward transitions.

They are computed if they are not cached yet.

Definition at line 27 of file BackwardTransitionCache.cpp.

◆ isCached()

template<typename ValueType>
bool storm::storage::BackwardTransitionCache< ValueType >::isCached ( ) const

Retrieves whether the backward transitions are currently cached.

Definition at line 42 of file BackwardTransitionCache.cpp.

◆ operator=() [1/2]

template<typename ValueType>
BackwardTransitionCache & storm::storage::BackwardTransitionCache< ValueType >::operator= ( BackwardTransitionCache< ValueType > && )
delete

◆ operator=() [2/2]

template<typename ValueType>
BackwardTransitionCache & storm::storage::BackwardTransitionCache< ValueType >::operator= ( BackwardTransitionCache< ValueType > const & )
delete

The documentation for this class was generated from the following files: