📄 dialogs3.cpp
字号:
{
for(i1=0;i1<20;i1++)
{
zt[i1]=45+i1*2;
//////////////////////////
/////////////////////////////////////////////////////
int k=84;
int k1=zt[i1];
//////////////////////////////////////////////////////
int i=0;int count1=0,rjcount1=0;
////////////////////////////////////
LARGE_INTEGER litmp;
LONGLONG qt1,qt2;
double dff;
QueryPerformanceFrequency(&litmp);//获得时钟频率
dff=(double)litmp.QuadPart;
QueryPerformanceCounter(&litmp);//获得初始值
qt1=litmp.QuadPart;
/////////////////////////////////
for(i=100;i<200;i++)
{
int l;
int c2[130];
int c3[150];
int j=0;
for(j=0;j<130;j++)
{
int x1,x2,y1,y2;
x1=*(towp+2*j);y1=*(towp+2*j+1);x2=*(test+2*i);y2=*(test+2*i+1);
*(c2+j)=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}
for(l=0;l<k;l++)
{
for(j=129;j>l;j--)
{
if(c2[j]<c2[j-1])
{
int temp=c2[j-1];
c2[j-1]=c2[j];
c2[j]=temp;
}
}
}
for(j=0;j<150;j++)
{
int x1,x2,y1,y2;
x1=*(threep+2*j);y1=*(threep+2*j+1);x2=*(test+2*i);y2=*(test+2*i+1);
*(c3+j)=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}
for(l=0;l<k;l++)
{
for(j=149;j>l;j--)
{
if(c3[j]<c3[j-1])
{
int temp=c3[j-1];
c3[j-1]=c3[j];
c3[j]=temp;
}
}
}
int r1=0,r2=0,r3=0;int h;
for( h=0;h<k;h++)
{
if(h<130)
{
if(c2[r2]<c3[r3])
{
r2++;
}
if(c3[r3]<c2[r2])
{
r3++;
}
}
else
r3++;
}
if(r2<k1&&r3<k1)rjcount1++;
if(r3>=k1)count1++;
}
/////////////////////////////////
int tt5=0;
for(i=200;i<300;i++)
{
int l;
int c2[130];
int c3[150];
int j=0;
for(j=0;j<130;j++)
{
int x1,x2,y1,y2;
x1=*(towp+2*j);y1=*(towp+2*j+1);x2=*(test+2*i);y2=*(test+2*i+1);
*(c2+j)=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}
for(l=0;l<k;l++)
{
for(j=129;j>l;j--)
{
if(c2[j]<c2[j-1])
{
int temp=c2[j-1];
c2[j-1]=c2[j];
c2[j]=temp;
}
}
}
for(j=0;j<150;j++)
{
int x1,x2,y1,y2;
x1=*(threep+2*j);y1=*(threep+2*j+1);x2=*(test+2*i);y2=*(test+2*i+1);
*(c3+j)=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}
for(l=0;l<k;l++)
{
for(j=149;j>l;j--)
{
if(c3[j]<c3[j-1])
{
int temp=c3[j-1];
c3[j-1]=c3[j];
c3[j]=temp;
}
}
}
int r1=0,r2=0,r3=0;int h;
for(h=0;h<k;h++)
{
if(c2[r2]<c3[r3])
{
r2++;
}
if(c3[r3]<c2[r2])
{
r3++;
}
}
if(r2<k1&&r3<k1)rjcount1++;
if(r2>=k1)count1++;
}
//////////////////////////
ct[i1]=((double)(200-count1-rjcount1))/200;
rt[i1]=((double)(rjcount1))/200;
double runtime;
QueryPerformanceCounter(&litmp);//获得终止值
qt2=litmp.QuadPart;
runtime=(double)(qt2-qt1)/dff;
tt[i1]=runtime;
CString tmp;
tmp.Format("%d",zt[i1]);
m_l2.SetItemText (i1, 0, tmp);
tmp.Format("%3.4f",ct[i1]);
m_l2.SetItemText (i1, 1, tmp);
tmp.Format("%3.4f",rt[i1]);
m_l2.SetItemText (i1, 2, tmp);
tmp.Format("%3.5f",runtime);
m_l2.SetItemText (i1, 3, tmp);
if(i1&2!=0)
{
m_l2.flag[i1]=true;
}
}
}
if(m_b2.down)
{
for(i1=0;i1<20;i1++)
{
zt[i1]=27+i1*14;
//////////////////////////
/////////////////////////////////////////////////////
int k=zt[i1];
int k1=zt[i1]/2+3;
//////////////////////////////////////////////////////
int i=0;int count1=0,rjcount1=0;
////////////////////////////////////
LARGE_INTEGER litmp;
LONGLONG qt1,qt2;
double dff;
QueryPerformanceFrequency(&litmp);//获得时钟频率
dff=(double)litmp.QuadPart;
QueryPerformanceCounter(&litmp);//获得初始值
qt1=litmp.QuadPart;
/////////////////////////////////
for(i=100;i<200;i++)
{
int l;
int c2[130];
int c3[150];
int j=0;
for(j=0;j<130;j++)
{
int x1,x2,y1,y2;
x1=*(towp+2*j);y1=*(towp+2*j+1);x2=*(test+2*i);y2=*(test+2*i+1);
*(c2+j)=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}
for(l=0;l<k;l++)
{
for(j=129;j>l;j--)
{
if(c2[j]<c2[j-1])
{
int temp=c2[j-1];
c2[j-1]=c2[j];
c2[j]=temp;
}
}
}
for(j=0;j<150;j++)
{
int x1,x2,y1,y2;
x1=*(threep+2*j);y1=*(threep+2*j+1);x2=*(test+2*i);y2=*(test+2*i+1);
*(c3+j)=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}
for(l=0;l<k;l++)
{
for(j=149;j>l;j--)
{
if(c3[j]<c3[j-1])
{
int temp=c3[j-1];
c3[j-1]=c3[j];
c3[j]=temp;
}
}
}
int r1=0,r2=0,r3=0;int h;
for( h=0;h<k;h++)
{
if(h<280)
{
if(h<130)
{
if(c2[r2]<c3[r3])
{
r2++;
}
if(c3[r3]<c2[r2])
{
r3++;
}
}
else
r3++;
}
}
if(r2<k1&&r3<k1)rjcount1++;
if(r3>=k1)count1++;
}
/////////////////////////////////
int tt5=0;
for(i=200;i<300;i++)
{
int l;
int c2[130];
int c3[150];
int j=0;
for(j=0;j<130;j++)
{
int x1,x2,y1,y2;
x1=*(towp+2*j);y1=*(towp+2*j+1);x2=*(test+2*i);y2=*(test+2*i+1);
*(c2+j)=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}
for(l=0;l<k;l++)
{
for(j=129;j>l;j--)
{
if(c2[j]<c2[j-1])
{
int temp=c2[j-1];
c2[j-1]=c2[j];
c2[j]=temp;
}
}
}
for(j=0;j<150;j++)
{
int x1,x2,y1,y2;
x1=*(threep+2*j);y1=*(threep+2*j+1);x2=*(test+2*i);y2=*(test+2*i+1);
*(c3+j)=(x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}
for(l=0;l<k;l++)
{
for(j=149;j>l;j--)
{
if(c3[j]<c3[j-1])
{
int temp=c3[j-1];
c3[j-1]=c3[j];
c3[j]=temp;
}
}
}
int r1=0,r2=0,r3=0;int h;
for(h=0;h<k;h++)
{
if(h<280)
{
if(c2[r2]<c3[r3])
{
r2++;
}
if(c3[r3]<c2[r2])
{
r3++;
}
}
}
if(r2<k1&&r3<k1)rjcount1++;
if(r2>=k1)count1++;
}
//////////////////////////
ct[i1]=((double)(200-count1-rjcount1))/200;
rt[i1]=((double)(rjcount1))/200;
double runtime;
QueryPerformanceCounter(&litmp);//获得终止值
qt2=litmp.QuadPart;
runtime=(double)(qt2-qt1)/dff;
tt[i1]=runtime;
CString tmp;
tmp.Format("%d",zt[i1]);
m_l1.SetItemText (i1, 0, tmp);
tmp.Format("%3.4f",ct[i1]);
m_l1.SetItemText (i1, 1, tmp);
tmp.Format("%3.4f",rt[i1]);
m_l1.SetItemText (i1, 2, tmp);
tmp.Format("%3.5f",runtime);
m_l1.SetItemText (i1, 3, tmp);
if(i1&2!=0)
{
m_l1.flag[i1]=true;
}
}
}
m_b3.flagv=false;GetDlgItem(IDC_BUTTON3)->EnableWindow(true);
m_b4.flagv=false;GetDlgItem(IDC_BUTTON4)->EnableWindow(true);
m_b5.flagv=false;GetDlgItem(IDC_BUTTON5)->EnableWindow(true);
}
void CDialogs3::OnButton3()
{
// TODO: Add your control notification handler code here
f3=true;f4=false;f5=false;
if(m_b1.down)
strcpy(m_5.mychar,"k'与准确率的关系曲线");
if(m_b2.down)
{
strcpy(m_5.mychar,"k与准确率的关系曲线");
}
m_b3.down=false;
CRect rectldj;
GetDlgItem(IDC_STATIC2)->GetWindowRect(rectldj);ScreenToClient(rectldj);
InvalidateRect(rectldj,true);
GetDlgItem(IDC_STATIC5)->GetWindowRect(rectldj);ScreenToClient(rectldj);
InvalidateRect(rectldj,true);
}
void CDialogs3::OnButton4()
{
// TODO: Add your control notification handler code here
f4=true;f3=false;f5=false;
if(m_b1.down)
strcpy(m_5.mychar,"k'与拒判率的关系曲线");
if(m_b2.down)
{
strcpy(m_5.mychar,"k与拒判率的关系曲线");
}
m_b4.down=false;
CRect rectldj;
GetDlgItem(IDC_STATIC2)->GetWindowRect(rectldj);ScreenToClient(rectldj);
InvalidateRect(rectldj,true);
GetDlgItem(IDC_STATIC5)->GetWindowRect(rectldj);ScreenToClient(rectldj);
InvalidateRect(rectldj,true);
}
void CDialogs3::OnButton5()
{
// TODO: Add your control notification handler code here
f5=true;f4=false;f3=false;
if(m_b1.down)
strcpy(m_5.mychar," k'与效率的关系曲线");
if(m_b2.down)
{
strcpy(m_5.mychar," k与效率的关系曲线");
}
m_b5.down=false;
CRect rectldj;
GetDlgItem(IDC_STATIC2)->GetWindowRect(rectldj);ScreenToClient(rectldj);
InvalidateRect(rectldj,true);
GetDlgItem(IDC_STATIC5)->GetWindowRect(rectldj);ScreenToClient(rectldj);
InvalidateRect(rectldj,true);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -