SCM

SCM Repository

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

Diff of /pkg/R/lgCMatrix.R

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

revision 1547, Mon Sep 11 14:49:39 2006 UTC revision 1548, Mon Sep 11 22:13:07 2006 UTC
# Line 29  Line 29 
29    
30  setAs("lgCMatrix", "dgCMatrix",  setAs("lgCMatrix", "dgCMatrix",
31        function(from) new("dgCMatrix", i = from@i, p = from@p,        function(from) new("dgCMatrix", i = from@i, p = from@p,
32                           x = rep(1, length(from@i)),                           x = as.double(from@x),
33                           Dim = from@Dim, Dimnames = from@Dimnames))                           Dim = from@Dim, Dimnames = from@Dimnames))
34    
35  setAs("lgCMatrix", "lgTMatrix",  setAs("lgCMatrix", "lgTMatrix",
36        function(from) new("lgTMatrix", i = from@i,        function(from) new("lgTMatrix", i = from@i, x = from@x,
37                           j = .Call(Matrix_expand_pointers, from@p),                           j = .Call(Matrix_expand_pointers, from@p),
38                           Dim = from@Dim, Dimnames = from@Dimnames))                           Dim = from@Dim, Dimnames = from@Dimnames))
39    
# Line 42  Line 42 
42            new("lgeMatrix", x = c(as(from, "matrix")), # is fast,            new("lgeMatrix", x = c(as(from, "matrix")), # is fast,
43                Dim = from@Dim, Dimnames = from@Dimnames))                Dim = from@Dim, Dimnames = from@Dimnames))
44    
45  setAs("lgCMatrix", "matrix",  setAs("lgCMatrix", "matrix", ## FIXME: this is for ngC !
46        function(from) .Call(lcsc_to_matrix, from))        function(from) .Call(lcsc_to_matrix, from))
47    
48  ## TODO (maybe): write  matrix_to_lcsc()  in ../src/lgCMatrix.c  ## TODO (maybe): write  matrix_to_lcsc()  in ../src/lgCMatrix.c
49  setAs("matrix", "lgCMatrix",  setAs("matrix", "lgCMatrix",
50        function(from) as(as(from, "lgTMatrix"), "lgCMatrix"))        function(from) as(as(from, "lgTMatrix"), "lgCMatrix"))

Legend:
Removed from v.1547  
changed lines
  Added in v.1548

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