SCM

SCM Repository

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

Diff of /pkg/R/sparseMatrix.R

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

revision 1672, Mon Nov 6 20:25:10 2006 UTC revision 1673, Mon Nov 6 20:54:26 2006 UTC
# Line 181  Line 181 
181            })            })
182    
183    
184  ## setReplaceMethod("[", signature(x = "sparseMatrix", i = "index", j = "missing",  ## setReplaceMethod("[", .........)
185  ##                                 value = "numeric"),  ## -> ./Tsparse.R
186  ##                  function (x, i, value) {  ## &  ./Csparse.R
187    ## FIXME: also for RsparseMatrix
188    
 ##                      stop("NOT YET")  
   
 ##                      as(r, class(x))  
 ##                  })  
   
 ## setReplaceMethod("[", signature(x = "sparseMatrix", i = "missing", j = "index",  
 ##                                 value = "numeric"),  
 ##                  function (x, j, value) {  
   
 ##                      stop("NOT YET")  
   
 ##                      as(r, class(x))  
 ##                  })  
   
 ## setReplaceMethod("[", signature(x = "sparseMatrix", i = "index", j = "index",  
 ##                                 value = "numeric"),  
   
 ##                      stop("NOT YET")  
   
 ##                      as(r, class(x))  
 ##                  })  
189    
190    
191  ## "Arith" short cuts / exceptions  ## "Arith" short cuts / exceptions
# Line 294  Line 274 
274      if(logi)      if(logi)
275          x <- array("N", # or as.character(NA),          x <- array("N", # or as.character(NA),
276                     dim(m), dimnames=dimnames(m))                     dim(m), dimnames=dimnames(m))
277      else {      else { ## numeric (or --not yet-- complex):
278          x <- apply(m, 2, format)          x <- apply(m, 2, format)
279          if(is.null(dim(x))) {# e.g. in  1 x 1 case          if(is.null(dim(x))) {# e.g. in  1 x 1 case
280              dim(x) <- dim(m)              dim(x) <- dim(m)
# Line 311  Line 291 
291          ## show only "structural" zeros as 'zero.print', not all of them..          ## show only "structural" zeros as 'zero.print', not all of them..
292          ## -> cannot use 'm'          ## -> cannot use 'm'
293          iN0 <- 1:1 + encodeInd(non0ind(object), nr = nrow(x))          iN0 <- 1:1 + encodeInd(non0ind(object), nr = nrow(x))
294          if(length(iN0)) x[-iN0] <- zero.print else x[] <- zero.print          if(length(iN0)) {
295                decP <- apply(m, 2, function(x) format.info(x)[2])
296                x[-iN0] <- zero.print ## FIXME: ``format it'' such that columns align
297            }
298            else x[] <- zero.print
299      }      }
300      print(x, quote = FALSE, max = maxp)      print(x, quote = FALSE, max = maxp)
301      invisible(object)      invisible(object)

Legend:
Removed from v.1672  
changed lines
  Added in v.1673

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