Skip to content
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

Improve performance of CopyDigraph #331

Merged
merged 8 commits into from
Sep 2, 2020

Conversation

marinaanagno
Copy link
Contributor

@marinaanagno marinaanagno commented Jul 23, 2020

We added a filter called IsNotDefaultEdgeLabelled that changes to true when we set edge labels and changes back into false when we clear them, so now when we copy digraphs edges are only copied if they are not the default ones, which improves efficiency.

This addresses issue #292.

@MTWhyte MTWhyte linked an issue Jul 29, 2020 that may be closed by this pull request

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Copy link
Collaborator

@MTWhyte MTWhyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @marinaanagno, this looks good to me. There's just one change I'd suggest: when you changed the name of the function, you forgot to delete its old declaration, which is easily done since it's in a different file!

gap/digraph.gd Outdated
@@ -14,6 +14,7 @@ DeclareCategory("IsDigraphWithAdjacencyFunction", IsDigraph);
DeclareCategory("IsCayleyDigraph", IsDigraph);
DeclareCategory("IsImmutableDigraph", IsDigraph);
DeclareSynonym("IsMutableDigraph", IsDigraph and IsMutable);
DeclareFilter("IsNotDefaultEdgeLabelled", IsDigraph);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
DeclareFilter("IsNotDefaultEdgeLabelled", IsDigraph);

I think you meant to delete this line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MTWhyte! Just did this!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @marinaanagno! Let's see if @james-d-mitchell has anything to say before merging.

Copy link
Member

@james-d-mitchell james-d-mitchell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. It's missing some tests, but otherwise, I'll be happy to merge it. Please add the at least one test of this, perhaps the example in the referenced issue?

Marina Anagnostopoulou-Merkouri added 2 commits August 13, 2020 10:02
@james-d-mitchell james-d-mitchell added the performance A label for issues or PR related to performance label Aug 19, 2020
@james-d-mitchell
Copy link
Member

@marinaanagno @samanthaharper I'm happy with this except one thing, you added some whitespace in 3 places, I just updated the PR to remove it, when the CI runs we can merge this.

@james-d-mitchell james-d-mitchell merged commit 8840dda into digraphs:master Sep 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance A label for issues or PR related to performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants