Struct fp_growth::tree::Tree [−][src]
pub struct Tree<T> { /* fields omitted */ }
Tree<T>
represents the main tree data struct will be used during the FP-Growth algorithm.
Implementations
impl<T: ItemType> Tree<T>
[src]
pub fn new() -> Tree<T>
[src]
Create a new FP-Growth tree with an empty root node.
pub fn generate_partial_tree(paths: &[Vec<Rc<Node<T>>>]) -> Tree<T>
[src]
Generate a partial tree with the given paths. This function will be called during the algorithm.
pub fn add_transaction(&mut self, transaction: Vec<T>)
[src]
Iterate the transaction and add every item to the FP-Growth tree.
pub fn update_route(&mut self, node: Rc<Node<T>>)
[src]
Update the route table that records the item and its node list.
pub fn generate_prefix_path(&self, item: T) -> Vec<Vec<Rc<Node<T>>>>
[src]
Generate the prefix paths that end with the given item.
pub fn get_all_nodes(&self, item: T) -> Vec<Rc<Node<T>>>
[src]
Get all nodes that holds the given item.
pub fn get_all_items_nodes(&self) -> Vec<(T, Vec<Rc<Node<T>>>)>
[src]
Get all nodes with the given item.
pub fn print(&self)
[src]
Print out the tree.
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for Tree<T>
impl<T> !Send for Tree<T>
impl<T> !Sync for Tree<T>
impl<T> Unpin for Tree<T> where
T: Unpin,
T: Unpin,
impl<T> !UnwindSafe for Tree<T>
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, 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>,