SCM

SCM Repository

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

Diff of /pkg/R/dtCMatrix.R

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

revision 958, Sat Oct 1 20:08:51 2005 UTC revision 959, Sat Oct 1 20:10:20 2005 UTC
# Line 7  Line 7 
7                           uplo = from@uplo, diag = from@diag,                           uplo = from@uplo, diag = from@diag,
8                           Dim = from@Dim, Dimnames = from@Dimnames))                           Dim = from@Dim, Dimnames = from@Dimnames))
9    
10    setAs("dtCMatrix", "dgCMatrix",
11          function(from) {
12              if(from@diag == "U") { ## add diagonal of 1's
13                  ##FIXME: do this smartly - directly {in C or R}
14                  as(as(from, "dgTMatrix"), "dgCMatrix")
15              }
16              else
17                  new("dgCMatrix",
18                      i = from@i, p = from@p, x = from@x,
19                      Dim = from@Dim, Dimnames = from@Dimnames)
20          })
21    
22  setAs("dtCMatrix", "dgTMatrix",  setAs("dtCMatrix", "dgTMatrix",
23        function(from) .Call("tsc_to_dgTMatrix", from))        function(from) .Call("tsc_to_dgTMatrix", from))
24    

Legend:
Removed from v.958  
changed lines
  Added in v.959

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