| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2264 人关注过本帖
标题:求解决“堆栈溢出”的问题
只看楼主 加入收藏
邱寻
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2016-10-15
结帖率:0
收藏
已结贴  问题点数:20 回复次数:4 
求解决“堆栈溢出”的问题
我编了如下一个关于格点QCD数值计算的C++程序,运行时出现问题,提示“.exe停止工作”,调试程序时提示“unhandled exeption in 复件QCD.exe:0xC00000FD:Stack overflow”,求高手指点程序怎样编辑才能避免“堆栈溢出”。我的有问题的程序是

#include "iostream.h"
#include "math.h"
#include <stdlib.h>
#include "stdio.h"
#include "time.h"


  double RANAB(double A,double B)
{double X;
  X = double(rand())/double(RAND_MAX);
  X = (B - A) * X + A;
  return (X);
}


int randn(int n)  
{  
    int max = RAND_MAX - RAND_MAX % n;  
    int x;  
    do  
    {  
        x = rand();  
  
    }while ( x >= max );  
    return x % n;  
}


void main()
{
    //program d3r1
    //driver for routine trapzd
int n,n1,m,m1,m2,Nt,Nr,N,N2,i,i1,j,j1,k,k1;
Nt=10;Nr=10;N=100;
    double Y[50],A1,D1,C1,h,hr,R0[4][10][10][10][10],R1[4][10][10][10][10],
        I0[4][10][10][10][10],I1[4][10][10][10][10],B0[3][10][10][10][10],B1[3][10][10][10][10],
        PB0[3][10][10][10][10],PB1[3][10][10][10][10],
        S0,S1,g1;
   
 
 h = 0.1;
hr = 0.1;g1=0.002;   
   for (n = 0; n<=Nr-1; n++)
    {
    for (i = 0; i<=Nr-1; i++)
    {
for (j = 0; j<=Nr-1; j++)
    {
for (k = 0; k<=Nr-1; k++)
    {
for (i1 = 0; i1<=3; i1++)
    {
        R0[i1][n][i][j][k]=1.2;
   I0[i1][n][i][j][k]=1.2;
        

}
for (j1 =0; j1<=2; j1++)
    {
B0[j1][n][i][j][k]=1.2;
        PB0[j1][n][i][j][k]=1.2;
}
}
}
    }
    }
     


  



S0=0;
   for (n = 0; n<=Nr-1; n++)
    {
    for (i = 0; i<=Nr-1; i++)
    {
for (j = 0; j<=Nr-1; j++)
    {
for (k = 0; k<=Nr-1; k++)
    {

      S0=S0-(0.5*(R0[0][n+2][i][j][k]*R0[0][n+2][i][j][k]+R0[1][n+2][i][j][k]*R0[1][n+2][i][j][k]+R0[2][n+2][i][j][k]*R0[2][n+2][i][j][k]+R0[3][n+2][i][j][k]*R0[3][n+2][i][j][k]+I0[0][n+2][i][j][k]*I0[0][n+2][i][j][k]+I0[1][n+2][i][j][k]*I0[1][n+2][i][j][k]+I0[2][n+2][i][j][k]*I0[2][n+2][i][j][k]+I0[3][n+2][i][j][k]*I0[3][n+2][i][j][k])-4*(R0[0][n+1][i][j][k]*R0[0][n+1][i][j][k]+R0[1][n+1][i][j][k]*R0[1][n+1][i][j][k]+R0[2][n+1][i][j][k]*R0[2][n+1][i][j][k]+R0[3][n+1][i][j][k]*R0[3][n+1][i][j][k]+I0[0][n+1][i][j][k]*I0[0][n+1][i][j][k]+I0[1][n+1][i][j][k]*I0[1][n+1][i][j][k]+I0[2][n+1][i][j][k]*I0[2][n+1][i][j][k]+I0[3][n+1][i][j][k]*I0[3][n+1][i][j][k])+4*(R0[0][n-1][i][j][k]*R0[0][n-1][i][j][k]+R0[1][n-1][i][j][k]*R0[1][n-1][i][j][k]+R0[2][n-1][i][j][k]*R0[2][n-1][i][j][k]+R0[3][n-1][i][j][k]*R0[3][n-1][i][j][k]+I0[0][n-1][i][j][k]*I0[0][n-1][i][j][k]+I0[1][n-1][i][j][k]*I0[1][n-1][i][j][k]+I0[2][n-1][i][j][k]*I0[2][n-1][i][j][k]+I0[3][n-1][i][j][k]*I0[3][n-1][i][j][k])-0.5*(R0[0][n-2][i][j][k]*R0[0][n-2][i][j][k]+R0[1][n-2][i][j][k]*R0[1][n-2][i][j][k]+R0[2][n-2][i][j][k]*R0[2][n-2][i][j][k]+R0[3][n-2][i][j][k]*R0[3][n-2][i][j][k]+I0[0][n-2][i][j][k]*I0[0][n-2][i][j][k]+I0[1][n-2][i][j][k]*I0[1][n-2][i][j][k]+I0[2][n-2][i][j][k]*I0[2][n-2][i][j][k]+I0[3][n-2][i][j][k]*I0[3][n-2][i][j][k])-(I0[0][n][i][j+2][k]*R0[3][n][i][j+2][k]+I0[2][n][i][j+2][k]*R0[1][n][i][j+2][k]-I0[3][n][i][j+2][k]*R0[0][n][i][j+2][k]-I0[1][n][i][j+2][k]*R0[2][n][i][j+2][k])+8*(I0[0][n][i][j+1][k]*R0[3][n][i][j+1][k]+I0[2][n][i][j+1][k]*R0[1][n][i][j+1][k]-I0[3][n][i][j+1][k]*R0[0][n][i][j+1][k]-I0[1][n][i][j+1][k]*R0[2][n][i][j+1][k])-8*(I0[0][n][i][j-1][k]*R0[3][n][i][j-1][k]+I0[2][n][i][j-1][k]*R0[1][n][i][j-1][k]-I0[3][n][i][j-1][k]*R0[0][n][i][j-1][k]-I0[1][n][i][j-1][k]*R0[2][n][i][j-1][k])+(I0[0][n][i][j-2][k]*R0[3][n][i][j-2][k]+I0[2][n][i][j-2][k]*R0[1][n][i][j-2][k]-I0[3][n][i][j-2][k]*R0[0][n][i][j-2][k]-I0[1][n][i][j-2][k]*R0[2][n][i][j-2][k])+(R0[0][n][i+2][j][k]*R0[3][n][i+2][j][k]+I0[0][n][i+2][j][k]*I0[3][n][i+2][j][k]+R0
[1][n][i+2][j][k]*R0[2][n][i+2][j][k]+I0[1][n][i+2][j][k]*I0[2][n][i+2][j][k])-8*(R0[0][n][i+1][j][k]*R0[3][n][i+1][j][k]+I0[0][n][i+1][j][k]*I0[3][n][i+1][j][k]+R0[1][n][i+1][j][k]*R0[2][n][i+1][j][k]+I0[1][n][i+1][j][k]*I0[2][n][i+1][j][k])+8*(R0[0][n][i-1][j][k]*R0[3][n][i-1][j][k]+I0[0][n][i-1][j][k]*I0[3][n][i-1][j][k]+R0[1][n][i-1][j][k]*R0[2][n][i-1][j][k]+I0[1][n][i-1][j][k]*I0[2][n][i-1][j][k])-(R0[0][n][i-2][j][k]*R0[3][n][i-2][j][k]+I0[0][n][i-2][j][k]*I0[3][n][i-2][j][k]+R0[1][n][i-2][j][k]*R0[2][n][i-2][j][k]+I0[1][n][i-2][j][k]*I0[2][n][i-2][j][k])-(R0[1][n][i][j][k+2]*R0[3][n][i][j][k+2]+I0[1][n][i][j][k+2]*I0[3][n][i][j][k+2]-R0[0][n][i][j][k+2]*R0[2][n][i][j][k+2]-I0[0][n][i][j][k+2]*I0[2][n][i][j][k+2])+8*(R0[1][n][i][j][k+1]*R0[3][n][i][j][k+1]+I0[1][n][i][j][k+1]*I0[3][n][i][j][k+1]-R0[0][n][i][j][k+1]*R0[2][n][i][j][k+1]-I0[0][n][i][j][k+1]*I0[2][n][i][j][k+1])-8*(R0[1][n][i][j][k-1]*R0[3][n][i][j][k-1]+I0[1][n][i][j][k-1]*I0[3][n][i][j][k-1]-R0[0][n][i][j][k-1]*R0[2][n][i][j][k-1]-I0[0][n][i][j][k-1]*I0[2][n][i][j][k-1])+(R0[1][n][i][j][k-2]*R0[3][n][i][j][k-2]+I0[1][n][i][j][k-2]*I0[3][n][i][j][k-2]-R0[0][n][i][j][k-2]*R0[2][n][i][j][k-2]-I0[0][n][i][j][k-2]*I0[2][n][i][j][k-2]))*pow(h,3)/12-(-B0[0][n][i][j][k]*(R0[0][n][i][j][k]*R0[3][n][i][j][k]+I0[0][n][i][j][k]*I0[3][n][i][j][k]+R0[1][n][i][j][k]*R0[2][n][i][j][k]+I0[1][n][i][j][k]*I0[2][n][i][j][k])+B0[1][n][i][j][k]*(-R0[0][n][i][j][k]*I0[3][n][i][j][k]+I0[0][n][i][j][k]*R0[3][n][i][j][k]+R0[1][n][i][j][k]*I0[2][n][i][j][k]-I0[1][n][i][j][k]*R0[2][n][i][j][k])+B0[2][n][i][j][k]*(-R0[0][n][i][j][k]*R0[2][n][i][j][k]-I0[0][n][i][j][k]*I0[2][n][i][j][k]+R0[1][n][i][j][k]*R0[3][n][i][j][k]+I0[1][n][i][j][k]*I0[3][n][i][j][k]))*2*g1*pow(h,4)-(pow(-B0[0][n+2][i][j][k]+8*B0[0][n+1][i][j][k]-8*B0[0][n-1][i][j][k]+B0[0][n-2][i][j][k],2)+pow(-B0[1][n+2][i][j][k]+8*B0[1][n+1][i][j][k]-8*B0[1][n-1][i][j][k]+B0[1][n-2][i][j][k],2)+pow(-B0[2][n+2][i][j][k]+8*B0[2][n+1][i][j][k]-8*B0[2][n-1][i][j][k]+B0[2][n-2][i][j][k],2)-pow(-B0[1][2][i+2][j][k]+8
*B0[1][n][i+1][j][k]-8*B0[1][n][i-1][j][k]+B0[1][n][i-2][j][k]+B0[0][2][i][j+2][k]-8*B0[0][n][i][j+1][k]+8*B0[0][n][i][j-1][k]-B0[0][n][i][j-2][k],2)-pow(-B0[2][2][i+2][j][k]+8*B0[2][n][i+1][j][k]-8*B0[2][n][i-1][j][k]+B0[2][n][i-2][j][k]+B0[0][2][i][j][k+2]-8*B0[0][n][i][j][k+1]+8*B0[0][n][i][j][k-1]-B0[0][n][i][j][k-2],2)-pow(-B0[2][2][i][j+2][k]+8*B0[2][n][i][j+1][k]-8*B0[2][n][i][j-1][k]+B0[2][n][i][j-2][k]+B0[1][2][i][j][k+2]-8*B0[1][n][i][j][k+1]+8*B0[1][n][i][j][k-1]-B0[1][n][i][j][k-2],2))*pow(h,2)/288;
}
    }
    }
    }
m1=0;
m=0;

C1=2.4903;
A1=-C1;D1=C1;
N2=50;

goal1:
for (i1 = 0; i1<N2; i1++)
    {
Y[i1]=1+RANAB(A1,D1);
}
n1 = randn(N2);

  for (n = 0; n<Nr-1; n++)
    {
for (i = 0; i<Nr-1; i++)
    {
for (j = 0; j<Nr-1; j++)
    {
for (k = 0; k<Nr-1; k++)
    {
for (i1 = 0; i1<=3; i1++)
    {
        R1[i1][n][i][j][k]=Y[n1]*R0[i1][n][i][j][k];

R1[i1][Nr-1][i][j][k]=R1[i1][0][i][j][k] ;
R1[i1][n][Nr-1][j][k]=R1[i1][n][0][j][k];
R1[i1][n][i][Nr-1][k]=R1[i1][n][i][0][k];
R1[i1][n][i][j][Nr-1]=R1[i1][n][i][j][0];

R1[i1][0][Nr-1][j][k]=Y[n1]*R0[i1][0][Nr-1][j][k] ;
R1[i1][Nr-1][Nr-1][j][k]=R1[i1][0][Nr-1][j][k] ;

R1[i1][0][i][Nr-1][k]=Y[n1]*R0[i1][0][i][Nr-1][k] ;
R1[i1][Nr-1][i][Nr-1][k]=R1[i1][0][i][Nr-1][k] ;

R1[i1][0][i][j][Nr-1]=Y[n1]*R0[i1][0][i][j][Nr-1] ;
R1[i1][Nr-1][i][j][Nr-1]=R1[i1][0][i][j][Nr-1] ;

R1[i1][0][Nr-1][Nr-1][k]=Y[n1]*R0[i1][0][Nr-1][Nr-1][k] ;
R1[i1][Nr-1][Nr-1][Nr-1][k]=R1[i1][0][Nr-1][Nr-1][k] ;

R1[i1][0][Nr-1][j][Nr-1]=Y[n1]*R0[i1][0][Nr-1][j][Nr-1] ;
R1[i1][Nr-1][Nr-1][j][Nr-1]=R1[i1][0][Nr-1][j][Nr-1] ;

R1[i1][0][i][Nr-1][Nr-1]=Y[n1]*R0[i1][0][i][Nr-1][Nr-1] ;
R1[i1][Nr-1][i][Nr-1][Nr-1]=R1[i1][0][i][Nr-1][Nr-1] ;

R1[i1][0][Nr-1][Nr-1][Nr-1]=Y[n1]*R0[i1][0][Nr-1][Nr-1][Nr-1] ;
R1[i1][Nr-1][Nr-1][Nr-1][Nr-1]=R1[i1][0][Nr-1][Nr-1][Nr-1] ;

R1[i1][Nr-1][0][j][k]=Y[n1]*R0[i1][Nr-1][0][j][k];
R1[i1][Nr-1][Nr-1][j][k]=R1[i1][Nr-1][0][j][k];

R1[i1][n][0][Nr-1][k]=Y[n1]*R0[i1][n][0][Nr-1][k];
R1[i1][n][Nr-1][Nr-1][k]=R1[i1][n][0][Nr-1][k];

R1[i1][n][0][j][Nr-1]=Y[n1]*R0[i1][n][0][j][Nr-1];
R1[i1][n][Nr-1][j][Nr-1]=R1[i1][n][0][j][Nr-1];

R1[i1][Nr-1][0][Nr-1][k]=Y[n1]*R0[i1][Nr-1][0][Nr-1][k];
R1[i1][Nr-1][Nr-1][Nr-1][k]=R1[i1][Nr-1][0][Nr-1][k];

R1[i1][Nr-1][0][j][Nr-1]=Y[n1]*R0[i1][Nr-1][0][j][Nr-1];
R1[i1][Nr-1][Nr-1][j][Nr-1]=R1[i1][Nr-1][0][j][Nr-1];

R1[i1][n][0][Nr-1][Nr-1]=Y[n1]*R0[i1][n][0][Nr-1][Nr-1];
R1[i1][n][Nr-1][Nr-1][Nr-1]=R1[i1][n][0][Nr-1][Nr-1];

R1[i1][Nr-1][0][Nr-1][Nr-1]=Y[n1]*R0[i1][Nr-1][0][Nr-1][Nr-1];
R1[i1][Nr-1][Nr-1][Nr-1][Nr-1]=R1[i1][Nr-1][0][Nr-1][Nr-1];

R1[i1][Nr-1][i][0][k]=Y[n1]*R0[i1][Nr-1][i][0][k];
R1[i1][Nr-1][i][Nr-1][k]=R1[i1][Nr-1][i][0][k];

R1[i1][n][Nr-1][0][k]=Y[n1]*R0[i1][n][Nr-1][0][k];
R1[i1][n][Nr-1][Nr-1][k]=R1[i1][n][Nr-1][0][k];

R1[i1][n][i][0][Nr-1]=Y[n1]*R0[i1][n][i][0][Nr-1];
R1[i1][n][i][Nr-1][Nr-1]=R1[i1][n][i][0][Nr-1];

R1[i1][Nr-1][Nr-1][0][k]=Y[n1]*R0[i1][Nr-1][Nr-1][0][k];
R1[i1][Nr-1][Nr-1][Nr-1][k]=R1[i1][Nr-1][Nr-1][0][k];

R1[i1][Nr-1][i][0][Nr-1]=Y[n1]*R0[i1][Nr-1][i][0][Nr-1];
R1[i1][Nr-1][i][Nr-1][Nr-1]=R1[i1][Nr-1][i][0][Nr-1];

R1[i1][n][Nr-1][0][Nr-1]=Y[n1]*R0[i1][n][Nr-1][0][Nr-1];
R1[i1][n][Nr-1][Nr-1][Nr-1]=R1[i1][n][Nr-1][0][Nr-1];

R1[i1][Nr-1][Nr-1][0][Nr-1]=Y[n1]*R0[i1][Nr-1][Nr-1][0][Nr-1];
R1[i1][Nr-1][Nr-1][Nr-1][Nr-1]=R1[i1][Nr-1][Nr-1][0][Nr-1];

R1[i1][Nr-1][i][j][0]=Y[n1]*R0[i1][Nr-1][i][j][0];
R1[i1][Nr-1][i][j][Nr-1]=R1[i1][Nr-1][i][j][0];

R1[i1][n][Nr-1][j][0]=Y[n1]*R0[i1][n][Nr-1][j][0];
R1[i1][n][Nr-1][j][Nr-1]=R1[i1][n][Nr-1][j][0];

R1[i1][n][i][Nr-1][0]=Y[n1]*R0[i1][n][i][Nr-1][0];
R1[i1][n][i][Nr-1][Nr-1]=R1[i1][n][i][Nr-1][0];

R1[i1][Nr-1][Nr-1][j][0]=Y[n1]*R0[i1][Nr-1][Nr-1][j][0];
R1[i1][Nr-1][Nr-1][j][Nr-1]=R1[i1][Nr-1][Nr-1][j][0];

R1[i1][Nr-1][i][Nr-1][0]=Y[n1]*R0[i1][Nr-1][i][Nr-1][0];
R1[i1][Nr-1][i][Nr-1][Nr-1]=R1[i1][Nr-1][i][Nr-1][0];

R1[i1][n][Nr-1][Nr-1][0]=Y[n1]*R0[i1][n][Nr-1][Nr-1][0];
R1[i1][n][Nr-1][Nr-1][Nr-1]=R1[i1][n][Nr-1][Nr-1][0];

R1[i1][Nr-1][Nr-1][Nr-1][0]=Y[n1]*R0[i1][Nr-1][Nr-1][Nr-1][0];
R1[i1][Nr-1][Nr-1][Nr-1][Nr-1]=R1[i1][Nr-1][Nr-1][Nr-1][0];

I1[i1][n][i][j][k]=Y[n1]*I0[i1][n][i][j][k];

 I1[i1][Nr-1][i][j][k]=I1[i1][0][i][j][k] ;
I1[i1][n][Nr-1][j][k]=I1[i1][n][0][j][k];
I1[i1][n][i][Nr-1][k]=I1[i1][n][i][0][k];
I1[i1][n][i][j][Nr-1]=I1[i1][n][i][j][0];

I1[i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-1][Nr-1][Nr-1]=I1[i1][Nr-1][Nr-1][0][Nr-1];

I1[i1][Nr-1][i][j][0]=Y[n1]*I0[i1][Nr-1][i][j][0];
I1[i1][Nr-1][i][j][Nr-1]=I1[i1][Nr-1][i][j][0];

I1[i1][n][Nr-1][j][0]=Y[n1]*I0[i1][n][Nr-1][j][0];
I1[i1][n][Nr-1][j][Nr-1]=I1[i1][n][Nr-1][j][0];

I1[i1][n][i][Nr-1][0]=Y[n1]*I0[i1][n][i][Nr-1][0];
I1[i1][n][i][Nr-1][Nr-1]=I1[i1][n][i][Nr-1][0];

I1[i1][Nr-1][Nr-1][j][0]=Y[n1]*I0[i1][Nr-1][Nr-1][j][0];
I1[i1][Nr-1][Nr-1][j][Nr-1]=I1[i1][Nr-1][Nr-1][j][0];

I1[i1][Nr-1][i][Nr-1][0]=Y[n1]*I0[i1][Nr-1][i][Nr-1][0];
I1[i1][Nr-1][i][Nr-1][Nr-1]=I1[i1][Nr-1][i][Nr-1][0];

I1[i1][n][Nr-1][Nr-1][0]=Y[n1]*I0[i1][n][Nr-1][Nr-1][0];
I1[i1][n][Nr-1][Nr-1][Nr-1]=I1[i1][n][Nr-1][Nr-1][0];

I1[i1][Nr-1][Nr-1][Nr-1][0]=Y[n1]*I0[i1][Nr-1][Nr-1][Nr-1][0];
I1[i1][Nr-1][Nr-1][Nr-1][Nr-1]=I1[i1][Nr-1][Nr-1][Nr-1][0];

}
for (j1 =0; j1<=2; j1++)
    {
B1[j1][n][i][j][k]=Y[n1]*B0[j1][n][i][j][k];

B1[j1][Nr-1][i][j][k]=B1[j1][0][i][j][k] ;
B1[j1][n][Nr-1][j][k]=B1[j1][n][0][j][k];
B1[j1][n][i][Nr-1][k]=B1[j1][n][i][0][k];
B1[j1][n][i][j][Nr-1]=B1[j1][n][i][j][0];

B1[j1][0][Nr-1][j][k]=Y[n1]*B0[j1][0][Nr-1][j][k] ;
B1[j1][Nr-1][Nr-1][j][k]=B1[j1][0][Nr-1][j][k] ;

B1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1[j1][Nr-1][i][j][Nr-1]=B1[j1][Nr-1][i][j][0];

B1[j1][n][Nr-1][j][0]=Y[n1]*B0[j1][n][Nr-1][j][0];
B1[j1][n][Nr-1][j][Nr-1]=B1[j1][n][Nr-1][j][0];

B1[j1][n][i][Nr-1][0]=Y[n1]*B0[j1][n][i][Nr-1][0];
B1[j1][n][i][Nr-1][Nr-1]=B1[j1][n][i][Nr-1][0];

B1[j1][Nr-1][Nr-1][j][0]=Y[n1]*B0[j1][Nr-1][Nr-1][j][0];
B1[j1][Nr-1][Nr-1][j][Nr-1]=B1[j1][Nr-1][Nr-1][j][0];

B1[j1][Nr-1][i][Nr-1][0]=Y[n1]*B0[j1][Nr-1][i][Nr-1][0];
B1[j1][Nr-1][i][Nr-1][Nr-1]=B1[j1][Nr-1][i][Nr-1][0];

B1[j1][n][Nr-1][Nr-1][0]=Y[n1]*B0[j1][n][Nr-1][Nr-1][0];
B1[j1][n][Nr-1][Nr-1][Nr-1]=B1[j1][n][Nr-1][Nr-1][0];

B1[j1][Nr-1][Nr-1][Nr-1][0]=Y[n1]*B0[j1][Nr-1][Nr-1][Nr-1][0];
B1[j1][Nr-1][Nr-1][Nr-1][Nr-1]=B1[j1][Nr-1][Nr-1][Nr-1][0];
  

        PB1[j1][n][i][j][k]=Y[n1]*PB0[j1][n][i][j][k];

 PB1[j1][Nr-1][i][j][k]=PB1[j1][0][i][j][k] ;
PB1[j1][n][Nr-1][j][k]=PB1[j1][n][0][j][k];
PB1[j1][n][i][Nr-1][k]=PB1[j1][n][i][0][k];
PB1[j1][n][i][j][Nr-1]=PB1[j1][n][i][j][0];

PB1[j1][0][Nr-1][j][k]=Y[n1]*PB0[j1][0][Nr-1][j][k] ;
PB1[j1][Nr-1][Nr-1][j][k]=PB1[j1][0][Nr-1][j][k] ;

PB1[j1][0][i][Nr-1][k]=Y[n1]*PB0[j1][0][i][Nr-1][k] ;
PB1[j1][Nr-1][i][Nr-1][k]=PB1[j1][0][i][Nr-1][k] ;

PB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][j][Nr-1]=PB1[j1][Nr-1][i][j][0];

PB1[j1][n][Nr-1][j][0]=Y[n1]*PB0[j1][n][Nr-1][j][0];
PB1[j1][n][Nr-1][j][Nr-1]=PB1[j1][n][Nr-1][j][0];

PB1[j1][n][i][Nr-1][0]=Y[n1]*PB0[j1][n][i][Nr-1][0];
PB1[j1][n][i][Nr-1][Nr-1]=PB1[j1][n][i][Nr-1][0];

PB1[j1][Nr-1][Nr-1][j][0]=Y[n1]*PB0[j1][Nr-1][Nr-1][j][0];
PB1[j1][Nr-1][Nr-1][j][Nr-1]=PB1[j1][Nr-1][Nr-1][j][0];

PB1[j1][Nr-1][i][Nr-1][0]=Y[n1]*PB0[j1][Nr-1][i][Nr-1][0];
PB1[j1][Nr-1][i][Nr-1][Nr-1]=PB1[j1][Nr-1][i][Nr-1][0];

PB1[j1][n][Nr-1][Nr-1][0]=Y[n1]*PB0[j1][n][Nr-1][Nr-1][0];
PB1[j1][n][Nr-1][Nr-1][Nr-1]=PB1[j1][n][Nr-1][Nr-1][0];

PB1[j1][Nr-1][Nr-1][Nr-1][0]=Y[n1]*PB0[j1][Nr-1][Nr-1][Nr-1][0];
PB1[j1][Nr-1][Nr-1][Nr-1][Nr-1]=PB1[j1][Nr-1][Nr-1][Nr-1][0];
}
}
}
    }
    }



