pub struct SteinerTree {
pub graph: UnGraph<(), i32, u32>,
pub mapping: HashMap<usize, NodeIndex>,
pub inverse_mapping: HashMap<NodeIndex, usize>,
pub terminals: Vec<usize>,
}
Fields§
§graph: UnGraph<(), i32, u32>
§mapping: HashMap<usize, NodeIndex>
§inverse_mapping: HashMap<NodeIndex, usize>
§terminals: Vec<usize>
Implementations§
Source§impl SteinerTree
impl SteinerTree
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn cnot_cost(&self) -> usize
pub fn contains(&self, node: usize) -> bool
pub fn is_leaf(&self, node: usize) -> bool
pub fn neighbors(&self, node: usize) -> Vec<usize>
pub fn nodes(&self) -> Vec<usize>
pub fn add_node(&mut self, node: usize)
pub fn add_edge(&mut self, n1: usize, n2: usize)
pub fn remove_node(&mut self, node: usize)
pub fn update_tree(&mut self, new_support: &[usize], qbits: &[usize; 2])
pub fn prune_non_terminal_leaves(&mut self)
Trait Implementations§
Source§impl Clone for SteinerTree
impl Clone for SteinerTree
Source§fn clone(&self) -> SteinerTree
fn clone(&self) -> SteinerTree
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for SteinerTree
impl RefUnwindSafe for SteinerTree
impl Send for SteinerTree
impl Sync for SteinerTree
impl Unpin for SteinerTree
impl UnwindSafe for SteinerTree
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more