@ -224,7 +224,7 @@ namespace storm {
}
}
template < typename ValueType >
template < typename ValueType >
ValueType pow ( ValueType const & value , u int_fast64_t exponent ) {
ValueType pow ( ValueType const & value , int_fast64_t exponent ) {
return std : : pow ( value , exponent ) ;
return std : : pow ( value , exponent ) ;
}
}
@ -458,13 +458,18 @@ namespace storm {
}
}
template < >
template < >
typename NumberTraits < ClnRationalNumber > : : IntegerType pow ( typename NumberTraits < ClnRationalNumber > : : IntegerType const & value , uint_fast64_t exponent ) {
typename NumberTraits < ClnRationalNumber > : : IntegerType pow ( typename NumberTraits < ClnRationalNumber > : : IntegerType const & value , int_fast64_t exponent ) {
STORM_LOG_THROW ( exponent > = 0 , storm : : exceptions : : InvalidArgumentException , " Tried to compute the power 'x^y' as an integer, but the exponent 'y' is negative. " ) ;
return carl : : pow ( value , exponent ) ;
return carl : : pow ( value , exponent ) ;
}
}
template < >
template < >
ClnRationalNumber pow ( ClnRationalNumber const & value , uint_fast64_t exponent ) {
return carl : : pow ( value , exponent ) ;
ClnRationalNumber pow ( ClnRationalNumber const & value , int_fast64_t exponent ) {
if ( exponent > = 0 ) {
return carl : : pow ( value , exponent ) ;
} else {
return storm : : utility : : one < ClnRationalNumber > ( ) / carl : : pow ( value , - exponent ) ;
}
}
}
template < >
template < >
@ -655,13 +660,18 @@ namespace storm {
}
}
template < >
template < >
typename NumberTraits < GmpRationalNumber > : : IntegerType pow ( typename NumberTraits < GmpRationalNumber > : : IntegerType const & value , uint_fast64_t exponent ) {
typename NumberTraits < GmpRationalNumber > : : IntegerType pow ( typename NumberTraits < GmpRationalNumber > : : IntegerType const & value , int_fast64_t exponent ) {
STORM_LOG_THROW ( exponent > = 0 , storm : : exceptions : : InvalidArgumentException , " Tried to compute the power 'x^y' as an integer, but the exponent 'y' is negative. " ) ;
return carl : : pow ( value , exponent ) ;
return carl : : pow ( value , exponent ) ;
}
}
template < >
template < >
GmpRationalNumber pow ( GmpRationalNumber const & value , uint_fast64_t exponent ) {
return carl : : pow ( value , exponent ) ;
GmpRationalNumber pow ( GmpRationalNumber const & value , int_fast64_t exponent ) {
if ( exponent > = 0 ) {
return carl : : pow ( value , exponent ) ;
} else {
return storm : : utility : : one < GmpRationalNumber > ( ) / carl : : pow ( value , - exponent ) ;
}
}
}
template < >
template < >
@ -776,6 +786,11 @@ namespace storm {
return carl : : toInt < carl : : uint > ( convertNumber < RationalFunctionCoefficient > ( func ) ) ;
return carl : : toInt < carl : : uint > ( convertNumber < RationalFunctionCoefficient > ( func ) ) ;
}
}
template < >
carl : : sint convertNumber ( RationalFunction const & func ) {
return carl : : toInt < carl : : sint > ( convertNumber < RationalFunctionCoefficient > ( func ) ) ;
}
template < >
template < >
double convertNumber ( RationalFunction const & func ) {
double convertNumber ( RationalFunction const & func ) {
return carl : : toDouble ( convertNumber < RationalFunctionCoefficient > ( func ) ) ;
return carl : : toDouble ( convertNumber < RationalFunctionCoefficient > ( func ) ) ;
@ -861,8 +876,12 @@ namespace storm {
}
}
template < >
template < >
RationalFunction pow ( RationalFunction const & value , uint_fast64_t exponent ) {
return carl : : pow ( value , exponent ) ;
RationalFunction pow ( RationalFunction const & value , int_fast64_t exponent ) {
if ( exponent > = 0 ) {
return carl : : pow ( value , exponent ) ;
} else {
return storm : : utility : : one < RationalFunction > ( ) / carl : : pow ( value , - exponent ) ;
}
}
}
template < >
template < >
@ -912,7 +931,7 @@ namespace storm {
template std : : pair < double , double > minmax ( std : : map < uint64_t , double > const & ) ;
template std : : pair < double , double > minmax ( std : : map < uint64_t , double > const & ) ;
template double minimum ( std : : map < uint64_t , double > const & ) ;
template double minimum ( std : : map < uint64_t , double > const & ) ;
template double maximum ( std : : map < uint64_t , double > const & ) ;
template double maximum ( std : : map < uint64_t , double > const & ) ;
template double pow ( double const & value , u int_fast64_t exponent ) ;
template double pow ( double const & value , int_fast64_t exponent ) ;
template double max ( double const & first , double const & second ) ;
template double max ( double const & first , double const & second ) ;
template double min ( double const & first , double const & second ) ;
template double min ( double const & first , double const & second ) ;
template double sqrt ( double const & number ) ;
template double sqrt ( double const & number ) ;
@ -945,7 +964,7 @@ namespace storm {
template std : : pair < float , float > minmax ( std : : map < uint64_t , float > const & ) ;
template std : : pair < float , float > minmax ( std : : map < uint64_t , float > const & ) ;
template float minimum ( std : : map < uint64_t , float > const & ) ;
template float minimum ( std : : map < uint64_t , float > const & ) ;
template float maximum ( std : : map < uint64_t , float > const & ) ;
template float maximum ( std : : map < uint64_t , float > const & ) ;
template float pow ( float const & value , u int_fast64_t exponent ) ;
template float pow ( float const & value , int_fast64_t exponent ) ;
template float max ( float const & first , float const & second ) ;
template float max ( float const & first , float const & second ) ;
template float min ( float const & first , float const & second ) ;
template float min ( float const & first , float const & second ) ;
template float sqrt ( float const & number ) ;
template float sqrt ( float const & number ) ;