SCM

SCM Repository

[matrix] Diff of /pkg/tests/dg_Matrix.R
ViewVC logotype

Diff of /pkg/tests/dg_Matrix.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2156, Tue Mar 25 09:26:59 2008 UTC revision 2157, Tue Mar 25 15:00:01 2008 UTC
# Line 77  Line 77 
77  (e.lu <- expand(fLU))  (e.lu <- expand(fLU))
78  M2 <- with(e.lu, P %*% L %*% U)  M2 <- with(e.lu, P %*% L %*% U)
79  assert.EQ.mat(M2, as(M, "matrix"))  assert.EQ.mat(M2, as(M, "matrix"))
80    ## now the sparse LU :
81    M. <- as(M,"sparseMatrix")
82    tt <- try(solve(M.)) # less nice: factor is *not* cached
83    ## use a non-singular one:
84    M1 <- M. + 0.5*Diagonal(nrow(M.))
85    luM1 <- lu(M1)
86    d1 <- determinant(as(M1,"denseMatrix"))
87    stopifnot(identical(luM1, M1@factors$LU),
88              diag(luM1@L) == 1,# L is *unit*-triangular
89              all.equal(log(-prod(diag(luM1@U))), c(d1$modulus)))
90    
91  cat('Time elapsed: ', proc.time(),'\n') # for ``statistical reasons''  cat('Time elapsed: ', proc.time(),'\n') # for ``statistical reasons''

Legend:
Removed from v.2156  
changed lines
  Added in v.2157

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