[−][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]>,
impl<S: Debug> Debug for Parents<S> where
S: Deref<Target = [Parent]>,
[src]
S: Deref<Target = [Parent]>,
Auto Trait Implementations
impl<S> Send for Parents<S> where
S: Send,
S: Send,
impl<S> Sync for Parents<S> where
S: Sync,
S: Sync,
impl<S> Unpin for Parents<S> where
S: Unpin,
S: Unpin,
impl<S> UnwindSafe for Parents<S> where
S: UnwindSafe,
S: UnwindSafe,
impl<S> RefUnwindSafe for Parents<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> 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, U> TryInto<U> 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<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,