-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fix/128 #129
Conversation
include/abstractopenglplan.h
Outdated
begin, end, | ||
std::make_pair(*begin, *begin), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is going to happen if begin == end
? There are should not be any empty arrays, but still...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If FITS
is empty then we have a LOT of problems in other parts of the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to consider the case of the image that is full of NaNs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats about use
std::make_pair(std::numeric_limits<T>::max(), std::numeric_limist<T>::lowest())
instead of std::make_pair(*begin, *begin)
?
This will lead to e
containing (MAX, MIN)
in both cases: when all NaNs, when iterator range is empty.
Then just handle this special case:
if (e.first > e.second)
std::swap(e.first, e.second);
#endif | ||
return std::make_pair(Utils::min(acc.first, x), Utils::max(acc.second, x)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whouldn't it better to be consistent with swap_bytes
usage and ask using Utils::min; using Utils::max;
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to be as explicit as possible, a reader should understand that we use own implementation of min
and max
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove using Utils:swap_bytes
Could you please squash 2nd and 4th commits together? |
Fix #128: find min and max values ignoring NaN
Check this GUI features before merge:
BITPIX
images