SCM

SCM Repository

[matrix] Diff of /pkg/tests/matr-exp.R
ViewVC logotype

Diff of /pkg/tests/matr-exp.R

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

revision 953, Wed Sep 28 19:31:36 2005 UTC revision 954, Wed Sep 28 19:34:31 2005 UTC
# Line 39  Line 39 
39  ## or                           log det(exp(A)) == tr(A) :  ## or                           log det(exp(A)) == tr(A) :
40  stopifnot(all.equal(determinant(e2)$modulus, sum(diag(m2))))  stopifnot(all.equal(determinant(e2)$modulus, sum(diag(m2))))
41    
42  m3 <- Matrix(cbind(0,rbind(6*diag(3),0)), nc = 4)  m3 <- Matrix(cbind(0,rbind(6*diag(3),0)), nc = 4)#  sparse
43  e3 <- expm(m3)  e3 <- expm(m3)
44  assert.EQ.mat(e3,  E3 <- expm(Matrix(m3, sparse=FALSE))
45                rbind(c(1,6,18,36),  stopifnot(identical(e3, E3))
46    e3. <- rbind(c(1,6,18,36),
47                      c(0,1, 6,18),                      c(0,1, 6,18),
48                      c(0,0, 1, 6),                      c(0,0, 1, 6),
49                      c(0,0, 0, 1)))               c(0,0, 0, 1))
50    assert.EQ.mat(e3, e3.)
51    
52  proc.time() # for ``statistical reasons''  proc.time() # for ``statistical reasons''

Legend:
Removed from v.953  
changed lines
  Added in v.954

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