Octane v1.01.20 - The Open Compression Toolkit for C++ http://octane.sourceforge.net/
Homepage | Main | Modules | Class Hierarchy | Compound List | File List | Compound Members | Related Pages

modelers/modeler_sample/samplemodeler.cpp

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 //---------------------------------------------------------------------------
00007 
00008 //---------------------------------------------------------------------------
00009 #include "samplemodeler.hpp"
00010 //---------------------------------------------------------------------------
00011 
00012 
00013 
00014 //---------------------------------------------------------------------------
00015 // MODELLER PUBLIC API
00016 bool SampleModeler::CreateModelUsingParser(OctaneParser *parserp)
00017         {
00018         // initialize vector with proper number of symbols as specified by the parser
00019         int symbolcount=parserp->GetSymbolCount();
00020         weightvector.SetSymbolCount(symbolcount);
00021 
00022         // set them all equal
00023         for (int index=0;index<symbolcount;++index)
00024                 weightvector.SetSymbolWeight(index,1);
00025 
00026         // normalize to probability distribution
00027         weightvector.NormalizeToProbabilityDistribution();
00028 
00029         // success
00030         return true;
00031         }
00032 //---------------------------------------------------------------------------
 
Generated on 20 May 2004 by doxygen 1.3.3