Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support conversion in function parametric::evaluate #651

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

volkm
Copy link
Contributor

@volkm volkm commented Jan 8, 2025

Added automatic conversion to the desired return type in parametric::evaluate. This allows to replace the common construct

storm::utility::convertNumber<ConstantType>(storm::utility::parametric::evaluate(function, valuation));

by the simpler version

storm::utility::parametric::evaluate<ConstantType>(function, valuation);

If the types are equal, then of course no conversion is performed.

Drawback is that the include constants.h is now moved to the header file parametric.h but I think this is acceptable.

Copy link
Member

@tquatmann tquatmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this, but if we really want to avoid the additional header inclusion of constants.h in parametric.h, we could use explicit template instantiations in the cpp file (for double, cln rationals, and gmp rationals).

Apart from that: LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants