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

use ispredicate(::Arbfunction) to return Bool from arbcall #59

Merged
merged 6 commits into from
Sep 7, 2020

Conversation

kalmarek
Copy link
Owner

@kalmarek kalmarek commented Sep 3, 2020

This adds just predicate detection and uses it to turn the returned int to Bool. Arblib returns "success", hence non-zero output can be interpreted as true

@kalmarek kalmarek linked an issue Sep 4, 2020 that may be closed by this pull request
@saschatimme saschatimme mentioned this pull request Sep 4, 2020
6 tasks
Copy link
Collaborator

@Joel-Dahne Joel-Dahne left a comment

Choose a reason for hiding this comment

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

This looks good! Would be good to also add some simple tests, should be easy since ispredicate is self contained.

src/arbcall.jl Outdated Show resolved Hide resolved
@saschatimme
Copy link
Collaborator

@kalmarek In which branch do you want to merge this by now? Shouldn't this be master?

@saschatimme saschatimme changed the base branch from arbcall-refactor2 to master September 7, 2020 08:14
@saschatimme saschatimme merged commit d0045c1 into master Sep 7, 2020
@saschatimme saschatimme deleted the enh/arbcall_predicate branch September 7, 2020 09:37
@kalmarek
Copy link
Owner Author

kalmarek commented Sep 7, 2020

@Joel-Dahne I know it's post-factum, but could you produce a list with your (canonical ;) version of arb docs which functions are detected as predicates? I made this list locally and everything looked ok, but you never know ;)

@Joel-Dahne
Copy link
Collaborator

@Joel-Dahne I know it's post-factum, but could you produce a list with your (canonical ;) version of arb docs which functions are detected as predicates? I made this list locally and everything looked ok, but you never know ;)

I looked through the functions detected as predicates and it seems fully correct! However it does miss some functions which do return a boolean, for example arb_mat_solve, but this is probably fine. I can give a precise list as well, but that probably makes more sense to do after #32 is merged since much more functions will be parsed.

@kalmarek
Copy link
Owner Author

kalmarek commented Sep 7, 2020

I think that the return value of arb_mat_solve (also of e.g. eig_simple) is more of an error code than a Bool, but we can discuss this and change it later. Indeed the ispredicate would become much simpler, since there are only a few exceptions to the Cint → Bool translation upon return (e.g. *_cmp function).

see #62

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.

What to return from arbcall?
3 participants