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

SimpleBufferedDFDecoder< FR > Class Template Reference

#include <SimpleBufferedDFDecoder.hpp>

Inheritance diagram for SimpleBufferedDFDecoder< FR >:

Inheritance graph
[legend]
Collaboration diagram for SimpleBufferedDFDecoder< FR >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef SimpleDecoderBase<
BufferedOutput< FR > >::params_t 
params_t

Public Member Functions

 SimpleBufferedDFDecoder (const params_t *par)
void pushItem (const item_t item)
void write (counter_t support)
void pushItemWithWrite (item_t item, counter_t support)
void pushItemWithPrevSupport (item_t item)
void popItem ()
void popAll ()
 SimpleDecoderBase (const typename DecoderBase< BufferedOutput< FR > >::params_t *par)
void setCodeInverse (const std::vector< item_t > &code_inverse)
 DecoderBase (const params_t *par)
template<typename InputIterator>
void writeItemsetAndCounter (InputIterator first, InputIterator last, counter_t support)
 Writes out one itemset and its counter.

Static Public Member Functions

static bool DINLINE isDFO ()

Protected Types

typedef SimpleDecoderBase<
BufferedOutput< FR > > 
PARENT

Protected Attributes

std::vector< item_tcode_inverse
 The inverse of code vector.
std::streamsize buffer_size
 The size of the buffer.
char * buffer
 The buffer.

Private Attributes

std::stack< std::streamsize > positions
counter_t last_support

Detailed Description

template<class FR = FDRepr>
class SimpleBufferedDFDecoder< FR >

Author:
Ferenc Bodon

Definition at line 14 of file SimpleBufferedDFDecoder.hpp.


Member Typedef Documentation

template<class FR = FDRepr>
typedef SimpleDecoderBase< BufferedOutput<FR> >::params_t SimpleBufferedDFDecoder< FR >::params_t
 

Reimplemented from DecoderBase< BufferedOutput< FR > >.

Definition at line 20 of file SimpleBufferedDFDecoder.hpp.

template<class FR = FDRepr>
typedef SimpleDecoderBase< BufferedOutput<FR> > SimpleBufferedDFDecoder< FR >::PARENT [protected]
 

Definition at line 18 of file SimpleBufferedDFDecoder.hpp.


Constructor & Destructor Documentation

template<class FR = FDRepr>
SimpleBufferedDFDecoder< FR >::SimpleBufferedDFDecoder const params_t par  )  [inline]
 

Definition at line 21 of file SimpleBufferedDFDecoder.hpp.

References SimpleBufferedDFDecoder< FR >::positions.


Member Function Documentation

DecoderBase< BufferedOutput< FR > >::DecoderBase const params_t par  )  [inline, inherited]
 

Definition at line 28 of file DecoderBase.hpp.

template<class FR = FDRepr>
static bool DINLINE SimpleBufferedDFDecoder< FR >::isDFO  )  [inline, static]
 

Reimplemented from OutputBase< FR >.

Definition at line 25 of file SimpleBufferedDFDecoder.hpp.

template<class FR = FDRepr>
void SimpleBufferedDFDecoder< FR >::popAll  )  [inline]
 

Reimplemented from OutputBase< FR >.

Definition at line 50 of file SimpleBufferedDFDecoder.hpp.

References SimpleBufferedDFDecoder< FR >::positions.

template<class FR = FDRepr>
void SimpleBufferedDFDecoder< FR >::popItem  )  [inline]
 

Reimplemented from OutputBase< FR >.

Definition at line 45 of file SimpleBufferedDFDecoder.hpp.

References SimpleBufferedDFDecoder< FR >::positions.

template<class FR>
void SimpleBufferedDFDecoder< FR >::pushItem const item_t  item  )  [inline]
 

Reimplemented from OutputBase< FR >.

Definition at line 63 of file SimpleBufferedDFDecoder.hpp.

References BufferedOutput< FR >::buffer, SimpleDecoderBase< BufferedOutput< FR > >::code_inverse, Formatter::IntToStringFront(), and SimpleBufferedDFDecoder< FR >::positions.

Referenced by SimpleBufferedDFDecoder< FR >::pushItemWithWrite().

template<class FR = FDRepr>
void SimpleBufferedDFDecoder< FR >::pushItemWithPrevSupport item_t  item  )  [inline]
 

Reimplemented from OutputBase< FR >.

Definition at line 40 of file SimpleBufferedDFDecoder.hpp.

References SimpleBufferedDFDecoder< FR >::last_support, and SimpleBufferedDFDecoder< FR >::pushItemWithWrite().

template<class FR = FDRepr>
void SimpleBufferedDFDecoder< FR >::pushItemWithWrite item_t  item,
counter_t  support
[inline]
 

Reimplemented from OutputBase< FR >.

Definition at line 34 of file SimpleBufferedDFDecoder.hpp.

References SimpleBufferedDFDecoder< FR >::pushItem(), and SimpleBufferedDFDecoder< FR >::write().

Referenced by SimpleBufferedDFDecoder< FR >::pushItemWithPrevSupport().

void SimpleDecoderBase< BufferedOutput< FR > >::setCodeInverse const std::vector< item_t > &  code_inverse  )  [inline, inherited]
 

Reimplemented from DecoderBase< BufferedOutput< FR > >.

Definition at line 26 of file SimpleDecoderBase.hpp.