m=m+1;
if(m>N)
{goto goal3;}

S1=0;
   for (n = 0; n<=Nr-1; n++)
    {
for (i = 0; i<=Nr-1; i++)
    {
for (j = 0; j<=Nr-1; j++)
    {
for (k = 0; k<=Nr-1; k++)
    {
S1=S1-(0.5*(R1[0][n+2][i][j][k]*R1[0][n+2][i][j][k]+R1[1][n+2][i][j][k]*R1[1][n+2][i][j][k]+R1[2][n+2][i][j][k]*R1[2][n+2][i][j][k]+R1[3][n+2][i][j][k]*R1[3][n+2][i][j][k]+I1[0][n+2][i][j][k]*I1[0][n+2][i][j][k]+I1[1][n+2][i][j][k]*I1[1][n+2][i][j][k]+I1[2][n+2][i][j][k]*I1[2][n+2][i][j][k]+I1[3][n+2][i][j][k]*I1[3][n+2][i][j][k])-4*(R1[0][n+1][i][j][k]*R1[0][n+1][i][j][k]+R1[1][n+1][i][j][k]*R1[1][n+1][i][j][k]+R1[2][n+1][i][j][k]*R1[2][n+1][i][j][k]+R1[3][n+1][i][j][k]*R1[3][n+1][i][j][k]+I1[0][n+1][i][j][k]*I1[0][n+1][i][j][k]+I1[1][n+1][i][j][k]*I1[1][n+1][i][j][k]+I1[2][n+1][i][j][k]*I1[2][n+1][i][j][k]+I1[3][n+1][i][j][k]*I1[3][n+1][i][j][k])+4*(R1[0][n-1][i][j][k]*R1[0][n-1][i][j][k]+R1[1][n-1][i][j][k]*R1[1][n-1][i][j][k]+R1[2][n-1][i][j][k]*R1[2][n-1][i][j][k]+R1[3][n-1][i][j][k]*R1[3][n-1][i][j][k]+I1[0][n-1][i][j][k]*I1[0][n-1][i][j][k]+I1[1][n-1][i][j][k]*I1[1][n-1][i][j][k]+I1[2][n-1][i][j][k]*I1[2][n-1][i][j][k]+I1[3][n-1][i][j][k]*I1[3][n-1][i][j][k])-0.5*(R1[0][n-2][i][j][k]*R1[0][n-2][i][j][k]+R1[1][n-2][i][j][k]*R1[1][n-2][i][j][k]+R1[2][n-2][i][j][k]*R1[2][n-2][i][j][k]+R1[3][n-2][i][j][k]*R1[3][n-2][i][j][k]+I1[0][n-2][i][j][k]*I1[0][n-2][i][j][k]+I1[1][n-2][i][j][k]*I1[1][n-2][i][j][k]+I1[2][n-2][i][j][k]*I1[2][n-2][i][j][k]+I1[3][n-2][i][j][k]*I1[3][n-2][i][j][k])-(I1[0][n][i][j+2][k]*R1[3][n][i][j+2][k]+I1[2][n][i][j+2][k]*R1[1][n][i][j+2][k]-I1[3][n][i][j+2][k]*R1[0][n][i][j+2][k]-I1[1][n][i][j+2][k]*R1[2][n][i][j+2][k])+8*(I1[0][n][i][j+1][k]*R1[3][n][i][j+1][k]+I1[2][n][i][j+1][k]*R1[1][n][i][j+1][k]-I1[3][n][i][j+1][k]*R1[0][n][i][j+1][k]-I1[1][n][i][j+1][k]*R1[2][n][i][j+1][k])-8*(I1[0][n][i][j-1][k]*R1[3][n][i][j-1][k]+I1[2][n][i][j-1][k]*R1[1][n][i][j-1][k]-I1[3][n][i][j-1][k]*R1[0][n][i][j-1][k]-I1[1][n][i][j-1][k]*R1[2][n][i][j-1][k])+(I1[0][n][i][j-2][k]*R1[3][n][i][j-2][k]+I1[2][n][i][j-2][k]*R1[1][n][i][j-2][k]-I1[3][n][i][j-2][k]*R1[0][n][i][j-2][k]-I1[1][n][i][j-2][k]*R1[2][n][i][j-2][k])+(R1[0][n][i+2][j][k]*R1[3][n][i+2][j][k]+I1[0][n][i+2][j][k]*I1[3][n][i+2][j][k]+R1
[1][n][i+2][j][k]*R1[2][n][i+2][j][k]+I1[1][n][i+2][j][k]*I1[2][n][i+2][j][k])-8*(R1[0][n][i+1][j][k]*R1[3][n][i+1][j][k]+I1[0][n][i+1][j][k]*I1[3][n][i+1][j][k]+R1[1][n][i+1][j][k]*R1[2][n][i+1][j][k]+I1[1][n][i+1][j][k]*I1[2][n][i+1][j][k])+8*(R1[0][n][i-1][j][k]*R1[3][n][i-1][j][k]+I1[0][n][i-1][j][k]*I1[3][n][i-1][j][k]+R1[1][n][i-1][j][k]*R1[2][n][i-1][j][k]+I1[1][n][i-1][j][k]*I1[2][n][i-1][j][k])-(R1[0][n][i-2][j][k]*R1[3][n][i-2][j][k]+I1[0][n][i-2][j][k]*I1[3][n][i-2][j][k]+R1[1][n][i-2][j][k]*R1[2][n][i-2][j][k]+I1[1][n][i-2][j][k]*I1[2][n][i-2][j][k])-(R1[1][n][i][j][k+2]*R1[3][n][i][j][k+2]+I1[1][n][i][j][k+2]*I1[3][n][i][j][k+2]-R1[0][n][i][j][k+2]*R1[2][n][i][j][k+2]-I1[0][n][i][j][k+2]*I1[2][n][i][j][k+2])+8*(R1[1][n][i][j][k+1]*R1[3][n][i][j][k+1]+I1[1][n][i][j][k+1]*I1[3][n][i][j][k+1]-R1[0][n][i][j][k+1]*R1[2][n][i][j][k+1]-I1[0][n][i][j][k+1]*I1[2][n][i][j][k+1])-8*(R1[1][n][i][j][k-1]*R1[3][n][i][j][k-1]+I1[1][n][i][j][k-1]*I1[3][n][i][j][k-1]-R1[0][n][i][j][k-1]*R1[2][n][i][j][k-1]-I1[0][n][i][j][k-1]*I1[2][n][i][j][k-1])+(R1[1][n][i][j][k-2]*R1[3][n][i][j][k-2]+I1[1][n][i][j][k-2]*I1[3][n][i][j][k-2]-R1[0][n][i][j][k-2]*R1[2][n][i][j][k-2]-I1[0][n][i][j][k-2]*I1[2][n][i][j][k-2]))*pow(h,3)/12-(-B1[0][n][i][j][k]*(R1[0][n][i][j][k]*R1[3][n][i][j][k]+I1[0][n][i][j][k]*I1[3][n][i][j][k]+R1[1][n][i][j][k]*R1[2][n][i][j][k]+I1[1][n][i][j][k]*I1[2][n][i][j][k])+B1[1][n][i][j][k]*(-R1[0][n][i][j][k]*I1[3][n][i][j][k]+I1[0][n][i][j][k]*R1[3][n][i][j][k]+R1[1][n][i][j][k]*I1[2][n][i][j][k]-I1[1][n][i][j][k]*R1[2][n][i][j][k])+B1[2][n][i][j][k]*(-R1[0][n][i][j][k]*R1[2][n][i][j][k]-I1[0][n][i][j][k]*I1[2][n][i][j][k]+R1[1][n][i][j][k]*R1[3][n][i][j][k]+I1[1][n][i][j][k]*I1[3][n][i][j][k]))*2*g1*pow(h,4)-(pow(-B1[0][n+2][i][j][k]+8*B1[0][n+1][i][j][k]-8*B1[0][n-1][i][j][k]+B1[0][n-2][i][j][k],2)+pow(-B1[1][n+2][i][j][k]+8*B1[1][n+1][i][j][k]-8*B1[1][n-1][i][j][k]+B1[1][n-2][i][j][k],2)+pow(-B1[2][n+2][i][j][k]+8*B1[2][n+1][i][j][k]-8*B1[2][n-1][i][j][k]+B1[2][n-2][i][j][k],2)-pow(-B1[1][2][i+2][j][k]+8
*B1[1][n][i+1][j][k]-8*B1[1][n][i-1][j][k]+B1[1][n][i-2][j][k]+B1[0][2][i][j+2][k]-8*B1[0][n][i][j+1][k]+8*B1[0][n][i][j-1][k]-B1[0][n][i][j-2][k],2)-pow(-B1[2][2][i+2][j][k]+8*B1[2][n][i+1][j][k]-8*B1[2][n][i-1][j][k]+B1[2][n][i-2][j][k]+B1[0][2][i][j][k+2]-8*B1[0][n][i][j][k+1]+8*B1[0][n][i][j][k-1]-B1[0][n][i][j][k-2],2)-pow(-B1[2][2][i][j+2][k]+8*B1[2][n][i][j+1][k]-8*B1[2][n][i][j-1][k]+B1[2][n][i][j-2][k]+B1[1][2][i][j][k+2]-8*B1[1][n][i][j][k+1]+8*B1[1][n][i][j][k-1]-B1[1][n][i][j][k-2],2))*pow(h,2)/288;
}
    }
    }
    };
