SCM

SCM Repository

[matrix] Diff of /pkg/R/dsyMatrix.R
ViewVC logotype

Diff of /pkg/R/dsyMatrix.R

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

revision 2004, Tue Jul 17 22:12:30 2007 UTC revision 2005, Wed Jul 18 14:46:20 2007 UTC
# Line 13  Line 13 
13        function(from) as(as(from, "dgeMatrix"), "dsyMatrix"))        function(from) as(as(from, "dgeMatrix"), "dsyMatrix"))
14    
15  setAs("dsyMatrix", "matrix",  setAs("dsyMatrix", "matrix",
16        function(from) .Call(dsyMatrix_as_matrix, from))        function(from) .Call(dsyMatrix_as_matrix, from, TRUE))
17    
18  setAs("dsyMatrix", "dspMatrix",  setAs("dsyMatrix", "dspMatrix",
19        function(from) .Call(dsyMatrix_as_dspMatrix, from))        function(from) .Call(dsyMatrix_as_dspMatrix, from))
# Line 21  Line 21 
21  setAs("dsyMatrix", "dsTMatrix",  setAs("dsyMatrix", "dsTMatrix",
22        function(from) { # 'dsT': only store upper *or* lower        function(from) { # 'dsT': only store upper *or* lower
23            ## working via "matrix" : not very efficient  (FIXME)            ## working via "matrix" : not very efficient  (FIXME)
24            ij <- which((m <- as(from,"matrix")) != 0, arr.ind = TRUE)            m <- .Call(dsyMatrix_as_matrix, from, FALSE) # no dimnames!
25              ij <- which(m != 0, arr.ind = TRUE)
26            uplo <- from@uplo            uplo <- from@uplo
27            ij <- ij[if(uplo == "U") ij[,1] <= ij[,2] else ij[,1] >= ij[,2] ,            ij <- ij[if(uplo == "U") ij[,1] <= ij[,2] else ij[,1] >= ij[,2] ,
28                     , drop = FALSE]                     , drop = FALSE]

Legend:
Removed from v.2004  
changed lines
  Added in v.2005

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