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_WeightVectored Class Reference
[Modelers]

#include <modeler_weightvectored.hpp>

Inheritance diagram for OctaneModeler_WeightVectored:

OctaneModeler OctaneClass SampleModeler ZeroOrderModeler List of all members.

Detailed Description

This is a derived modeler class which has some default functions for modelers which work with a vector of weights as probabilities (very common).

Definition at line 33 of file modeler_weightvectored.hpp.

Public Member Functions

 OctaneModeler_WeightVectored ()
 constructor

virtual ~OctaneModeler_WeightVectored ()
 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 unsigned int GetMemoryUsed ()
 Report actual current memory usage (in bytes).

virtual unsigned int GetDiskspaceUsed (bool fortempdecompressiononly)
 Report disk space (in bytes) that would be used when saving state to file (in bytes).

virtual bool SaveState (bitwriter &to, bool fortempdecompressiononly)
 Save state of object to output stream (if appropriate).

virtual bool LoadState (bitreader &from)
 Load state of object from input stream (if appropriate).

virtual void ShowDebuggingInfo ()
 show any debugging info on request (used by various derived classes) [optional]

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

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


Protected Attributes

SymbolWeightVector weightvector
 vector based data structure for computing and storing frequencies


Member Function Documentation

virtual std::string OctaneModeler_WeightVectored::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 OctaneModeler.

Reimplemented in SampleModeler, and ZeroOrderModeler.

Definition at line 46 of file modeler_weightvectored.hpp.

00046 {return "OctaneModelerWeightVectored";}

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

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

Returns:
a one line description

Reimplemented from OctaneModeler.

Reimplemented in SampleModeler, and ZeroOrderModeler.

Definition at line 47 of file modeler_weightvectored.hpp.

00047 {return "OctaneModeler using a WeightVector";}

bool OctaneModeler_WeightVectored::SaveState bitwriter to,
bool  fortempdecompressiononly
[virtual]
 

Save state of object to output stream (if appropriate).

Returns:
true on success (or if no information needs to be saved).

Reimplemented from OctaneClass.

Definition at line 34 of file modeler_weightvectored.cpp.

References SymbolWeightVector::SaveState(), and weightvector.

00035 {
00036         // save state
00037         // return true on success
00038         return weightvector.SaveState(to,fortempdecompressiononly);
00039 }

bool OctaneModeler_WeightVectored::LoadState bitreader from  )  [virtual]
 

Load state of object from input stream (if appropriate).

Returns:
true on success (or if no information needs to be loaded).

Reimplemented from OctaneClass.

Definition at line 41 of file modeler_weightvectored.cpp.

References SymbolWeightVector::LoadState(), and weightvector.

00042 {
00043         // load state
00044         // return true on success
00045         return weightvector.LoadState(from);
00046 }

virtual bool OctaneModeler_WeightVectored::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 from OctaneModeler.

Definition at line 61 of file modeler_weightvectored.hpp.

References SymbolWeightVector::GetSymbolCount(), and weightvector.

00061 {if (weightvector.GetSymbolCount()>0) return true; else return false;};

virtual SymbolWeightVector* OctaneModeler_WeightVectored::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 from OctaneModeler.

Definition at line 68 of file modeler_weightvectored.hpp.

References weightvector.

00068 {return &weightvector;};


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