00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef _ONESTEPMARKOVCHAIN_HPP
00014 #define _ONESTEPMARKOVCHAIN_HPP
00015
00017
00022 #include "Index.hpp"
00023 #include "WeightedIDSet.hpp"
00024
00025 class OneStepMarkovChain {
00026 public:
00028 OneStepMarkovChain(const WeightedIDSet &docSet, const Index &homeIndex, double *wdNorm, double stopProbAlpha);
00029 ~OneStepMarkovChain();
00030
00032
00038
00039 void startFromWordIteration(int toWord) const;
00040 bool hasMoreFromWord() const {
00041 while (itPos <= ind.termCountUnique() && fromWordPr[itPos]==0)
00042 itPos++;
00043 return (itPos<= ind.termCountUnique());
00044 }
00046 void nextFromWordProb(int &fromWord, double &prob) const ;
00048
00049 private:
00050 void computeFromWordProb(int toWord) const;
00051 const Index &ind;
00052 double alpha;
00053 int *dSet;
00054 double *norm;
00055 mutable double *fromWordPr;
00056 mutable int itPos;
00057 mutable int curToWord;
00058 };
00059
00060
00061 #endif