I have converted my C++ code into python but although I have the same outputs for the functions separately(T(l,m,v,s,r)in C++=T(l,m,v,s,r)in pyhton or t[l][m][w][i][j]in C++=t[l][m][w][i][j] in python ) but in the beneath part of the codes the outputs are not the same (T(l,m,v,s,r)in C++=!T(l,m,v,s,r) in python or t[l][m][w][i][j]in C++=!t[l][m][w][i][j] in python )).
void P(){
int i,j,l,m;
for(i=0;i<5;i++){
s=smin+i*deltas;
r=rmin;
for(j=0;j<634;j++){
r*=deltar;
for(l=0;l<=5;l++){
for(m=l;m<=5;m++){
t[l][m][v][i][j]=T(l,m,v,s,r);
t[m][l][v][i][j]=t[l][m][v][i][j];
t[l][m][w][i][j]=T(l,m,w,s,r);
t[m][l][w][i][j]=t[l][m][w][i][j];
if(t[l][m][v][i][j]<1e-20 && t[m][l][w][i][j]<1e-20)break;
}
}
}
}
}
and python:
def P():
for i in range(0,5):
s=smin+i*deltas
r=rmin
for j in range(0,634):
r*=deltar
for l in range(0,6):
for m in range(l,6):
t[l][m][v][i][j]=T(l,m,v,s,r)
t[m][l][v][i][j]=t[l][m][v][i][j]
t[l][m][w][i][j]=T(l,m,w,s,r)
t[m][l][w][i][j]=t[l][m][w][i][j]
if t[l][m][v][i][j]<1e-20 and t[m][l][w][i][j]<1e-20:
break
I will really appreciate if someone would help.
for m in range(l,5)should befor m in range(l,6)as if you want to include 5 (<=5 inc++), you will have to add one more to python, similar to what you did for outer loopsT()does .. it is not possible to answer your question. Please either share this function code or provide a reproducible example where both codes give different results.