agogo
05-04-2007, 06:56 AM
hi, this is my first post here, my name is agogo and i am from croatia.
and now to the important things. i have to wright about qr decomposition in c++ and i borowed from a friend nr in c++ and started reading. and now, the deadline is very close but still, after many hours of reading, i don't understend the code of qrdcmp... :-(
the lines that perticulary puzzle me are:
...
d[k]= -scale*sigma;
for(j=k+1;j<n;j++)
{
for(sum=0.0, i=k; i<n; i++)
sum += a[i][k]*a[i][j];
tau=sum/c[k];
for(i=k;i<n;i++)
a[i][j] -= tau*a[i][k];
}
...
why, o why, is the d[k] = -scale*sigma; when d[k] represents the diagonal elements and scale is the apsolute biggest in a column?
and in the for loop, what does this inner for loops stand for?
the biggest problem that i have is to conect mathematic with coresponding lines in program...
please, if someone could explain it because im going mad... tnx.
and now to the important things. i have to wright about qr decomposition in c++ and i borowed from a friend nr in c++ and started reading. and now, the deadline is very close but still, after many hours of reading, i don't understend the code of qrdcmp... :-(
the lines that perticulary puzzle me are:
...
d[k]= -scale*sigma;
for(j=k+1;j<n;j++)
{
for(sum=0.0, i=k; i<n; i++)
sum += a[i][k]*a[i][j];
tau=sum/c[k];
for(i=k;i<n;i++)
a[i][j] -= tau*a[i][k];
}
...
why, o why, is the d[k] = -scale*sigma; when d[k] represents the diagonal elements and scale is the apsolute biggest in a column?
and in the for loop, what does this inner for loops stand for?
the biggest problem that i have is to conect mathematic with coresponding lines in program...
please, if someone could explain it because im going mad... tnx.