# SCM Repository

[matrix] Diff of /pkg/Matrix/R/diagMatrix.R
 [matrix] / pkg / Matrix / R / diagMatrix.R

# Diff of /pkg/Matrix/R/diagMatrix.R

revision 2128, Thu Mar 13 23:08:34 2008 UTC revision 2133, Sat Mar 15 18:56:50 2008 UTC
# Line 327  Line 327
327  setMethod("symmpart", signature(x = "diagonalMatrix"), function(x) x)  setMethod("symmpart", signature(x = "diagonalMatrix"), function(x) x)
328  setMethod("skewpart", signature(x = "diagonalMatrix"), setZero)  setMethod("skewpart", signature(x = "diagonalMatrix"), setZero)
329
330  setMethod("chol", signature(x = "ddiMatrix"),# pivot = "ANY"  setMethod("chol", signature(x = "ddiMatrix"),
331            function(x, pivot) {            function(x, pivot, ...) {
332                if(any(x@x < 0)) stop("chol() is undefined for diagonal matrix with negative entries")                if(any(x@x < 0))
333                      stop("chol() is undefined for diagonal matrix with negative entries")
334                x@x <- sqrt(x@x)                x@x <- sqrt(x@x)
335                x                x
336            })            })
337  ## chol(L) is L for logical diagonal:  ## chol(L) is L for logical diagonal:
338  setMethod("chol", signature(x = "ldiMatrix"), function(x, pivot) x)  setMethod("chol", signature(x = "ldiMatrix"), function(x, pivot, ...) x)
339
340  ## Basic Matrix Multiplication {many more to add}  ## Basic Matrix Multiplication {many more to add}
341  ##       ---------------------  ##       ---------------------

Legend:
 Removed from v.2128 changed lines Added in v.2133