| Octane v1.01.20 - The Open Compression Toolkit for C++ | http://octane.sourceforge.net/ |
#include <samplemodeler.hpp>
Inheritance diagram for SampleModeler:

Definition at line 28 of file samplemodeler.hpp.
Public Member Functions | |
| SampleModeler () | |
| constructor | |
| virtual | ~SampleModeler () |
| destructor | |
| virtual std::string | GetName () |
| provide a unique name for the coder, used in some cases to automatically register the object with a manager | |
| virtual std::string | GetDescription () |
| optionally provide a longer (maybe 20-60 characters) description | |
| virtual bool | CreateModelUsingStream (OctaneParser *parserp, bitreader &from) |
| Build a model using a stream and a parser. | |
| virtual bool | CreateModelUsingParser (OctaneParser *parserp) |
| Build a model just using parser. | |
|
|
provide a unique name for the coder, used in some cases to automatically register the object with a manager
Reimplemented from OctaneModeler_WeightVectored. Definition at line 38 of file samplemodeler.hpp.
00038 {return "SampleModeler";}
|
|
|
optionally provide a longer (maybe 20-60 characters) description
Reimplemented from OctaneModeler_WeightVectored. Definition at line 39 of file samplemodeler.hpp.
00039 {return "Fixed Equal-Probability Modeler";}
|
|
||||||||||||
|
Build a model using a stream and a parser.
Reimplemented from OctaneModeler. Definition at line 44 of file samplemodeler.hpp. References CreateModelUsingParser().
00044 {return CreateModelUsingParser(parserp);};
|
|
|
Build a model just using parser. This is called on startup, before any possible training, when a default parser exists.
Reimplemented from OctaneModeler. Definition at line 16 of file samplemodeler.cpp. References OctaneParser::GetSymbolCount(), SymbolWeightVector::NormalizeToProbabilityDistribution(), SymbolWeightVector::SetSymbolCount(), SymbolWeightVector::SetSymbolWeight(), and OctaneModeler_WeightVectored::weightvector. Referenced by CreateModelUsingStream().
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 }
|