From: "M. Edward (Ed) Borasky" Date: 2006-07-31T07:58:05+09:00 Subject: Re: Setting precision in Ruby-GSL calculations ? Nuralanur@aol.com wrote: > Dear Ed, > > thank you for responding. > Well, I tried transposing as you said too, but then I lost > confidence in the algorithm implemented there, because > > for m=[[10,5,-10],[2,-11,10]].to_gsl_matrix, I then get > a matrix u of size (3,2), (it should be 3,3), and u*u.transposed > is > > [ 8.889e-001 -2.222e-001 -2.222e-001 > -2.222e-001 5.556e-001 -4.444e-001 > -2.222e-001 -4.444e-001 5.556e-001 ], > > so nowhere near a unit matrix, either ... > > With respect to the sizes, I am expecting to be able to keep > (m1,m2) somewhere in the range of 50 or below each. > > Best regards, > > Axel > Here's what I get from R: > m=matrix(c(10, 5 ,-10 ,2 ,-11 ,10), nrow=3, ncol=2) > m [,1] [,2] [1,] 10 2 [2,] 5 -11 [3,] -10 10 > svd(m) $d [1] 18.973666 9.486833 $u [,1] [,2] [1,] -0.2981424 8.944272e-01 [2,] -0.5962848 -4.472136e-01 [3,] 0.7453560 -1.489694e-16 $v [,1] [,2] [1,] -0.7071068 0.7071068 [2,] 0.7071068 0.7071068 > m=t(m) > m [,1] [,2] [,3] [1,] 10 5 -10 [2,] 2 -11 10 > svd(m) $d [1] 18.973666 9.486833 $u [,1] [,2] [1,] -0.7071068 0.7071068 [2,] 0.7071068 0.7071068 $v [,1] [,2] [1,] -0.2981424 8.944272e-01 [2,] -0.5962848 -4.472136e-01 [3,] 0.7453560 -1.859678e-16