Any reason why Octave, R, Numpy and LAPACK yield different SVD results on the same matrix?
问题 I'm using Octave and R to compute SVD using a simple matrix and getting two different answers! The code is listed below: R > a<-matrix(c(1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1), 9, 4) > a [,1] [,2] [,3] [,4] [1,] 1 1 0 0 [2,] 1 1 0 0 [3,] 1 1 0 0 [4,] 1 0 1 0 [5,] 1 0 1 0 [6,] 1 0 1 0 [7,] 1 0 0 1 [8,] 1 0 0 1 [9,] 1 0 0 1 > a.svd <- svd(a) > a.svd$d [1] 3.464102e+00 1.732051e+00 1.732051e+00 1.922963e-16 > a.svd$u [,1] [,2] [,3] [,4] [1,] -0.3333333 0.4714045