SimpleDecoderBase< BufferedOutput< FR > >::SimpleDecoderBase const typename DecoderBase< BufferedOutput< FR > >::params_t par  )  [inline, inherited]
 

Definition at line 24 of file SimpleDecoderBase.hpp.

template<class FR>
void SimpleBufferedDFDecoder< FR >::write counter_t  support  )  [inline]
 

Reimplemented from OutputBase< FR >.

Definition at line 71 of file SimpleBufferedDFDecoder.hpp.

References BufferedOutput< FR >::buffer, Formatter::IntToStringFront(), SimpleBufferedDFDecoder< FR >::last_support, and SimpleBufferedDFDecoder< FR >::positions.

Referenced by SimpleBufferedDFDecoder< FR >::pushItemWithWrite().

template<class FR = FDRepr>
template<typename InputIterator>
void OutputBase< FR >::writeItemsetAndCounter InputIterator  first,
InputIterator  last,
counter_t  support
[inline, inherited]
 

Writes out one itemset and its counter.

Parameters:
first An input iterator.
last An input iterator.
support the support of the itemset
The elements of the itemset are in the range [first, last).

Here you can see an example of the usage

#include "common.hpp"  
#include "io/output/normal/SimpleOutput.hpp"  
#include "io/StreamRepr.hpp"
#include "io/FILERepr.hpp"
#include "io/output/OutputBase.hpp"
#include "io/output/normal/BufferedNormalOutput.hpp"
#include <set>
#include <vector>
using namespace std;


int main()
{
   typedef Bodon::SimpleOutput O_M;
// typedef BufferedNormalOutput<FStreamOutput> O_M;
// typedef BufferedNormalOutput<FILEOutput> O_M;

   O_M::params_t par;
   par.file_name = "output.txt";
   O_M o_manager(&par);

   counter_t support = 19283;

// itemset is stored in an array
  item_t itemset_array[] = {1, 4, 2, 8, 5, 7};
  const int N = sizeof(itemset_array) / sizeof(item_t);
  o_manager.writeItemsetAndCounter(
     (item_t*) itemset_array, itemset_array + N, support);

// itemset is stored in an vector
  vector<item_t> itemset_vector(itemset_array, itemset_array + N);
  o_manager.writeItemsetAndCounter(
     itemset_vector.begin(), itemset_vector.end(), support);

// itemset is stored in an set
  set<item_t> itemset_set(itemset_array, itemset_array + N);
  o_manager.writeItemsetAndCounter(
     itemset_set.begin(), itemset_set.end(), support);

  return 1;
}

Reimplemented in CacheNormalDecoder< FR >, NoOutput< ISDFO, FR >, BufferedNormalOutput< FR >, SimpleOutput, and BufferedNormalOutput< StreamRepr >.

Definition at line 51 of file OutputBase.hpp.

Referenced by NoOutput< ISDFO, FR >::writeItemsetAndCounter().


Member Data Documentation

template<class FR = FDRepr>
char* BufferedOutput< FR >::buffer [protected, inherited]
 

The buffer.

Definition at line 47 of file BufferedOutput.hpp.

Referenced by BufferedOutput< StreamRepr >::BufferedOutput(), SimpleBufferedDFDecoder< FR >::pushItem(), CacheDFDecoder< FR >::pushItem(), CacheDFDecoder< FR >::pushItemWithPrevSupport(), SimpleBufferedDFDecoder< FR >::write(), CacheDFDecoder< FR >::write(), CacheNormalDecoder< FR >::writeItemsetAndCounter(), and BufferedOutput< StreamRepr >::~BufferedOutput().

template<class FR = FDRepr>
std::streamsize BufferedOutput< FR >::buffer_size [protected, inherited]
 

The size of the buffer.

Definition at line 45 of file BufferedOutput.hpp.

Referenced by BufferedOutput< StreamRepr >::BufferedOutput(), CacheDecoderBase< FR >::setCodeInverse(), CacheNormalDecoder< FR >::writeItemsetAndCounter(), and BufferedNormalOutput< StreamRepr >::writeItemsetAndCounter().

std::vector<item_t> SimpleDecoderBase< BufferedOutput< FR > >::code_inverse [protected, inherited]
 

The inverse of code vector.

code_inverse[i] stores the original code of the item, whose new code is i.

Definition at line 39 of file SimpleDecoderBase.hpp.

Referenced by SimpleBufferedDFDecoder< FR >::pushItem().

template<class FR = FDRepr>
counter_t SimpleBufferedDFDecoder< FR >::last_support [private]
 

Definition at line 59 of file SimpleBufferedDFDecoder.hpp.

Referenced by SimpleBufferedDFDecoder< FR >::pushItemWithPrevSupport(), and SimpleBufferedDFDecoder< FR >::write().

template<class FR = FDRepr>
std::stack<std::streamsize> SimpleBufferedDFDecoder< FR >::positions [private]
 

Definition at line 58 of file SimpleBufferedDFDecoder.hpp.

Referenced by SimpleBufferedDFDecoder< FR >::popAll(), SimpleBufferedDFDecoder< FR >::popItem(), SimpleBufferedDFDecoder< FR >::pushItem(), SimpleBufferedDFDecoder< FR >::SimpleBufferedDFDecoder(), and SimpleBufferedDFDecoder< FR >::write().


The documentation for this class was generated from the following file:
Generated on Sun Sep 17 17:55:33 2006 for FIM environment by  doxygen 1.4.4