Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OneStepMarkovChain.hpp

Go to the documentation of this file.
00001 /*==========================================================================
00002  * Copyright (c) 2001 Carnegie Mellon University.  All Rights Reserved.
00003  *
00004  * Use of the Lemur Toolkit for Language Modeling and Information Retrieval
00005  * is subject to the terms of the software license set forth in the LICENSE
00006  * file included with this software, and also available at
00007  * http://www.lemurproject.org/license.html
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(TERMID_T 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(TERMID_T &fromWord, double &prob) const ;
00048 
00049 private:
00050   void computeFromWordProb(TERMID_T toWord) const;
00051   const Index &ind;
00052   double alpha;
00053   int *dSet;
00054   double *norm;
00055   mutable double *fromWordPr;
00056   mutable TERMID_T itPos;
00057   mutable TERMID_T curToWord;
00058 };
00059 
00060 
00061 #endif /* _ONESTEPMARKOVCHAIN_HPP */

Generated on Wed Nov 3 12:59:00 2004 for Lemur Toolkit by doxygen1.2.18