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

📄 feiruocodedlg.h

📁 实现费偌
💻 H
字号:
// FeiruoCodeDlg.h : header file
//

#if !defined(AFX_FEIRUOCODEDLG_H__866548BC_7FE5_42DE_B9F6_1FAA8D60EB7F__INCLUDED_)
#define AFX_FEIRUOCODEDLG_H__866548BC_7FE5_42DE_B9F6_1FAA8D60EB7F__INCLUDED_

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

/////////////////////////////////////////////////////////////////////////////
// CFeiruoCodeDlg dialog
class Node
{
public:
	char symbol;
	Node * pLeft;
	Node * pRight;
};

class InputArray
{
public:
	char symbol;
	double probality;
	Node *addr;
};

class Result
{
public:
	char symbol;
	int codelen;
	char binarycode[8];
};

class CFeiruoCodeDlg : public CDialog
{
// Construction
public:
	void Traverse(Node *Tree,int depth);
	void HafuCode();
	int symbol[8];//符号数组
	double probablity[8];//概率数组
	double pshang[8];//每个符号概率所对应的熵
	double shanoopsum[8];//香农编码中每个概率

	//代码组的长度
	int feinuocodelen[8];
	int Hafucodelen[8];
	int Shanoocodelen[8];

	//二进制代码表示
	CString feinuobinarycode[8];
	CString Hafubinarycode[8];
	CString Shanoobinarycode[8];

	int feinuocode(int low,int high);//定义递归函数来实现费偌编码
	CFeiruoCodeDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CFeiruoCodeDlg)
	enum { IDD = IDD_FEIRUOCODE_DIALOG };
	int		m_symbol1;
	int		m_symbol2;
	int		m_symbol3;
	int		m_symbol4;
	int		m_symbol5;
	int		m_symbol8;
	int		m_symbol7;
	int		m_symbol6;
	double	m_dPXinxiLiang1;
	double	m_dPXinxiLiang2;
	double	m_dPXinxiLiang3;
	double	m_dPXinxiLiang4;
	double	m_dPXinxiLiang5;
	double	m_dPXinxiLiang6;
	double	m_dPXinxiLiang7;
	double	m_dPXinxiLiang8;
	double	m_dProbabilty1;
	double	m_dProbabilty2;
	double	m_dProbabilty3;
	double	m_dProbabilty4;
	double	m_dProbabilty5;
	double	m_dProbabilty6;
	double	m_dProbabilty7;
	double	m_dProbabilty8;
	CString	m_strAfterCode;
	CString	m_strBeforeCode;
	double	m_dFeinuoAvgCodeLen;
	CString	m_strFeinuoBinaryCode1;
	CString	m_strFeinuoBinaryCode2;
	CString	m_strFeinuoBinaryCode3;
	CString	m_strFeinuoBinaryCode4;
	CString	m_strFeinuoBinaryCode5;
	CString	m_strFeinuoBinaryCode6;
	CString	m_strFeinuoBinaryCode7;
	CString	m_strFeinuoBinaryCode8;
	double	m_dFeinuoCodeEff;
	int		m_FeinuoCodeLen1;
	int		m_FeinuoCodeLen2;
	int		m_FeinuoCodeLen3;
	int		m_FeinuoCodeLen4;
	int		m_FeinuoCodeLen5;
	int		m_FeinuoCodeLen6;
	int		m_FeinuoCodeLen7;
	int		m_FeinuoCodeLen8;
	double	m_dHafuAvgCodeLen;
	CString	m_strHafuBinaryCode1;
	CString	m_strHafuBinaryCode2;
	CString	m_strHafuBinaryCode3;
	CString	m_strHafuBinaryCode4;
	CString	m_strHafuBinaryCode5;
	CString	m_strHafuBinaryCode6;
	CString	m_strHafuBinaryCode7;
	CString	m_strHafuBinaryCode8;
	double	m_dHafuCodeEff;
	int		m_HafuCodeLen1;
	int		m_HafuCodeLen2;
	int		m_HafuCodeLen3;
	int		m_HafuCodeLen4;
	int		m_HafuCodeLen5;
	int		m_HafuCodeLen6;
	int		m_HafuCodeLen7;
	int		m_HafuCodeLen8;
	double	m_dShanooAvgCodeLen;
	CString	m_strShanooBinaryCode1;
	CString	m_strShanooBinaryCode2;
	CString	m_strShanooBinaryCode3;
	CString	m_strShanooBinaryCode4;
	CString	m_strShanooBinaryCode5;
	CString	m_strShanooBinaryCode6;
	CString	m_strShanooBinaryCode7;
	CString	m_strShanooBinaryCode8;
	double	m_dShanoocodeEff;
	int		m_ShanooCodeLen1;
	int		m_ShanooCodeLen2;
	int		m_ShanooCodeLen3;
	int		m_ShanooCodeLen4;
	int		m_ShanooCodeLen5;
	int		m_ShanooCodeLen6;
	int		m_ShanooCodeLen7;
	int		m_ShanooCodeLen8;
	double	m_dShanooPSum1;
	double	m_dShanooPSum2;
	double	m_dShanooPSum3;
	double	m_dShanooPSum4;
	double	m_dShanooPSum5;
	double	m_dShanooPSum6;
	double	m_dShanooPSum7;
	double	m_dShanooPSum8;
	double	m_dSorceShang;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CFeiruoCodeDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL

// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	//{{AFX_MSG(CFeiruoCodeDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnBautodistubte();
	afx_msg void OnBbegincode();
	afx_msg void OnBhelp();
	afx_msg void OnBclear();
	afx_msg void OnBabout();
	afx_msg void OnBexit();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_FEIRUOCODEDLG_H__866548BC_7FE5_42DE_B9F6_1FAA8D60EB7F__INCLUDED_)

⌨️ 快捷键说明

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