You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, eq only works on numerical matrices because the protocol implementation uses ==. (Note that this appears to not always have been true, eb71bb4 changed the uses of = to ==, causing eq to no longer work on non-numeric matrices.) It would be helpful to have eq work on non-numerical matrices too, for example character or keyword matrices. Currently, applying eq to such matrices throws an exception.
The text was updated successfully, but these errors were encountered:
So eq was defined to work with numerical values only (for consistency with ge etc.).
e= performs a comparison of all elements with Clojure = semantics.
Non-numerical equality on an element wise basis is somewhat tricky because array implementations might not support booleans as results (or even numerical values, for that matter...)
Potential workaround that probably does what you want:
(emap = a b)
Though you may need to be careful that the implementation of a supports booleans or do something like:
Having the results be numeric (1 and 0 instead of true and false) is desirable IMO, I think that having boolean results would drastically change the semantics of eq, and I'm not suggesting that. This request was to allow for non-numeric inputs. For example:
Currently,
eq
only works on numerical matrices because the protocol implementation uses==
. (Note that this appears to not always have been true, eb71bb4 changed the uses of=
to==
, causingeq
to no longer work on non-numeric matrices.) It would be helpful to haveeq
work on non-numerical matrices too, for example character or keyword matrices. Currently, applyingeq
to such matrices throws an exception.The text was updated successfully, but these errors were encountered: