-
Notifications
You must be signed in to change notification settings - Fork 441
Closed
Labels
F-trait-reworkFeature: Trait ReworkFeature: Trait Rework
Description
Instead of implementing the adjacency matrix on the graph directly (violating separation of concerns) this instead splits the GetAdjacencyMatrix into two traits: GraphAdjacencyMatrix (which is implemented for graphs) and AdjacencyMatrix, which is the actual AdjacencyMatrix
// potential default implementation for AdjacencyMatrix, based on a `FixedBitSet`
// pub struct DefaultAdjacencyMatrix {}
pub trait AdjacencyMatrix {
type Index;
fn is_adjacent(a: Self::Index, b: Self::Index) -> bool;
}
pub trait GraphAdjacencyMatrix: IndexableGraph {
type AdjacencyMatrix<'a>: AdjacencyMatrix<Index = Self::NodeIndex> where Self: 'a;
fn adjacency_matrix(&self) -> Self::AdjacencyMatrix<'_>;
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
F-trait-reworkFeature: Trait ReworkFeature: Trait Rework