SCM

SCM Repository

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

Diff of /pkg/tests/indexing.R

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

revision 2505, Wed Dec 9 17:33:23 2009 UTC revision 2506, Fri Dec 11 12:54:28 2009 UTC
# Line 151  Line 151 
151      assert.EQ.mat(Tii, ss[i,i])      assert.EQ.mat(Tii, ss[i,i])
152  }  }
153    
154    b <- diag(1:2)[,c(1,1,2,2)]
155    cb <- crossprod(b)
156    cB <- crossprod(Matrix(b, sparse=TRUE))
157    a <- matrix(0, 6, 6)
158    a[1:4, 1:4] <- cb
159    A1 <- A2 <- Matrix(0, 6, 6)#-> sparse
160    A1[1:4, 1:4] <- cb
161    A2[1:4, 1:4] <- cB
162    assert.EQ.mat(A1, a)# indeed
163    stopifnot(identical(A1, A2), is(A1, "dsCMatrix"))
164    
165  ## repeated ones ``the challenge'' (to do smartly):  ## repeated ones ``the challenge'' (to do smartly):
166  j <- c(4, 4, 9, 12, 9, 4, 17, 3, 18, 4, 12, 18, 4, 9)  j <- c(4, 4, 9, 12, 9, 4, 17, 3, 18, 4, 12, 18, 4, 9)
167  assert.EQ.mat(T[j,j], ss[j,j])  assert.EQ.mat(T[j,j], ss[j,j])

Legend:
Removed from v.2505  
changed lines
  Added in v.2506

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