/// @file modeler_weightvectored.cpp
/// Derived modeler which uses a simple vector of probabilities
///
/// @remarks
/// This is a derived (but still abstract) modeler class which can serve
///  as the foundation for common simple statistic modelers which use a single
///  vector of weights.
///
/// @author mouser
/// @date   2003.07.29
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
#include "modeler_weightvectored.hpp"
//---------------------------------------------------------------------------



//---------------------------------------------------------------------------
// OCTANE PUBLIC API - AUXILIARY FUNCTIONS - these are supported by all derived classes

unsigned int OctaneModeler_WeightVectored::GetMemoryUsed()
{
	// size of our modeler in memory
	return (unsigned int)(sizeof(this)+weightvector.GetMemoryUsed());
}

unsigned int OctaneModeler_WeightVectored::GetDiskspaceUsed(bool fortempdecompressiononly)
{
	// disk space used to save state
	return weightvector.GetMemoryUsed();
}

bool OctaneModeler_WeightVectored::SaveState(bitwriter &to,bool fortempdecompressiononly)
{
	// save state
	// return true on success
	return weightvector.SaveState(to,fortempdecompressiononly);
}

bool OctaneModeler_WeightVectored::LoadState(bitreader &from)
{
	// load state
	// return true on success
	return weightvector.LoadState(from);
}


void OctaneModeler_WeightVectored::ShowDebuggingInfo()
{
	// optionally send debug information to a stream
	weightvector.ShowDebuggingInfo();	
}
//---------------------------------------------------------------------------
	
	
	
//---------------------------------------------------------------------------
// MODELLER PUBLIC API

void OctaneModeler_WeightVectored::ResetState()
{
	// reset state - just zero out the weight vector - this is called prior to a call to PrepareForModeling()
	weightvector.ResetWeights();
}
//---------------------------------------------------------------------------
