-
-
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
array comparison #853
Comments
As per IRC discussion We will have == and != doing all() by default and giving a boolean. All other operations such as <, <=, >, >= remain undefined for arrays. |
And the dotted operators will be array-of-booleans as Jeff proposes above? Sounds good to me. |
Yep. That's the plan. It's tempting to define |
implemented for Array and DArray
In progress on the array_comparison branch: https://github.com/JuliaLang/julia/tree/array_comparison Other library maintainers @ViralBShah @carlobaldassi please update your array implementations. Everybody else please try to find comparisons that need to be changed. |
The bitarray comparisons are now fixed in the array_comparison branch. |
Branch merged by 3040405. |
At this point most of us want
.==
for elementwise comparison. There are many reasons for this. Forming boolean arrays is often unnecessary and inefficient. More importantly, in mathematics when equality is extended to matrices it is still boolean, i.e.A=I
denotes that A is everywhere equal to the identity matrix; it does not denote another matrix (of booleans).==
should be extended to containers by giving true iff it is true for all parts. This handles nested arrays, etc. with no problem.A.==B
should be equivalent tomap(==, A, B)
. That way it always gives a container of booleans, and still uses==
for all comparisons..<
can be defined for arrays in the same way, but I'm not sure whether<
should be.The text was updated successfully, but these errors were encountered: