SCM

SCM Repository

[matrix] Diff of /pkg/Matrix/man/dtCMatrix-class.Rd
ViewVC logotype

Diff of /pkg/Matrix/man/dtCMatrix-class.Rd

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

revision 2888, Wed Aug 7 13:56:43 2013 UTC revision 2889, Thu Aug 8 21:06:22 2013 UTC
# Line 121  Line 121 
121  (it1 <- solve(t1))  (it1 <- solve(t1))
122  t1. <- solve(it1)  t1. <- solve(it1)
123  all(abs(t1 - t1.) < 10 * .Machine$double.eps)  all(abs(t1 - t1.) < 10 * .Machine$double.eps)
124  }  
125    ## 2nd example
126    U5 <- new("dtCMatrix", i= c(1L, 0:3), p=c(0L,0L,0:2, 5L), Dim = c(5L, 5L),
127              x = rep(1, 5), diag = "U")
128    U5
129    (iu <- solve(U5)) # contains one '0'
130    validObject(iu2 <- solve(U5, Diagonal(5)))# failed in earlier versions
131    
132    I5 <- iu  \%*\% U5 # should equal the identity matrix
133    i5 <- iu2 \%*\% U5
134    asDiag <- function(M) as(drop0(M), "diagonalMatrix")
135    stopifnot(
136       all.equal(Diagonal(5), asDiag(I5), tol=1e-14)
137       ,
138       all.equal(Diagonal(5), asDiag(i5), tol=1e-14)
139    )}
140  \keyword{classes}  \keyword{classes}
141  \keyword{algebra}  \keyword{algebra}

Legend:
Removed from v.2888  
changed lines
  Added in v.2889

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