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

prefixarray/FrequentPairInserterNoprune.hpp

Go to the documentation of this file.
00001 #ifndef FrequentPairInserterNoprune_prefix_HPP
00002 #define FrequentPairInserterNoprune_prefix_HPP
00003 
00004 #include "common.hpp"
00005 #include "datastructures/PrefixArrayList.hpp"
00006 //#include <cstdio>
00007 //#include <iterator>   //for test
00008 
00009 
00010 namespace Bodon
00011 {
00012 namespace prefix_array
00013 {
00014 template <class DATASTRUCTURE, class D, class DUMMY>
00015 class FrequentPairInserterNoprune
00016 {
00017    protected:
00018       DATASTRUCTURE& candidates; 
00019       D& decoder;
00020 
00021    public:
00022       FrequentPairInserterNoprune( DATASTRUCTURE& candidates, 
00023                                    D& decoder, DUMMY& dummy ) : 
00024          candidates(candidates), decoder(decoder){}
00025 
00026 
00028       void insertFrequentPairs(
00029          const std::vector< std::pair< counter_t, 
00030          std::pair<item_t, item_t> > >& freq_pairs_with_counters )
00031       {
00032          itemvector itemset;
00033          for( std::vector< std::pair< counter_t, std::pair<item_t, item_t> > >::const_iterator 
00034                  it = freq_pairs_with_counters.begin(); it != freq_pairs_with_counters.end(); ++it)
00035          {
00036             itemset.push_back((*it).second.first);
00037             itemset.push_back((*it).second.second);
00038             decoder.writeItemsetAndCounter(itemset.begin(), itemset.end(), (*it).first);
00039             itemset.clear();
00040             candidates[(*it).second.first][(*it).second.second-(*it).second.first -1].
00041                push_back(itemvecCounterPair(itemset, 0 ) );
00042          }
00043       }
00044 };
00045 
00046 }
00047 }
00048 
00049 #endif

Generated on Sun Sep 17 17:50:38 2006 for FIM environment by  doxygen 1.4.4