-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
tbd: deprecate array-reducing isreal #19996
Conversation
Personally I'd be in favor of doing away with the array-reducing |
@@ -509,7 +509,7 @@ function logm(A::StridedMatrix) | |||
end | |||
end | |||
|
|||
if isreal(A) && ~np_real_eigs | |||
if all(isreal, A) && ~np_real_eigs |
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.
unrelated, but shouldn't this be !np_real_eigs
instead of ~np_real_eigs
?
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 would have thought so, but apparently ~(x::Bool)
is a synonym for !x
(~
being bitwise not)?
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.
they happen to be equivalent for Bool, but I suspect this was written more out of matlab-habit than intentionally
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.
Agreed. Will touch that up if this pull request goes forward. Otherwise will open a touchup PR. Thanks!
My basic argument here is that It's analogous to the fact that we define |
Is @stevengj has a point. In common mathematical parlance, you can have a real matrix and you can have a complex matrix. There isn't, in my view, a great deal of semantic mathematical difference between |
Deprecation of array-reducing
isreal(A::AbstractArray)
in favor ofall(isinteger, A)
sparked debate in #19925, so I've separated that deprecation (into this pull request) from #19925's uncontroversialisinteger
deprecation.isreal(A::AbstractArray)
: keep or nix? Best!