File tree Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 8383
8484* (x:: NCRingElement , y:: NCRingElem ) = parent (y)(x)* y
8585
86- function == (x:: NCRingElem , y:: NCRingElem )
87- fl, u, v = try_promote (x, y)
88- if fl
89- return u == v
90- else
91- return false
92- end
93- end
94-
86+ # == throws an error when inputs have different parent to help user
87+ # find bugs in their code
88+ function == (a:: NCRingElem , b:: NCRingElem )
89+ check_parent (a, b)
90+ throw (NotImplementedError (:(== ), x, y))
91+ end
92+
93+ # isequal treats ring elements with differing parent as simply being not equal
94+ # (instead of throwing an exception like == does) as it is used to compare set
95+ # elements or keys in dictionaries, and there it seems at least plausible to
96+ # allow mixed parents
97+ function isequal (a:: NCRingElem , b:: NCRingElem )
98+ return parent (a) == parent (b) && a == b
99+ end
100+
101+
95102== (x:: NCRingElem , y:: NCRingElement ) = x == parent (x)(y)
96103
97104== (x:: NCRingElement , y:: NCRingElem ) = parent (y)(x) == y
Original file line number Diff line number Diff line change 44#
55# ##############################################################################
66
7- function isequal (a:: RingElem , b:: RingElem )
8- return parent (a) == parent (b) && a == b
9- end
10-
117# Implement `isapprox` for ring elements via equality by default. On the one
128# hand, we need isapprox methods to be able to conformance test series rings.
139# On the other hand this is essentially the only sensible thing to do in
You can’t perform that action at this time.
0 commit comments