SCM

SCM Repository

[matrix] View of /pkg/tests/solve.R
ViewVC logotype

View of /pkg/tests/solve.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 697 - (download) (annotate)
Mon Apr 18 20:18:46 2005 UTC (14 years, 4 months ago) by maechler
File size: 509 byte(s)
numeric x dgeMatrix : for solve etc
library(Matrix)

## Solve() methods, first for "dgeMatrix" and all kinds of RHS :

(m6 <- 1 + as(diag(0:5), "dgeMatrix"))
rcond(m6)
I6 <- as(diag(6), "dgeMatrix")
stopifnot(all.equal(I6, m6 %*% solve(m6)),
          all.equal(I6, solve(m6) %*% m6) )

(i6 <- solve(m6, Matrix(1:6)))
stopifnot(identical(i6, as(cbind(c(-4, rep(1,5))), "dgeMatrix")),
          identical(i6, solve(m6, 1:6),
          identical(i6, solve(m6, matrix(1:6))),
          identical(i6, solve(m6, matrix(c(1,2,3,4,5,6)))),
          )

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge