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 1237, Thu Mar 30 15:23:47 2006 UTC revision 1238, Thu Mar 30 19:56:09 2006 UTC
# Line 197  Line 197 
197                else stop("not yet implemented")                else stop("not yet implemented")
198            })            })
199    
200    
201  setMethod("isTriangular", signature(object = "sparseMatrix"),  setMethod("isTriangular", signature(object = "sparseMatrix"),
202            function(object, upper) {            function(object, upper = NA)
203                ## pretest: is it square?                isTriC(as(object, "CsparseMatrix"), upper))
               d <- dim(object)  
               if(d[1] != d[2]) return(FALSE)  
               ## else slower test  
               object <- as(object, "TsparseMatrix")  
               i <- object@i  
               j <- object@j  
               if(upper)  
                   all(i < j)## FIXME or "0" that are not structural..  
               else  
                   all(i > j)## FIXME or "0" that are not structural..  
           })  
204    
205  setMethod("isDiagonal", signature(object = "sparseMatrix"),  setMethod("isDiagonal", signature(object = "sparseMatrix"),
206            function(object) {            function(object) {

Legend:
Removed from v.1237  
changed lines
  Added in v.1238

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