-
Notifications
You must be signed in to change notification settings - Fork 135
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
allow ==
for two groups/group elements in fewer cases
#4196
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -372,9 +372,26 @@ end | |
|
||
Base.:*(x::GAPGroupElem, y::GAPGroupElem) = _prod(x, y) | ||
|
||
==(x::GAPGroup, y::GAPGroup) = GapObj(x) == GapObj(y) | ||
function ==(x::GAPGroup, y::GAPGroup) | ||
_check_compatible(x, y) | ||
return GapObj(x) == GapObj(y) | ||
end | ||
|
||
# For two `BasicGAPGroupElem`s, | ||
# we allow the question for equality if their parents fit together | ||
# in the sense of `_check_compatible`, | ||
# and compare the `GapObj`s if this is the case. | ||
function ==(x::BasicGAPGroupElem, y::BasicGAPGroupElem) | ||
_check_compatible(parent(x), parent(y)) | ||
return GapObj(x) == GapObj(y) | ||
end | ||
|
||
==(x::BasicGAPGroupElem, y::BasicGAPGroupElem ) = GapObj(x) == GapObj(y) | ||
# For two `GAPGroupElem`s, | ||
# if no specialized method is applicable then no `==` comparison is allowed. | ||
function ==(x::GAPGroupElem, y::GAPGroupElem) | ||
_check_compatible(parent(x), parent(y); error = false) || throw(ArgumentError("parents of x and y are not compatible")) | ||
throw(ArgumentError("== is not implemented for the given types")) | ||
end | ||
Comment on lines
+389
to
+394
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. once Nemocas/AbstractAlgebra.jl#1853 is available, this method can be removed. maybe add this as a comment There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My point of view is: |
||
|
||
""" | ||
one(G::GAPGroup) -> elem_type(G) | ||
|
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.
Same here as above