[−][src]Struct sprs::linalg::etree::Parents
Store an etree as the parent information of each node. This reflects the fact that etrees can in fact have multiple roots.
Methods
impl<S: Deref<Target = [Parent]>> Parents<S>
[src]
pub fn get_parent(&self, node: usize) -> Option<usize>
[src]
pub fn is_root(&self, node: usize) -> bool
[src]
pub fn nb_nodes(&self) -> usize
[src]
The number of nodes in this tree.
pub fn view(&self) -> ParentsView
[src]
Get a view of this object
impl<S: DerefMut<Target = [Parent]>> Parents<S>
[src]
pub fn set_parent(&mut self, node: usize, parent: usize)
[src]
pub fn set_root(&mut self, node: usize)
[src]
pub fn uproot(&mut self, node: usize, parent: usize)
[src]
Give a parent to a root of the tree. No-op if the node was not a parent.
Panics
if either node or parent is out of bounds
pub fn view_mut(&mut self) -> ParentsViewMut
[src]
impl Parents<Vec<Parent>>
[src]
pub fn new(nb_nodes: usize) -> ParentsOwned
[src]
Create a new tree with all nodes set as root
Trait Implementations
impl<S: Clone> Clone for Parents<S> where
S: Deref<Target = [Parent]>,
[src]
S: Deref<Target = [Parent]>,
fn clone(&self) -> Parents<S>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<S: Debug> Debug for Parents<S> where
S: Deref<Target = [Parent]>,
[src]
S: Deref<Target = [Parent]>,
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<SS, SP> SupersetOf for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,