#include <Trie.hpp>
Public Member Functions | |
Trie (const unsigned long init_counter) | |
const Trie * | is_included (const set< itemtype > &an_itemset, set< itemtype >::const_iterator item_it) const |
It decides whether the given itemset is included in the trie or not. | |
void | find_candidate (vector< itemtype >::const_iterator it_basket_upper_bound, const itemtype distance_from_candidate, vector< itemtype >::const_iterator it_basket, const unsigned long counter_incr=1) |
Increases the counter for those itemsets that is contained by the given basket. | |
void | delete_infrequent (const unsigned long min_occurrence, const itemtype distance_from_candidate, unsigned long &nr_of_freq_itemsets) |
Deletes the tries that represent infrequent itemsets. | |
~Trie () | |
Private Member Functions | |
void | add_empty_state (const itemtype item, const unsigned long init_counter=0) |
Adds an empty state to the trie. | |
Private Attributes | |
unsigned long | counter |
counter stores the occurrence of the itemset represented by the Trie | |
vector< Edge > | edgevector |
edgevector stores the edges of the root the trie. | |
Friends | |
class | Apriori_Trie |
We can regard the trie as a recursive data structure. It has a root node and a list of (sub)trie. We can reach a subtree by a labeled edge (link). Since the root of the trie represents an itemset the counter stands for the occurrence. For the sake of fast traversal we also store the length of the maximal path starting from the root, and the edges are stored ordered according to their label.
Definition at line 46 of file Trie.hpp.
|
Definition at line 23 of file Trie.cpp. Referenced by add_empty_state(). |
|
Definition at line 131 of file Trie.cpp. References edgevector. |
|
Adds an empty state to the trie.
Definition at line 143 of file Trie.cpp. References edgevector, itemtype, Edge::label, Edge::subtrie, and Trie(). Referenced by Apriori_Trie::candidate_generation_assist(), and Apriori_Trie::insert_frequent_items(). |
|
Deletes the tries that represent infrequent itemsets.
Definition at line 93 of file Trie.cpp. References edgevector, and itemtype. Referenced by Apriori_Trie::delete_infrequent(). |
|
Increases the counter for those itemsets that is contained by the given basket.
Definition at line 61 of file Trie.cpp. References counter, edgevector, and itemtype. Referenced by Apriori_Trie::find_candidate(). |
|
It decides whether the given itemset is included in the trie or not.
Definition at line 36 of file Trie.cpp. References Edge_point_less(), and edgevector. Referenced by Apriori_Trie::is_all_subset_frequent(). |
|
|
|
counter stores the occurrence of the itemset represented by the Trie
Definition at line 84 of file Trie.hpp. Referenced by Apriori_Trie::candidate_generation_assist(), and find_candidate(). |
|
edgevector stores the edges of the root the trie. edgevector is always sorted! Definition at line 90 of file Trie.hpp. Referenced by add_empty_state(), Apriori_Trie::candidate_generation_assist(), Apriori_Trie::candidate_generation_two(), delete_infrequent(), Apriori_Trie::delete_infrequent_two(), find_candidate(), is_included(), Apriori_Trie::is_there_any_candidate(), and ~Trie(). |