mglin runtime error


reallyonlyme
03-22-2006, 03:41 AM
Hi.

I'd like to use mglin and have already written a code incorporating it. I compile it with the gcc compiler that comes with Cygwin using the command: gcc fas.c nrutil.c -lm (fas.c the name of my program).

Running the program produces a core dumped.

I think, the problem comes down to the following: for example, if the matrix u (the function one is solving for) defined originally as double **u, is defined as double u[100][100] instead, causes no core dumped error. The same with all other such vector, matrix or function definitions. I wonder... do I have to redefine all such declarations in the program? I hope there is a much better workaround.

Hope I was clear enough.

I'd appreciate any help very much indeed. Thanks.

Saul Teukolsky
03-23-2006, 10:44 AM
Hi,

All vectors and matrices in NR are declared with the functions in nrutil. In this case, you need the following in your calling program:

double **u;
u=dmatrix(1,n,1,n);

For more details, see Section 1.2.

Saul Teukolsky