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

Ensure that sum() mean() and similar statistics in vvec ignore NaNs in the array. #110

Open
sebjameswml opened this issue May 25, 2023 · 3 comments

Comments

@sebjameswml
Copy link
Collaborator

Currently, the NaNs are acted on, which is probably not what one wants in a computation.

@sebjameswml
Copy link
Collaborator Author

The problem with doing this is that you end up with lots of conditionals in your loops. For example, in a sum() you have to test if each element isnan() which will slow things down. Alternative is to first scan through to see if there are any nans, then loop to accumulate with isnan testing only if necessary.

@sebjameswml
Copy link
Collaborator Author

Best approach to have methods that explicitly deal with nans, and let client code decide which to use?

@sebjameswml
Copy link
Collaborator Author

So is best approach to do what I already did with minmax?:

https://github.com/ABRG-Models/morphologica/blob/main/morph/vvec.h#L609

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

No branches or pull requests

1 participant