Congratulations, you did all the hard stuff correctly. The only error is in the for loop that initializes the data. You are starting the for loop at 1. This leaves the value of lpX1[0] and lpY1[0] uninitialized, which does not mean, as many think, the value will be 0.0. Instead it is a random collection of bytes that may or may not be a valid real number. We usually refer to those types of values as garbage values, and they cannot be processed by our software.
CTEST1Doc::CTEST1Doc()
{
// TODO: add one-time construction code here
//------------QWC CODE TILL END
//allocate global data arrays
lpX1 = new realtype[NUMP];
lpY1 = new realtype[NUMP];
//simulate x,y
for(int i=1; i<NUMP;i++)
{
lpX1[i]=(realtype) i;
lpY1[i]=15*cos(M_PI * i / 4.0);
}
//Create new static data set
pDataSet = new QCStaticData( "60 Cyc Noise", lpX1, lpY1, NUMP);
}
Change to:
CTEST1Doc::CTEST1Doc()
{
// TODO: add one-time construction code here
//------------QWC CODE TILL END
//allocate global data arrays
lpX1 = new realtype[NUMP];
lpY1 = new realtype[NUMP];
//simulate x,y
for(int i=0; i<NUMP;i++)
{
lpX1[i]=(realtype) i;
lpY1[i]=15*cos(M_PI * i / 4.0);
}
//Create new static data set
pDataSet = new QCStaticData( "60 Cyc Noise", lpX1, lpY1, NUMP);
}