boundscheck with svdfit

08-30-2005, 11:41 PM
The u array in svdfit (and corrosponding a array in svdcmp)
are inconsistantly used with respect to the dimensions.
While dimensioned mxn, svdfit then fills it nxm, but later
it is used as mxn again. I am confused. Is this just workspace
and boundchecking should be ignored or a bug.

Saul Teukolsky
08-31-2005, 01:51 PM
The dimensions are all used consistently, I believe. The comments may be a little confusing because the role of m and n is interchanged. In svdcmp, the matrix is called mxn, following the usual mathematical convention. In svdfit, the number of data points, which is conventionally called n, has to be the first dimension of the matrix. As long as you follow the description in the header comments for svdfit, you should not get any out-of-bounds problems.

Saul Teukolsky