Struct sprs::linalg::etree::Parents [−][src]
Store an etree as the parent information of each node. This reflects the fact that etrees can in fact have multiple roots.
Implementations
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> RefUnwindSafe for Parents<S> where
S: RefUnwindSafe,
S: RefUnwindSafe,
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,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub unsafe fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,