@ -424,7 +424,6 @@ namespace storm {
rowGroupIndices = other . rowGroupIndices ;
trivialRowGrouping = other . trivialRowGrouping ;
}
return * this ;
}
@ -442,7 +441,6 @@ namespace storm {
rowGroupIndices = std : : move ( other . rowGroupIndices ) ;
trivialRowGrouping = other . trivialRowGrouping ;
}
return * this ;
}
@ -1293,20 +1291,20 @@ namespace storm {
}
template < typename ValueType >
void SparseMatrix < ValueType > : : multiplyWithVector ( std : : vector < ValueType > const & vector , std : : vector < ValueType > & result ) const {
void SparseMatrix < ValueType > : : multiplyWithVector ( std : : vector < ValueType > const & vector , std : : vector < ValueType > & result , std : : vector < value_type > const * summand ) const {
# ifdef STORM_HAVE_INTELTBB
if ( this - > getNonzeroEntryCount ( ) > 10000 ) {
return this - > multiplyWithVectorParallel ( vector , result ) ;
return this - > multiplyWithVectorParallel ( vector , result , summand ) ;
} else {
return this - > multiplyWithVectorSequential ( vector , result ) ;
return this - > multiplyWithVectorSequential ( vector , result , summand ) ;
}
# else
return multiplyWithVectorSequential ( vector , result ) ;
return multiplyWithVectorSequential ( vector , result , summand ) ;
# endif
}
template < typename ValueType >
void SparseMatrix < ValueType > : : multiplyWithVectorSequential ( std : : vector < ValueType > const & vector , std : : vector < ValueType > & result ) const {
void SparseMatrix < ValueType > : : multiplyWithVectorSequential ( std : : vector < ValueType > const & vector , std : : vector < ValueType > & result , std : : vector < value_type > const * summand ) const {
if ( & vector = = & result ) {
STORM_LOG_WARN ( " Matrix-vector-multiplication invoked but the target vector uses the same memory as the input vector. This requires to allocate auxiliary memory. " ) ;
std : : vector < ValueType > tmpVector ( this - > getRowCount ( ) ) ;
@ -1318,9 +1316,18 @@ namespace storm {
std : : vector < index_type > : : const_iterator rowIterator = rowIndications . begin ( ) ;
typename std : : vector < ValueType > : : iterator resultIterator = result . begin ( ) ;
typename std : : vector < ValueType > : : iterator resultIteratorEnd = result . end ( ) ;
typename std : : vector < ValueType > : : const_iterator summandIterator ;
if ( summand ) {
summandIterator = summand - > begin ( ) ;
}
for ( ; resultIterator ! = resultIteratorEnd ; + + rowIterator , + + resultIterator ) {
* resultIterator = storm : : utility : : zero < ValueType > ( ) ;
if ( summand ) {
* resultIterator = * summandIterator ;
+ + summandIterator ;
} else {
* resultIterator = storm : : utility : : zero < ValueType > ( ) ;
}
for ( ite = this - > begin ( ) + * ( rowIterator + 1 ) ; it ! = ite ; + + it ) {
* resultIterator + = it - > getValue ( ) * vector [ it - > getColumn ( ) ] ;
@ -1331,7 +1338,7 @@ namespace storm {
# ifdef STORM_HAVE_INTELTBB
template < typename ValueType >
void SparseMatrix < ValueType > : : multiplyWithVectorParallel ( std : : vector < ValueType > const & vector , std : : vector < ValueType > & result ) const {
void SparseMatrix < ValueType > : : multiplyWithVectorParallel ( std : : vector < ValueType > const & vector , std : : vector < ValueType > & result , std : : vector < value_type > const * summand ) const {
if ( & vector = = & result ) {
STORM_LOG_WARN ( " Matrix-vector-multiplication invoked but the target vector uses the same memory as the input vector. This requires to allocate auxiliary memory. " ) ;
std : : vector < ValueType > tmpVector ( this - > getRowCount ( ) ) ;
@ -1348,9 +1355,18 @@ namespace storm {
std : : vector < index_type > : : const_iterator rowIteratorEnd = this - > rowIndications . begin ( ) + endRow ;
typename std : : vector < ValueType > : : iterator resultIterator = result . begin ( ) + startRow ;
typename std : : vector < ValueType > : : iterator resultIteratorEnd = result . begin ( ) + endRow ;
typename std : : vector < ValueType > : : const_iterator summandIterator ;
if ( summand ) {
summandIterator = summand - > begin ( ) + startRow ;
}
for ( ; resultIterator ! = resultIteratorEnd ; + + rowIterator , + + resultIterator ) {
* resultIterator = storm : : utility : : zero < ValueType > ( ) ;
if ( summand ) {
* resultIterator = * summandIterator ;
+ + summandIterator ;
} else {
* resultIterator = storm : : utility : : zero < ValueType > ( ) ;
}
for ( ite = this - > begin ( ) + * ( rowIterator + 1 ) ; it ! = ite ; + + it ) {
* resultIterator + = it - > getValue ( ) * vector [ it - > getColumn ( ) ] ;