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
sourceimpl<'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>,
keep_self_color: bool
) -> HashMap<T, T>
pub fn color_greedy(
&mut self,
bound: Option<i64>,
keep_self_color: bool
) -> HashMap<T, T>
Given an ordering
of T
s, find a mapping from nodes to T
s such
that no node has a neighbor with the same T
.
keep_self_color
indicates whether to keep the mapping of the node to
itself in the returned HashMap (since nodes are “colors”)
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more