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 1173, Mon Jan 16 20:02:16 2006 UTC revision 1174, Mon Jan 16 20:03:48 2006 UTC
# Line 168  Line 168 
168                              as(t(object), "lgCMatrix"))                              as(t(object), "lgCMatrix"))
169                else stop("not yet implemented")                else stop("not yet implemented")
170            })            })
171    
172    setMethod("isTriangular", signature(object = "sparseMatrix"),
173              function(object, upper) {
174                  ## pretest: is it square?
175                  d <- dim(object)
176                  if(d[1] != d[2]) return(FALSE)
177                  ## else slower test
178                  object <- as(object, "TsparseMatrix")
179                  i <- object@i
180                  j <- object@j
181                  if(upper)
182                      all(i < j)## FIXME or "0" that are not structural..
183                  else
184                      all(i > j)## FIXME or "0" that are not structural..
185              })
186    
187    setMethod("isDiagonal", signature(object = "sparseMatrix"),
188              function(object) {
189                  gT <- as(object, "TsparseMatrix")
190                  all(gT@i == gT@j)
191              })
192    

Legend:
Removed from v.1173  
changed lines
  Added in v.1174

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