@ -89,14 +89,12 @@ namespace storm {
progress . startNewMeasurement ( 0 ) ;
for ( auto const & scc : * this - > sortedSccDecomposition ) {
if ( scc . size ( ) = = 1 ) {
// TODO: directly use localMonRes on this
returnValue = solveTrivialScc ( * scc . begin ( ) , dir , x , b ) & & returnValue ;
} else {
STORM_LOG_TRACE ( " Solving SCC of size " < < scc . size ( ) < < " . " ) ;
sccRowGroupsAsBitVector . clear ( ) ;
sccRowsAsBitVector . clear ( ) ;
for ( auto const & group : scc ) { // Group refers to state
bool allIgnored = true ;
sccRowGroupsAsBitVector . set ( group , true ) ;
if ( ! this - > choiceFixedForState | | ! this - > choiceFixedForState . get ( ) [ group ] ) {
@ -150,38 +148,12 @@ namespace storm {
ValueType & xi = globalX [ sccState ] ;
bool firstRow = true ;
uint64_t bestRow ;
if ( this - > choiceFixedForState & & this - > choiceFixedForState . get ( ) [ sccState ] ) {
assert ( this - > hasInitialScheduler ( ) ) ;
uint64_t row = this - > A - > getRowGroupIndices ( ) [ sccState ] + this - > initialScheduler . get ( ) [ sccState ] ;
ValueType rowValue = globalB [ row ] ;
bool hasDiagonalEntry = false ;
ValueType denominator ;
for ( auto const & entry : this - > A - > getRow ( row ) ) {
if ( entry . getColumn ( ) = = sccState ) {
hasDiagonalEntry = true ;
denominator = storm : : utility : : one < ValueType > ( ) - entry . getValue ( ) ;
} else {
rowValue + = entry . getValue ( ) * globalX [ entry . getColumn ( ) ] ;
}
}
if ( hasDiagonalEntry ) {
STORM_LOG_WARN_COND_DEBUG ( storm : : NumberTraits < ValueType > : : IsExact | | ! storm : : utility : : isAlmostZero ( denominator ) | |
storm : : utility : : isZero ( denominator ) , " State " < < sccState < < " has a selfloop with probability '1-( " < < denominator < < " )'. This could be an indication for numerical issues. " ) ;
assert ( ! storm : : utility : : isZero ( denominator ) ) ;
rowValue / = denominator ;
}
if ( minimize ( dir ) ) {
xi = std : : move ( rowValue ) ;
} else {
xi = std : : move ( rowValue ) ;
}
STORM_LOG_INFO ( " Ignoring state " < < sccState < < " as the choice is fixed, current probability for this state is: " < < this - > schedulerChoices . get ( ) [ sccState ] ) ;
} else {
assert ( ! this - > choiceFixedForState | | ! this - > choiceFixedForState . get ( ) [ sccState ] | | ( this - > hasInitialScheduler ( ) & & this - > A - > getRowGroupSize ( sccState ) = = 1 ) ) ;
for ( uint64_t row = this - > A - > getRowGroupIndices ( ) [ sccState ] ; row < this - > A - > getRowGroupIndices ( ) [ sccState + 1 ] ; + + row ) {
ValueType rowValue = globalB [ row ] ;
bool hasDiagonalEntry = false ;
ValueType denominator ;
for ( auto const & entry : this - > A - > getRow ( row ) ) {
for ( auto const & entry : this - > A - > getRow ( row ) ) {
if ( entry . getColumn ( ) = = sccState ) {
hasDiagonalEntry = true ;
denominator = storm : : utility : : one < ValueType > ( ) - entry . getValue ( ) ;
@ -191,8 +163,7 @@ namespace storm {
}
if ( hasDiagonalEntry ) {
STORM_LOG_WARN_COND_DEBUG (
storm : : NumberTraits < ValueType > : : IsExact | | ! storm : : utility : : isAlmostZero ( denominator ) | |
storm : : utility : : isZero ( denominator ) ,
storm : : NumberTraits < ValueType > : : IsExact | | ! storm : : utility : : isAlmostZero ( denominator ) | | storm : : utility : : isZero ( denominator ) ,
" State " < < sccState < < " has a selfloop with probability '1-( " < < denominator
< < " )'. This could be an indication for numerical issues. " ) ;
if ( storm : : utility : : isZero ( denominator ) ) {
@ -226,8 +197,6 @@ namespace storm {
this - > schedulerChoices . get ( ) [ sccState ] = bestRow - this - > A - > getRowGroupIndices ( ) [ sccState ] ;
}
STORM_LOG_THROW ( ! firstRow , storm : : exceptions : : UnexpectedException , " Empty row group in MinMax equation system. " ) ;
}
//std::cout << "Solved trivial scc " << sccState << " with result " << globalX[sccState] << std::endl;
return true ;
}
@ -301,8 +270,6 @@ namespace storm {
}
// std::cout << "Matrix is " << sccA << std::endl;
this - > sccSolver - > setMatrix ( std : : move ( sccA ) ) ;
// x Vector