https://github.com/cran/Matrix
Raw File
Tip revision: 7ea5af322778264973569f6097aea38d8ada1fa4 authored by Doug and Martin on 08 April 2011, 00:00:00 UTC
version 0.999375-50
Tip revision: 7ea5af3
dsparseMatrix.R
### d(ouble)sparseMatrix methods :

setMethod("image", "dsparseMatrix",
	  function(x, ...) image(as(x, "dgTMatrix"), ...))

setMethod("chol", signature(x = "dsparseMatrix"),
	   function(x, pivot=FALSE, ...) {
	       px <- as(x, "symmetricMatrix")
	       if (isTRUE(validObject(px, test=TRUE))) chol(px, pivot, ...)
	       else stop("'x' is not positive definite -- chol() undefined.")
	   })

setMethod("determinant", signature(x = "dsparseMatrix", logarithm = "logical"),
          function(x, logarithm = TRUE, ...)
          determinant(as(x,"CsparseMatrix"), logarithm, ...))
##-> now dgC or dsC or dtC .. which *have* their methods

setMethod("lu", signature(x = "dsparseMatrix"), # "FIXME": do in C, so can cache 'x@factors$LU'
	  function(x, ...) lu(as(x, "dgCMatrix"), ...))


## Group Methods, see ?Arith (e.g.): "Ops" --> ./Ops.R
## -----
## others moved to ./Csparse.R (and 'up' to ./sparseMatrix.R):
##  "Math2" is in ./dMatrix.R


back to top