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

basic arithmetic conversion #414

Open
igoryanovich opened this issue Dec 3, 2023 · 0 comments
Open

basic arithmetic conversion #414

igoryanovich opened this issue Dec 3, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@igoryanovich
Copy link

Currently, there seems to be no available documentation on type conversion within Rev. Of course, most of the time this is just fine. But I've just spent a few hours trying to sort out a problem, which ultimately arose because (1-b) with b a Probability, resulted in Real rather than RealPos, and this ultimately led to the fn rate matrix function to reject the input matrix with rates. I've found a work-around by converting the result explicitly using Probability(), but this was not overtly documented, as far as I could see.
(I have not managed to infer this information from studying the C++ source; granted, I am not very experienced with the overall code. But luckily for me, a reference to Probability() is present in here...)

I can see several things that it'd be nice to have:
(1) perhaps check if automatic conversion by subtraction can go for the most restricted type possible, as is already the behavior with many other operations?
(2) perhaps add more explicit conversion operators in Rev, specifically RealPos() with the analogous behavior to Probability()?
(3) add info about Probability() into the open documentation.

@bjoelle bjoelle added the documentation Improvements or additions to documentation label Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants