Skip to content

Conversation

@bernlu
Copy link

@bernlu bernlu commented Sep 4, 2024

This PR fixes some copy and move bugs for attributes. Previously, the graph pointer stored in some attribute classes did not change when the graph was copied, and data stored in attributes was not copied.

Changes:

  • Attribute classes are now a seperate header (taken from Graph: Seperate core functions from common API #1222)
  • Sanity checks are now debug-mode only (solves Attributes: move sanity check to Debug-Build #1248)
  • There is now a clear 1:1 relation between Graph and AttributeMap
  • AttributeMap cannot be copied implicitly; a new graph pointer is required
  • removed the graph pointer from AttributeStorage; validity checks are now done in Attribute instead
  • added explicit copy assignment and constructor to Graph to use the new AttributeMap copy constructor
  • fix some details in the graphTools conversion code
  • Graph move operators will update the pointer in AttributeMap; Attribute objects are invalid after a move.

@fabratu fabratu merged commit 7a55d57 into networkit:master Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants