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

OctaneModeler Class Reference
[Modelers]

#include <modeler.hpp>

Inheritance diagram for OctaneModeler:

OctaneClass OctaneModeler_WeightVectored SampleModeler ZeroOrderModeler List of all members.

Detailed Description

The Modeler class is for statistical compression methods.

It's job is to continually maintain a probability distribution over the next symbol to be parsed. This probability information can be used by a coder (like an arithmetic or huffman coder) to optimally code the parsed symbol.

Definition at line 51 of file modeler.hpp.

Public Member Functions

 OctaneModeler ()
 constructor

virtual ~OctaneModeler ()
 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 std::string GetHelpInformation ()
 optionally provide more information about the object on request for help

virtual void ResetState ()
virtual bool IsReadyToModel ()
 Are we ready to work? this is usually only true after the model has been trained.

virtual void SynchronizeStateForNewStream ()
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.

virtual bool PrepareForModeling (OctaneParser *parserp)
 Prepare for modeling mode given a trained parser.

virtual bool UpdateModelAfterReceivingSymbol (int symbolnumber, OctaneCoder *coderp)
 Update our model after each symbol is received during compression and decompression.

virtual int GetSymbolCount ()
 Return the number of symbols in the modeler (should be same as number of symbols in the parser); called by coder.

virtual SymbolWeightVectorGetWeightVectorp ()
 Return a pointer to the current weight vector for symbols (used by coder) [optional] This is provided as a shortcut function to avoid having to make numerous calls to GetWeightVectorItem() below.

virtual TSymbolWeightVectorWeight GetWeightVectorItem (int symbolnum)
 Return a specific weight index value; (used by coder).


Member Function Documentation

virtual std::string OctaneModeler::GetName  )  [inline, virtual]
 

provide a unique name for the coder, used in some cases to automatically register the object with a manager

Returns:
a short *unique* name

Reimplemented from OctaneClass.

Reimplemented in SampleModeler, OctaneModeler_WeightVectored, and ZeroOrderModeler.

Definition at line 61 of file modeler.hpp.

00061 {return "OctaneModeler";}

virtual std::string OctaneModeler::GetDescription  )  [inline, virtual]
 

optionally provide a longer (maybe 20-60 characters) description

Returns:
a one line description

Reimplemented from OctaneClass.

Reimplemented in SampleModeler, OctaneModeler_WeightVectored, and ZeroOrderModeler.

Definition at line 62 of file modeler.hpp.

00062 {return "Base Modeler";}

virtual std::string OctaneModeler::GetHelpInformation  )  [inline, virtual]
 

optionally provide more information about the object on request for help

Returns:
a long string (can be multiple
newlines)

Reimplemented from OctaneClass.

Definition at line 63 of file modeler.hpp.

Referenced by OctaneCompressor_Statistical::GetHelpInformation().

00063 {return "";}

virtual bool OctaneModeler::IsReadyToModel  )  [inline, virtual]
 

Are we ready to work? this is usually only true after the model has been trained.

Returns:
true if the modeler is ready to begin predicting probabilities.

Reimplemented in OctaneModeler_WeightVectored.

Definition at line 71 of file modeler.hpp.

Referenced by OctaneCompressor_Statistical::IsReadyToCompress(), and OctaneCompressor_Statistical::SetupAnyDefaultParser().

00071 {return true;};

virtual bool OctaneModeler::CreateModelUsingStream OctaneParser parserp,
bitreader from
[inline, virtual]
 

Build a model using a stream and a parser.

Returns:
true on success.

Reimplemented in SampleModeler, and ZeroOrderModeler.

Definition at line 75 of file modeler.hpp.

Referenced by OctaneCompressor_Statistical::DoProtectedCreateSymbolsAndModelsUsingStream().

00075 {return true;};

virtual bool OctaneModeler::CreateModelUsingParser OctaneParser parserp  )  [inline, virtual]
 

Build a model just using parser.

This is called on startup, before any possible training, when a default parser exists.

Note:
that no input (training) stream is provider; some modelers may ignore this.
Returns:
true on success

Reimplemented in SampleModeler.

Definition at line 80 of file modeler.hpp.

Referenced by OctaneCompressor_Statistical::SetupAnyDefaultParser().

00080 {return false;};

virtual bool OctaneModeler::PrepareForModeling OctaneParser parserp  )  [inline, virtual]
 

Prepare for modeling mode given a trained parser.

Returns:
true on success

Definition at line 83 of file modeler.hpp.

Referenced by OctaneCompressor_Statistical::PrepareForCompression().

00083 {return true;};

virtual bool OctaneModeler::UpdateModelAfterReceivingSymbol int  symbolnumber,
OctaneCoder coderp
[inline, virtual]
 

Update our model after each symbol is received during compression and decompression.

Modelers track symbols during parsing and update the probability distribution predictions for upcoming symbols. This function should notify the coder of changes to probabilities.

See also:
OctaneCoder::ReceiveNotification_ModelChange_AllSymbolWeights

OctaneCoder::ReceiveNotification_ModelChange_SingleSymbolWeight

Returns:
true on success

Definition at line 90 of file modeler.hpp.

Referenced by OctaneCompressor_Statistical::DoProtectedCompress(), and OctaneCompressor_Statistical::DoProtectedDecompress().

00090 {return true;};

virtual SymbolWeightVector* OctaneModeler::GetWeightVectorp  )  [inline, virtual]
 

Return a pointer to the current weight vector for symbols (used by coder) [optional] This is provided as a shortcut function to avoid having to make numerous calls to GetWeightVectorItem() below.

Not all modelers will maintain probabilities in the form of a SymbolWeightVector, and a modeler can return NULL in order to force the coder to get probabilities for each symbol individually.

See also:
OctaneModeler::GetWeightVectorItem
Returns:
a pointer to a local SymbolWeightVector or NULL if it is not available.

Reimplemented in OctaneModeler_WeightVectored.

Definition at line 103 of file modeler.hpp.

00103 {return NULL;};


The documentation for this class was generated from the following file:  
Generated on 20 May 2004 by doxygen 1.3.3