SVD算法的全面介绍
//以下进行左奇异向量的计算
c1 Bii/ ;c2 Bi 1,i 1/
s1 Bi 1,i/ ;s2 Bi,i 1/
/* update rows i and i 1 of B */ for k i to i 1 tmp Bik Bik c1*tmp s1*Bi 1,k
Bi 1,k s2*tmp c2*Gi 1,k endfor
/* update the matrix U of right singular vectors */ for k 1 to n
tmp Uki
Uki c1*tmp s1*Uk,i 1 Uk,i 1 s2*tmp c2*Uk,i 1 endfor
至此我们完成了所有的准备工作,在文献[13]中给出了完整的算法描述,在它的基础上略作修改说明,给出完整的算法描述如下:
算法3.2.4:
= machine precision
= underflow threshold ( smallest positive normalized number) n = dimension of the matrix
tol = relative error tolerance (currently 100 )
maxit = maximum number of QR inner loops (currently 3n2) 初始化U,V
//当直接对二对角矩阵应用此算法则直接设U=I,V=I //当对一般矩阵二对角化以后才利用此算法则设, //U: PP12 Pn, V: H1H2 Hn 2.
Bidiagonal Singular Value Decomposition Compute min(B) //利用算法3.2.2
max( i, i)
thresh max(tol ,maxit )
/* any i less than thresh in magnitude may be set to zero */ Loop: