Main Page | Namespace List | Class List | File List | Class Members | File Members

Trie.hpp

Go to the documentation of this file.
00001 /***************************************************************************
00002                           Trie.hpp  -  description
00003                              -------------------
00004     begin                : cs dec 26 2002
00005     copyright            : (C) 2002 by Ferenc Bodon
00006     email                : bodon@mit.bme.hu
00007  ***************************************************************************/
00008 
00009 #ifndef Trie_HPP
00010 #define Trie_HPP
00011 
00016 #include "common.hpp"
00017 #include <vector>
00018 #include <set>
00019 
00020 using namespace std;
00021 
00022 class Apriori_Trie;
00023 class Trie;
00024 
00029 struct Edge
00030 {
00031    itemtype label;
00032    Trie* subtrie;
00033 };
00034 
00046 class Trie
00047 {
00048 friend class Apriori_Trie;
00049 
00050 public:
00051 
00052    Trie( const unsigned long init_counter );
00053 
00055    const Trie* is_included( const set<itemtype>& an_itemset, 
00056                             set<itemtype>::const_iterator item_it ) const;
00057 
00060    void find_candidate( vector<itemtype>::const_iterator it_basket_upper_bound, 
00061                         const itemtype distance_from_candidate,
00062                         vector<itemtype>::const_iterator it_basket, 
00063                         const unsigned long counter_incr=1);
00064 
00066    void delete_infrequent( const unsigned long min_occurrence, 
00067                            const itemtype distance_from_candidate,
00068                            unsigned long& nr_of_freq_itemsets );
00069 
00070    ~Trie();
00071 
00072 private:
00073 
00075    void add_empty_state( const itemtype item, 
00076                          const unsigned long init_counter=0 );
00077 
00078 public:
00079    // No public members
00080 
00081 private:
00082 
00084    unsigned long counter;
00085 
00090    vector<Edge> edgevector;
00091 };
00092 
00093 
00094 #endif

Generated on Fri Sep 3 17:23:51 2004 for APRIORI algorithm by doxygen 1.3.5