Hello,
Does anyone understand why Data2 would not equal Data? I print, and can see, that they LOOK the same, i.e. have the same number of rows and columns with the same values in each element. But when I pass the matrices to a calc function, they give different results. I am guessing that there is a missing (or extra) character, space, line somewhere that I can't "see".
The only difference is the way that I fill Data1 and Data2. data_options actually contains 660 elements and Data2 would contain 649. Am I filling Data2 incorrectly? In the end, I want Data2 to be the same as Data1. Here are snippets of my C code...
double **data1;
double **data2;
double *data_options;
int numobs = 59;
int Dim1 = 11;
data1 = matrix(numobs,D im1);
for (n=0; n<numobs; n++)
{
for (k=0; k<Dim1; k++)
{
data1[n][k]=data_options[n*Dim1+k];
}
}
data2 = matrix(numobs, Dim1);
for (n = 0; n<numobs; n++)
{
for (k=0; k<Dim1; k++)
{
data2[n][k] = data1[n][k];
}
}
thank you!
Does anyone understand why Data2 would not equal Data? I print, and can see, that they LOOK the same, i.e. have the same number of rows and columns with the same values in each element. But when I pass the matrices to a calc function, they give different results. I am guessing that there is a missing (or extra) character, space, line somewhere that I can't "see".
The only difference is the way that I fill Data1 and Data2. data_options actually contains 660 elements and Data2 would contain 649. Am I filling Data2 incorrectly? In the end, I want Data2 to be the same as Data1. Here are snippets of my C code...
double **data1;
double **data2;
double *data_options;
int numobs = 59;
int Dim1 = 11;
data1 = matrix(numobs,D im1);
for (n=0; n<numobs; n++)
{
for (k=0; k<Dim1; k++)
{
data1[n][k]=data_options[n*Dim1+k];
}
}
data2 = matrix(numobs, Dim1);
for (n = 0; n<numobs; n++)
{
for (k=0; k<Dim1; k++)
{
data2[n][k] = data1[n][k];
}
}
thank you!
Comment