SCM

SCM Repository

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

Diff of /pkg/R/dgCMatrix.R

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

revision 1289, Tue Jun 6 14:48:37 2006 UTC revision 1290, Thu Jun 8 09:30:21 2006 UTC
# Line 283  Line 283 
283  setMethod("writeMM", signature(obj = "dgCMatrix"),  setMethod("writeMM", signature(obj = "dgCMatrix"),
284            function(obj, file, ...)            function(obj, file, ...)
285            .Call(Matrix_writeMatrixMarket, obj, as.character(file), "DGC"))            .Call(Matrix_writeMatrixMarket, obj, as.character(file), "DGC"))
286    
287    
288    ## TODO (in C):
289    ## setMethod("colSums", signature(x = "dgCMatrix"),
290    ##        function(x, na.rm = FALSE, dims = 1)
291    ##           .Call(dgCMatrix_colsums, x, na.rm, TRUE, FALSE),
292    ##        valueClass = "numeric")
293    
294    ## setMethod("colMeans", signature(x = "dgCMatrix"),
295    ##        function(x, na.rm = FALSE, dims = 1)
296    ##           .Call(dgCMatrix_colsums, x, na.rm, TRUE, TRUE),
297    ##        valueClass = "numeric")
298    
299    ## Instead (.as.dgT.Fun is in ./Tsparse.R ) :
300    setMethod("colSums",  signature(x = "dgCMatrix"), .as.dgT.Fun)
301    setMethod("colMeans", signature(x = "dgCMatrix"), .as.dgT.Fun)
302    
303    setMethod("rowSums", signature(x = "dgCMatrix"),
304              function(x, na.rm = FALSE, dims = 1)
305              tapply1(x@x, factor(x@i, 0:(x@Dim[1]-1)), sum, na.rm = na.rm),
306              valueClass = "numeric")
307    
308    setMethod("rowMeans", signature(x = "dgCMatrix"),
309              function(x, na.rm = FALSE, dims = 1)
310              tapply1(x@x, factor(x@i, 0:(x@Dim[1]-1)), mean, na.rm = na.rm),
311              valueClass = "numeric")
312    

Legend:
Removed from v.1289  
changed lines
  Added in v.1290

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