forked from petgraph/petgraph
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix various bugs in matrix graph (petgraph#427)
* Fix various bugs in matrix graph - Extension function for directed graphs did not copy the edges - Off by one in with_capacity - Check if the lazy adjacency matrix contains node before accesing * Exact allocation in MatrixGraph::with_capacity Avoids unnecessary quadratic memory waste. Dynamic expansions continue rounding to the next power of two. * Avoid unnecesary bonds checks in update_edge Speeds up edge inserting benchmarks by ~35% * Use array swaps when possible when extending Overlapping slices still use the iterative method. * Fix bug in iterative copy, add test
- Loading branch information
Showing
1 changed file
with
117 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters