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

impl<T: ItemType> Default for Tree<T>[src]

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

impl<T> !UnwindSafe for Tree<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.