I use R Version 0.60 Alpha (September 18, 1997) on a Linux Pentium (Debian 1.3) and on a Sparc-Sun-Solaris 2.5.=20 R> svd(matrix(1:16,4,4)) =09yields on both machines Error: error 4 in dsvdc R> svd(matrix(1:20,4,5)) =09gives a result on the Linux computer $d [1] 0 0 0 NA $u [,1] [,2] [,3] [,4] [1,] 1 0 0 0 [2,] 0 1 0 0 [3,] 0 0 1 0 [4,] 0 0 0 1 $v [,1] [,2] [,3] [,4] [1,] 1 0 0 0 [2,] 0 1 0 0 [3,] 0 0 NA NA [4,] 0 0 NA NA [5,] 0 0 NA NA but causes a Segmentation Fault on the solaris machine. =09Andreas Weingessel ************************************************************************ * Andreas Weingessel * ************************************************************************ * Institut f=FCr Statistik * Tel: (+43 1) 58801 4541 * * Technische Universit=E4t Wien * Fax: (+43 1) 504 14 98 * * Wiedner Hauptstr. 8-10/1071 * Andreas.Weingessel@ci.tuwien.ac.at * * A-1040 Wien, Austria * http://www.ci.tuwien.ac.at/~weingessel * ************************************************************************ =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Andreas Weingessel <Andreas.Weingessel@ci.tuwien.ac.at> writes:> I use R Version 0.60 Alpha (September 18, 1997) on a Linux Pentium^^^^^^^^^^> (Debian 1.3) and on a Sparc-Sun-Solaris 2.5.As a matter of principle, that version is not released yet, so it may contain bugs that shouldn't be seen outside the core team. However, I seem to get the same errors with 0.50.x (with x==2 because I was to laz^H^H^Hbusy to upgrade it...), so I suppose it can be discussed here anyway.> R> svd(matrix(1:16,4,4)) > yields on both machines > Error: error 4 in dsvdc > > R> svd(matrix(1:20,4,5)) > gives a result on the Linux computerBoth examples are rank-2 matrices, the problems disappear with random matrices, so I suspect that the code is unhappy about dealing with matrices of less than full rank? -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Andreas Weingessel writes: > > R> svd(matrix(1:16,4,4)) > yields on both machines > Error: error 4 in dsvdc This is a bug in the interpreted code. It assumes that its argument is real valued. 1:16 produces an integer value. The fix is to change the svd function so that the call to LINPACK is z <- .Fortran("dsvdc", as.double(x), n, n, p, d = double(mm), double(p), u = u, n, v = v, p, double(n), as.integer(job), info = integer(1), DUP = FALSE)[c("d", "u", "v", "info")] i.e. you have to wrap an "as.double" around "x". Ross =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-