Struct calyx_opt::analysis::GraphColoring
source · pub struct GraphColoring<T> { /* private fields */ }Expand description
Defines a greedy graph coloring algorithm over a generic conflict graph.
Implementations§
source§impl<'a, T> GraphColoring<T>where
T: 'a + Eq + Hash + Clone + Ord,
impl<'a, T> GraphColoring<T>where T: 'a + Eq + Hash + Clone + Ord,
sourcepub fn insert_conflict(&mut self, a: &T, b: &T)
pub fn insert_conflict(&mut self, a: &T, b: &T)
Add a conflict edge between a and b.
sourcepub fn insert_conflicts<C>(&mut self, items: C)where
C: Iterator<Item = &'a T> + Clone,
pub fn insert_conflicts<C>(&mut self, items: C)where C: Iterator<Item = &'a T> + Clone,
Add conflict edges between all given items.
pub fn has_nodes(&self) -> bool
provides a hashmap that gives the sharing frequencies
sourcepub fn color_greedy(&mut self, bound: Option<i64>) -> HashMap<T, T>
pub fn color_greedy(&mut self, bound: Option<i64>) -> HashMap<T, T>
Given an ordering of Ts, find a mapping from nodes to Ts such
that no node has a neighbor with the same T.
pub fn welsh_powell_coloring(&self) -> HashMap<T, T>
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for GraphColoring<T>where T: RefUnwindSafe,
impl<T> Send for GraphColoring<T>where T: Send,
impl<T> Sync for GraphColoring<T>where T: Sync,
impl<T> Unpin for GraphColoring<T>where T: Unpin,
impl<T> UnwindSafe for GraphColoring<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more