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

LStatOutput< OUTPUT > Class Template Reference

This class is a simplifies StatOutput, i.e. More...

#include <StatOutput.hpp>

Collaboration diagram for LStatOutput< OUTPUT >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LStatOutput (OUTPUT &out, item_t numfreq) throw (std::ios_base::failure)
 It opens the output file.
template<class InputIterator>
void DINLINE writeItemsetAndCounter (InputIterator first, InputIterator last, const counter_t support)
 Writes out one itemset and its counter.
void flush ()
 ~LStatOutput ()
 It closes the output file.

Private Attributes

OUTPUT & out
size_t totlen
size_t totsup

Detailed Description

template<class OUTPUT>
class LStatOutput< OUTPUT >

This class is a simplifies StatOutput, i.e.

, it just collects the length of itemsets

Definition at line 132 of file StatOutput.hpp.


Constructor & Destructor Documentation

template<class OUTPUT>
LStatOutput< OUTPUT >::LStatOutput OUTPUT &  out,
item_t  numfreq
throw (std::ios_base::failure) [inline]
 

It opens the output file.

Parameters:
out an output manager, that implements OutputBase
numfreq is the number of frequent items

Definition at line 144 of file StatOutput.hpp.

template<class OUTPUT>
LStatOutput< OUTPUT >::~LStatOutput  )  [inline]
 

It closes the output file.

Definition at line 172 of file StatOutput.hpp.

References LStatOutput< OUTPUT >::totlen, and LStatOutput< OUTPUT >::totsup.


Member Function Documentation

template<class OUTPUT>
void LStatOutput< OUTPUT >::flush  )  [inline]
 

Definition at line 167 of file StatOutput.hpp.

References LStatOutput< OUTPUT >::out.

template<class OUTPUT>
template<class InputIterator>
void DINLINE LStatOutput< OUTPUT >::writeItemsetAndCounter InputIterator  first,
InputIterator  last,
const counter_t  support
[inline]
 

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;
}

Definition at line 159 of file StatOutput.hpp.

References LStatOutput< OUTPUT >::out, LStatOutput< OUTPUT >::totlen, and LStatOutput< OUTPUT >::totsup.


Member Data Documentation

template<class OUTPUT>
OUTPUT& LStatOutput< OUTPUT >::out [private]
 

Definition at line 134 of file StatOutput.hpp.

Referenced by LStatOutput< OUTPUT >::flush(), and LStatOutput< OUTPUT >::writeItemsetAndCounter().

template<class OUTPUT>
size_t LStatOutput< OUTPUT >::totlen [private]
 

Definition at line 135 of file StatOutput.hpp.

Referenced by LStatOutput< OUTPUT >::writeItemsetAndCounter(), and LStatOutput< OUTPUT >::~LStatOutput().

template<class OUTPUT>
size_t LStatOutput< OUTPUT >::totsup [private]
 

Definition at line 136 of file StatOutput.hpp.

Referenced by LStatOutput< OUTPUT >::writeItemsetAndCounter(), and LStatOutput< OUTPUT >::~LStatOutput().


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