The R Project SVN R-packages

Rev

Rev 4440 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4440 Rev 4639
Line 48... Line 48...
48
          function(x, y = NULL)
48
          function(x, y = NULL)
49
          callGeneric(as(x, "lgCMatrix"), as(y, "lgCMatrix")))
49
          callGeneric(as(x, "lgCMatrix"), as(y, "lgCMatrix")))
50
 
50
 
51
 
51
 
52
setMethod("all", signature(x = "lsparseMatrix"),
52
setMethod("all", signature(x = "lsparseMatrix"),
53
	  function(x, ..., na.rm = FALSE)
53
	  function(x, ..., na.rm = FALSE) {
-
 
54
	      d <- x@Dim
-
 
55
	      l.x <- length(x@x)
-
 
56
	      if(l.x == prod(d)) ## fully non-zero
-
 
57
		  all(x@x, ..., na.rm = na.rm)
-
 
58
	      else if(is(x, "symmetricMatrix") && l.x == choose(d[1]+1, 2)) {
-
 
59
		  if(.Generic %in% summGener1)
-
 
60
		      all(x@x, ..., na.rm = na.rm)
54
	  !is(x, "triangularMatrix") && all(x@x, ..., na.rm = na.rm))
61
		  else all(as(x, "generalMatrix")@x, ..., na.rm = na.rm)
-
 
62
	      }
-
 
63
	      else FALSE ## has at least one structural 0
-
 
64
	  })
55
 
65
 
56
setMethod("any", signature(x = "lsparseMatrix"),
66
## setMethod("any", ) ---> ./lMatrix.R
57
	  function(x, ..., na.rm = FALSE)
-
 
58
	  ## logical unit-triangular has TRUE diagonal:
-
 
59
	  (is(x, "triangularMatrix") && x@diag == "U") ||
-
 
60
	  any(x@x, ..., na.rm = na.rm))
-