@ -39,6 +39,23 @@ namespace storm {
bool isConstant ( ValueType const & a ) {
return true ;
}
template < typename ValueType >
bool isInteger ( ValueType const & number ) {
ValueType iPart ;
ValueType result = std : : modf ( number , & iPart ) ;
return result = zero < ValueType > ( ) ;
}
template < >
bool isInteger ( int const & number ) {
return true ;
}
template < >
bool isInteger ( uint_fast64_t const & number ) {
return true ;
}
# ifdef STORM_HAVE_CARL
template < >
@ -50,7 +67,6 @@ namespace storm {
bool isZero ( storm : : RationalNumber const & a ) {
return carl : : isZero ( a ) ;
}
template < >
bool isOne ( storm : : RationalFunction const & a ) {
@ -93,6 +109,12 @@ namespace storm {
// FIXME: this should be treated more properly.
return storm : : RationalNumber ( - 1 ) ;
}
template < >
bool isInteger ( storm : : RationalNumber const & number ) {
return carl : : isInteger ( number ) ;
}
# endif
template < typename ValueType >
@ -102,9 +124,9 @@ namespace storm {
template < typename ValueType >
ValueType simplify ( ValueType value ) {
// In the general case, we don't do anything here, but merely return the value. If something else is
// supposed to happen here, the templated function can be specialized for this particular type.
return value ;
// In the general case, we don't do anything here, but merely return the value. If something else is
// supposed to happen here, the templated function can be specialized for this particular type.
return value ;
}
template < >
@ -151,7 +173,12 @@ namespace storm {
double convertNumber ( RationalNumber const & number ) {
return carl : : toDouble ( number ) ;
}
template < >
uint_fast64_t convertNumber ( RationalNumber const & number ) {
return carl : : toInt < unsigned long > ( number ) ;
}
template < >
RationalNumber convertNumber ( double const & number ) {
return carl : : rationalize < RationalNumber > ( number ) ;
@ -167,15 +194,26 @@ namespace storm {
return RationalFunction ( carl : : rationalize < RationalNumber > ( number ) ) ;
}
template < >
RationalNumber convertNumber ( std : : string const & number ) {
return carl : : rationalize < RationalNumber > ( number ) ;
}
template < >
RationalFunction convertNumber ( RationalNumber const & number ) {
return RationalFunction ( number ) ;
}
template < >
storm : : RationalNumber abs ( storm : : RationalNumber const & number ) {
RationalNumber abs ( storm : : RationalNumber const & number ) {
return carl : : abs ( number ) ;
}
template < >
RationalNumber pow ( RationalNumber const & value , uint_fast64_t exponent ) {
return carl : : pow ( value , exponent ) ;
}
# endif
template < typename IndexType , typename ValueType >
@ -214,6 +252,7 @@ namespace storm {
template storm : : storage : : MatrixEntry < storm : : storage : : sparse : : state_type , double > & & simplify ( storm : : storage : : MatrixEntry < storm : : storage : : sparse : : state_type , double > & & matrixEntry ) ;
template double abs ( double const & number ) ;
template bool isInteger ( double const & number ) ;
template bool isOne ( float const & value ) ;
template bool isZero ( float const & value ) ;
@ -224,6 +263,7 @@ namespace storm {
template float infinity ( ) ;
template float pow ( float const & value , uint_fast64_t exponent ) ;
template bool isInteger ( float const & number ) ;
template float simplify ( float value ) ;
@ -240,7 +280,8 @@ namespace storm {
template int infinity ( ) ;
template int pow ( int const & value , uint_fast64_t exponent ) ;
template bool isInteger ( int const & number ) ;
template int simplify ( int value ) ;
template storm : : storage : : MatrixEntry < storm : : storage : : sparse : : state_type , int > simplify ( storm : : storage : : MatrixEntry < storm : : storage : : sparse : : state_type , int > matrixEntry ) ;
@ -278,12 +319,14 @@ namespace storm {
template storm : : RationalNumber infinity ( ) ;
template double convertNumber ( storm : : RationalNumber const & number ) ;
template uint_fast64_t convertNumber ( storm : : RationalNumber const & number ) ;
template storm : : RationalNumber convertNumber ( double const & number ) ;
template storm : : RationalNumber convertNumber ( storm : : RationalNumber const & number ) ;
RationalNumber convertNumber ( std : : string const & number ) ;
template storm : : RationalNumber abs ( storm : : RationalNumber const & number ) ;
// template storm::RationalNumber pow(storm::RationalNumber const& value, uint_fast64_t exponent);
template storm : : RationalNumber pow ( storm : : RationalNumber const & value , uint_fast64_t exponent ) ;
template storm : : RationalNumber simplify ( storm : : RationalNumber value ) ;
template storm : : storage : : MatrixEntry < storm : : storage : : sparse : : state_type , storm : : RationalNumber > simplify ( storm : : storage : : MatrixEntry < storm : : storage : : sparse : : state_type , storm : : RationalNumber > matrixEntry ) ;