mrqmin and static vector/matrix


pdespres
10-03-2002, 10:43 AM
Hello,

I am calling mrqmin 2 or more times within the same program to compare different fits. In some cases, the ma value is changed and my program seg fault. As I understant it, oneda and some others vectors are initialized on the first call to mrqmin (say with ma=3) because of static modifier. If I try a second fit with say ma=4, then oneda and others won't be resize and seg fault occurs for oneda[3][0]? Am I missing something? Is the static modifier necessary?

Thank you,

Philippe

erik
10-07-2002, 07:17 AM
If you just want to compare different fits, there are no nee to call mrqmin at all. Instead you can call mrqcof directly to calculate chi-square (which I assume you use to compare fits) and hence you does not have to bother about the size of ma.

Saul Teukolsky
10-08-2002, 01:09 PM
See also
http://www.nr.com/forum/showthread.php?s=&threadid=134