-
Notifications
You must be signed in to change notification settings - Fork 59
Add SwapDigraphs
and DigraphsRemoveAllEdges
functions
#864
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
base: main
Are you sure you want to change the base?
Conversation
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.
Great work, especially for your first pull request. I've suggested a load of changes (we always do this) so it'd be great if you could make those changes and we can get this merged. Sorry for the major changes I'm requesting to the core algorithm!
SwapDigraphs
and DigraphsRemoveAllEdges
functions
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.
Excellent start, but this Pr will need some changes before it can be merged, let's discuss tomorrow!
Mostly fixed, with remaining problems covered by @james-d-mitchell's review.
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.
Very close to complete now. Just a couple more comments.
<Attr Name="DigraphRemoveAllEdgesAttr" Arg="digraph"/> | ||
<Returns>An empty digraph.</Returns> | ||
<Description> | ||
This operation returns a digraph constructed from <A>digraph</A>, which is mutable, |
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.
"which is mutable" is out of date – it might not be mutable, as you've explained below.
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.
A sentence including the word "if" would be better. :)
end); | ||
|
||
InstallMethod(SwapDigraphs, | ||
"for a mutable digraph and mutable digraph", |
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.
Better would be "for two mutable digraphs".
<mutable digraph with 3 vertices, 3 edges> | ||
gap> DigraphRemoveAllEdges(D3); | ||
<mutable empty digraph with 3 vertices> | ||
true |
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'm not sure where "true" came from. Is this included by accident? I'm surprised it passes the tests!
Created
SwapDigraphs
to swap the contents of two digraphs, and addedDigraphsRemoveAllEdges
for removing all edges from a digraph