📄 kbdaretrieval.cpp
字号:
// KBDAretrieval.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include "KBDAretrieval.h"
#include "ProcessControl.h"
#include "MatrixCompute.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
// 唯一的应用程序对象
extern int numofoneclass[MAXCLASSNUM];
extern int allclassobjectmembers[MAXCLASSNUM][MAXOBJECTNUM];
extern int positivenum;
extern int negativenum;
extern int pandnnum;
extern int round;
CWinApp theApp;
using namespace std;
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
// 初始化 MFC 并在失败时显示错误
if (!AfxWinInit(::GetModuleHandle(NULL), NULL, ::GetCommandLine(), 0))
{
// TODO: 更改错误代码以符合您的需要
_tprintf(_T("致命错误: MFC 初始化失败\n"));
nRetCode = 1;
}
else
{
// TODO: 在此处为应用程序的行为编写代码。
CProcessControl processcontrolobject;
processcontrolobject.readalllabelsfromfile("train.txt");
processcontrolobject.readallfeaturesfromfile("featuresinfile.txt");
cout<<"Load Complete!"<<endl;
CMatrixCompute matrixcomputeobject;
cout<<"Kernel Matrix Compute Complete!"<<endl;
int classnum = 0,objectpos = 0;
for (classnum=0;classnum<MAXCLASSNUM;classnum++)//对所有类遍历
{
for (objectpos=0;objectpos<numofoneclass[classnum];objectpos++)//对类中模型遍历
{
processcontrolobject.firstcomputedistance(allclassobjectmembers[classnum][objectpos]);
pandnnum = 0;
positivenum = 0;
negativenum = 0;
for (round=0;round<ROUNDNUM;round++)
{
processcontrolobject.labelretrieval(classnum);
matrixcomputeobject.computeKx();
matrixcomputeobject.computeKy();
matrixcomputeobject.computeSbSw();
matrixcomputeobject.computetransformmatrix();
matrixcomputeobject.computenewfeaturematrix();
processcontrolobject.newcomputedistance(allclassobjectmembers[classnum][objectpos]);
}
cout<<allclassobjectmembers[classnum][objectpos]<<endl;
}
}
}
return nRetCode;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -