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

📄 model.h

📁 有关几个数字编码的C++ 程序
💻 H
字号:
// Model.h: interface for the CModel class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_MODEL_H__FEA8F0E8_75C2_4404_A9A0_10F6F0B1701E__INCLUDED_)
#define AFX_MODEL_H__FEA8F0E8_75C2_4404_A9A0_10F6F0B1701E__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// the set of symbols that may be encoded
#define nof_chars 256			// number of character symbols
#define EOF_symbol (nof_chars+1)	// index of EOF symbol
#define nof_symbols (nof_chars+1)	// total number of symbols

// max frequency count
#define max_frequency 16383

class CModel
{
public:
    int freq[nof_symbols+1];

    // translation tables between characters and symbol indexes
    int char_to_index[nof_chars];
    unsigned char index_to_char[nof_chars+1];

    // cummulative frequency table
    int cum_freq[nof_symbols+1];

public: 
    CModel();
    ~CModel();
    void start();
    void update(int symbol);

};

#endif // !defined(AFX_MODEL_H__FEA8F0E8_75C2_4404_A9A0_10F6F0B1701E__INCLUDED_)

⌨️ 快捷键说明

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