5 Mar
2003
5 Mar
'03
7:15 a.m.
Hi Thomas, you wrote:
But I needed to use
double *rdata = new double (n);
This dynamically creates one double object and initializes it with the value n and uses its address to intialize rdata.
Here's the original code: double *rdata = new double[n]; // stores non-contigous part of the current row of A
... delete [] rdata;
And this tells the compiler to deallocate the dynamically allocated array rdata points to. Your program has undefined behavior.
I haven't followed this thread, but the code you posted here definitely looks very fishy.
Thanks for the correction and sorry for the confusion, Joerg