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

Add iterator over incident edges of a stable graph node. #636

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ISibboI
Copy link

@ISibboI ISibboI commented Apr 21, 2024

No description provided.

Copy link
Member

@ABorgna ABorgna left a comment

Choose a reason for hiding this comment

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

Thanks! This is quite useful.

Would you mind implementing the method on Graph too?

///
/// Produces an empty iterator if the node `a` doesn't exist.<br>
/// Iterator element type is `EdgeReference<E, Ix>`.
pub fn edges_incident(&self, a: NodeIndex<Ix>) -> EdgesIncident<E, Ty, Ix> {
Copy link
Member

Choose a reason for hiding this comment

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

Add a comment to the edges method doc referencing this one. Something like:

///
/// For an iterator over both incoming and outgoing edges sees [`StableGraph::edges_incident`].

Comment on lines +1579 to +1580
// In any of the "both" situations, self-loops would be iterated over twice.
// Skip them here.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// In any of the "both" situations, self-loops would be iterated over twice.
// Skip them here.
// Self-loops would be iterated over twice. Skip them here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants