[Rd] make check on DU4 with R-1.1.0 snapshot
Albrecht Gebhardt
albrecht.gebhardt@uni-klu.ac.at
Fri, 2 Jun 2000 21:34:36 +0200 (MET DST)
I just tried the rsync version of R-1.1.0 on one of my alphas:
It compiles without problems (gcc/g77 2.95.2, system is DU4.0E)
but make check stops in base-Ex.R at
> X <- cbind(1, 1:7)
> str(s <- svd(X)); D <- diag(s$d)
List of 3
$ d: num [1:2] 12.07 1.16
$ u: num [1:7, 1:2] -0.0976 -0.1788 -0.2601 -0.3413 -0.4225 ...
$ v: num [1:2, 1:2] -0.198 -0.980 -0.980 0.198
> stopifnot(abs(X - s$u %*% D %*% t(s$v)) < Eps)# X = U D V'
Error: abs(X - s$"u" %*% D %*% t(s$"v")) < Eps is not TRUE
Execution halted
if I repeat all the svd tests manually I get:
>
> hilbert <- function(n) { i <- 1:n; 1 / outer(i - 1, i, "+") }
> str(X <- hilbert(9)[,1:6])
num [1:9, 1:6] 1.000 0.500 0.333 0.250 0.200 ...
> str(s <- svd(X))
List of 3
$ d: num [1:6] 1.67e+00 2.77e-01 2.22e-02 1.08e-03 3.24e-05 ...
$ u: num [1:9, 1:6] -0.724 -0.428 -0.312 -0.248 -0.206 ...
$ v: num [1:6, 1:6] -0.736 -0.443 -0.327 -0.263 -0.220 ...
> Eps <- 10 * .Machine$double.eps
> D <- diag(s$d)
> abs(X - s$u %*% D %*% t(s$v)) < Eps
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] TRUE TRUE TRUE TRUE TRUE TRUE
[2,] TRUE TRUE TRUE TRUE TRUE TRUE
[3,] TRUE TRUE TRUE TRUE TRUE TRUE
[4,] TRUE TRUE TRUE TRUE TRUE TRUE
[5,] TRUE TRUE TRUE TRUE TRUE TRUE
[6,] TRUE TRUE TRUE TRUE TRUE TRUE
[7,] TRUE TRUE TRUE TRUE TRUE TRUE
[8,] TRUE TRUE TRUE TRUE TRUE TRUE
[9,] TRUE TRUE TRUE TRUE TRUE TRUE
> abs(D - t(s$u) %*% X %*% s$v) < Eps
[,1] [,2] [,3] [,4] [,5] [,6]
[1,] TRUE TRUE TRUE TRUE TRUE TRUE
[2,] TRUE TRUE TRUE TRUE TRUE TRUE
[3,] TRUE TRUE TRUE TRUE TRUE TRUE
[4,] TRUE TRUE TRUE TRUE TRUE TRUE
[5,] TRUE TRUE TRUE TRUE TRUE TRUE
[6,] TRUE TRUE TRUE TRUE TRUE TRUE
> X <- cbind(1, 1:7)
> str(s <- svd(X)); D <- diag(s$d)
List of 3
$ d: num [1:2] 12.07 1.16
$ u: num [1:7, 1:2] -0.0976 -0.1788 -0.2601 -0.3413 -0.4225 ...
$ v: num [1:2, 1:2] -0.198 -0.980 -0.980 0.198
> abs(X - s$u %*% D %*% t(s$v)) < Eps
[,1] [,2]
[1,] TRUE TRUE
[2,] TRUE TRUE
[3,] TRUE TRUE
[4,] TRUE TRUE
[5,] TRUE TRUE
[6,] TRUE FALSE
[7,] TRUE TRUE
> abs(D - t(s$u) %*% X %*% s$v) < Eps
[,1] [,2]
[1,] FALSE TRUE
[2,] TRUE TRUE
and the errors are:
> abs(X - s$u %*% D %*% t(s$v)) - Eps
[,1] [,2]
[1,] -2.109424e-15 -2.220446e-16
[2,] -1.998401e-15 -8.881784e-16
[3,] -2.220446e-15 -1.776357e-15
[4,] -1.998401e-15 -1.332268e-15
[5,] -1.998401e-15 -1.332268e-15
[6,] -1.998401e-15 4.440892e-16
[7,] -1.332268e-15 -2.220446e-15
> abs(D - t(s$u) %*% X %*% s$v) - Eps
[,1] [,2]
[1,] 3.108624e-15 -8.881784e-16
[2,] -1.165734e-15 -2.220446e-15
4.440892e-16 and 3.108624e-15
Eps was:
> Eps
[1] 2.220446e-15
This seems to be ok, I tried in Fortran
EPSMCH=DLAMCH('E')
WRITE(*,*)"eps:",EPSMCH
and got
eps: 2.22044605E-16
I compiled --whithout-dxml, so I'm not using any special numeric library.
When I comment out the few lines for svd the tests from base-Ex.R complete
successfully.
All other tests succeed (other libraries and strict and sloppy specific
tests)
Albrecht
......................................................................
| Albrecht Gebhardt Tel.: (++43 463) 2700/832 |
| Institut fuer Mathematik Fax : (++43 463) 2700/834 |
| Universitaet Klagenfurt mailto:albrecht.gebhardt@uni-klu.ac.at |
| Villacher Str. 161 http://www-stat.uni-klu.ac.at/~agebhard |
| A-9020 Klagenfurt, Austria |
`--------------------------------------------------------------------'
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._