cout<<S1<<endl;

if(S1-S0<=0)
goal2:{   for (n = 0; n<=Nr-1; n++)
    {
    for (i = 0; i<=Nr-1; i++)
    {
for (j = 0; j<=Nr-1; j++)
    {
for (k = 0; k<=Nr-1; k++)
    {
for (i1 = 0; i1<=3; i1++)
    {
        R0[i1][n][i][j][k]=R1[i1][n][i][j][k];
        I0[i1][n][i][j][k]=I1[i1][n][i][j][k];
        
}
for (j1 =0; j1<=2; j1++)
    {
        B0[j1][n][i][j][k]=B1[j1][n][i][j][k];
        PB0[j1][n][i][j][k]=PB1[j1][n][i][j][k];
}
}
}
}
}
S0=S1;m1=m1+1;
goto goal1;}
else
if(exp(S0-S1)>=RANAB(0,1))
{m1=m1+1;goto goal2;}
else
goto goal1;


goal3:m2=m1/(m-1);
cout<<m2<<endl;;
}
2016-10-15 23:06
xss_wl
Rank: 5Rank: 5
等 级:禁止访问
威 望:3
帖 子:100
专家分:315
注 册:2016-10-15
收藏
得分:20 
你是用VC6.0编译的吗?另外不建议你直接把代码粘贴上来,而应该是传文件上来。
2016-10-16 12:14
邱寻
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2016-10-15
收藏
得分:0 
是用VC6.0编译的
2016-10-17 12:23
邱寻
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2016-10-15
收藏
得分:0 
QCD.rar (5.23 KB)
2016-10-17 12:27
邱寻
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2016-10-15
收藏
得分:0 
修改的
LQCD.rar (22.19 KB)
2016-10-17 13:48
快速回复:求解决“堆栈溢出”的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.036173 second(s), 11 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved