⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 samplemodeler.cpp

📁 Octane v1.01.20 The Open Compression Toolkit for C++ . The Open Compression Toolkit is a set of mo
💻 CPP
字号:
/// @file samplemodeler.cpp
/// A sample modeler which basically assigns fixed equal probabilities to every symbol.
///
/// @author mouser
/// @date   2003.07.29
//---------------------------------------------------------------------------

//---------------------------------------------------------------------------
#include "samplemodeler.hpp"
//---------------------------------------------------------------------------



//---------------------------------------------------------------------------
// MODELLER PUBLIC API
bool SampleModeler::CreateModelUsingParser(OctaneParser *parserp)
	{
	// initialize vector with proper number of symbols as specified by the parser
	int symbolcount=parserp->GetSymbolCount();
	weightvector.SetSymbolCount(symbolcount);

	// set them all equal
	for (int index=0;index<symbolcount;++index)
		weightvector.SetSymbolWeight(index,1);

	// normalize to probability distribution
	weightvector.NormalizeToProbabilityDistribution();

	// success
	return true;
	}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -