I came across this strange IndexOutOfRangeException exception. The code I am working with was originally a C code, I have managed to translate it to C#
So I the followin loop gives me the error:
for (int i = 0; i < 6; i++)
{
L[0] = new double[]{ T[0] + rxp[0][i] - (p[0][i])
}
According to the 'Locals' tab, rxp has only 3 'children' with only 1 items / child. So I guess the problem is here:
void getrxp()
{
for (int i = 0; i < 6; i++)
{
rxp[0] = new double[]{ M[0][0] * (re[0][i]) + M[0][1] * (re[1][i]) + M[0][2] * 0};
rxp[1] = new double[]{ M[1][0] * (re[0][i]) + M[1][1] * (re[1][i]) + M[1][2] * 0};
rxp[2] = new double[]{ M[2][0] * (re[0][i]) + M[2][1] * (re[1][i]) + M[2][2] * 0};
}
}
Am I getting this to to create a double rxp[3][6];
array wrong or there is something else?
The original code looks like this (C):
void getrxp()
{
for(int i=0;i<6;i++){
rxp[0][i] = M[0][0]*(re[0][i])+M[0][1]*(re[1][i])+M[0][2]*0;
rxp[1][i] = M[1][0]*(re[0][i])+M[1][1]*(re[1][i])+M[1][2]*0;
rxp[2][i] = M[2][0]*(re[0][i])+M[2][1]*(re[1][i])+M[2][2]*0;
}
}