SCM Repository

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

Diff of /pkg/tests/indexing.R

revision 2341, Mon Mar 2 17:53:13 2009 UTC revision 2357, Mon Apr 6 15:53:51 2009 UTC
# Line 597  Line 597
597  f <- sparseMatrix(i = sample(n, size=nnz, replace=TRUE),  f <- sparseMatrix(i = sample(n, size=nnz, replace=TRUE),
598                    j = sample(m, size=nnz, replace=TRUE))                    j = sample(m, size=nnz, replace=TRUE))
599  str(f)  str(f)
600  str(thisCol <-  f[,5000])# logi [....]  dim(f) # 6999863 x 99992
601  f[,5762] <- thisCol # now fine  prod(dim(f)) # 699930301096 == 699'930'301'096  (~ 700'000 millions)
602    str(thisCol <-  f[,5000])# logi [~ 7 mio....]
603    sv <- as(thisCol, "sparseVector")
604    str(sv) ## "empty" !
605    validObject(spCol <- f[,5000, drop=FALSE])
606    ## *not* identical(): as(spCol, "sparseVector")@length is "double"prec:
607    stopifnot(all.equal(as(spCol, "sparseVector"),
608                        as(sv,   "nsparseVector"), tol=0))
609    f[,5762] <- thisCol # now "fine" <<<<<<<<<< FIXME uses LARGE objects
610    ## is using  replCmat() in ../R/Csparse.R, then
611    ##           replTmat() in ../R/Tsparse.R
612
613  fx <- sparseMatrix(i = sample(n, size=nnz, replace=TRUE),  fx <- sparseMatrix(i = sample(n, size=nnz, replace=TRUE),
614                     j = sample(m, size=nnz, replace=TRUE),                     j = sample(m, size=nnz, replace=TRUE),

Legend:
 Removed from v.2341 changed lines Added in v.2357

 root@r-forge.r-project.org ViewVC Help Powered by ViewVC 1.0.0
Thanks to: