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

📄 pr_exerciseview.h

📁 模式识别中的K近邻法和快速K近邻法的VC++实现
💻 H
字号:
// PR_exerciseView.h : interface of the CPR_exerciseView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_PR_EXERCISEVIEW_H__78478F3B_759E_42C7_9CAE_4E5BDD59B80A__INCLUDED_)
#define AFX_PR_EXERCISEVIEW_H__78478F3B_759E_42C7_9CAE_4E5BDD59B80A__INCLUDED_

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

#define MAX_TOTAL 2000
#define MAX_DIMENSION 100


class CPR_exerciseView : public CEditView
{
protected: // create from serialization only
	CPR_exerciseView();
	DECLARE_DYNCREATE(CPR_exerciseView)

// Attributes
public:
	CPR_exerciseDoc* GetDocument();
	float samples[MAX_TOTAL][MAX_DIMENSION];
// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CPR_exerciseView)
	public:
	virtual void OnDraw(CDC* pDC);  // overridden to draw this view
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	protected:
	virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
	virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
	virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
	//}}AFX_VIRTUAL

// Implementation
public:
	CString dataSamples;
	virtual ~CPR_exerciseView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
	//{{AFX_MSG(CPR_exerciseView)
	afx_msg void OnDataCreate();
	afx_msg void OnKnearest();
	afx_msg void OnFastKnearest();
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
private:
	void OutputClassifyResult(int* &nearestCls, int refusePoint);
	void SamplesDecompose(float* &distance, float** &means, float** &allDistance);
	void GenerateTestSample();
	int nearestClass;
	float * testSample;
	int kNearestNum;
	int dataTotal;
	int dimen;
	int classNum;
};

#ifndef _DEBUG  // debug version in PR_exerciseView.cpp
inline CPR_exerciseDoc* CPR_exerciseView::GetDocument()
   { return (CPR_exerciseDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////

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

#endif // !defined(AFX_PR_EXERCISEVIEW_H__78478F3B_759E_42C7_9CAE_4E5BDD59B80A__INCLUDED_)

⌨️ 快捷键说明

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