在下有个关于容器问题想请教大家!!
CHaulm theHaulm1,theHaulm2;
vector<CHaulm>::iterator it1,it2;
for (i=0; i<NHC; i++)
{
for (int j=0; j<NLC; j++)
{
for (int k=0; k<NWC; k++)
{
if (DummyCell[i][j][k]>=2)
{
for (m=0; m<DummyCell[i][j][k]; m++)
{
R=(rand()%1000)/1000.0;
n=static_cast<int>(R*DummyCell[i][j][k])+1;
for (it1=m_HaulmArray.begin(); it1!=m_HaulmArray.end(); it1++)
{
if (i==theHaulm1.GSN[0] && j==theHaulm1.GSN[1] && k==theHaulm1.GSN[2] && m==theHaulm1.HSN)
{
cout<<"CollisionVerdict.\n";
theHaulm1=*it1;
for (it2=m_HaulmArray.begin();it2!=m_HaulmArray.end(); it2++)
{
if (i==theHaulm2.GSN[0] && j==theHaulm2.GSN[1] && k==theHaulm2.GSN[2] && n==theHaulm2.HSN)
{
theHaulm2=*it2;
Vx=theHaulm1.vx-theHaulm2.vx;
Vy=theHaulm1.vy-theHaulm2.vy;
Vz=theHaulm1.vz-theHaulm2.vz;
Um=sqrt(Vx*Vx+Vy*Vy+Vz*Vz);
Pr=Nsubstitute/(pow(Multiple,3)*nHeight*nLength*nWidth)*theHaulm1.l*(theHaulm1.d+theHaulm2.d)*Um*T;
if (R>n/static_cast<double>(DummyCell[i][j][k])-Pr && n!=m)
{
CHaulm& theHaulmRef1 = *it1;
CHaulm& theHaulmRef2 = *it2;
HaulmCollision::BodyCollision(theHaulmRef1,theHaulmRef2);
}
}
}
}
}
}
}
}
}
}
在下想知道为什么程序不能进入if (i==theHaulm1.GSN[0] && j==theHaulm1.GSN[1] && k==theHaulm1.GSN[2] && m==theHaulm1.HSN),问题出在哪?谢谢您的帮助!