SCM

SCM Repository

[matrix] View of /pkg/R/nsTMatrix.R
ViewVC logotype

View of /pkg/R/nsTMatrix.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2185 - (download) (annotate)
Sat Apr 26 20:33:16 2008 UTC (11 years, 5 months ago) by mmaechler
File size: 841 byte(s)
more <Ops> methods, notably for lMatrix & nMatrix
#### Sparse Symmetric non-zero pattern Matrices in Triplet format

### contains = "nsparseMatrix"

setAs("nsTMatrix", "matrix",
      function(from) as(as(from, "ngTMatrix"), "matrix"))

setAs("nsTMatrix", "ngCMatrix", # for diag
      function(from) as(as(from, "nsCMatrix"), "ngCMatrix"))

setAs("nsTMatrix", "ngTMatrix",
      function(from) .Call(nsTMatrix_as_ngTMatrix, from))

setAs("nsTMatrix", "dsTMatrix",
      function(from)
      new("dsTMatrix", i = from@i, j = from@j, uplo = from@uplo,
	  x = rep.int(1., length(from@i)),
	  Dim = from@Dim, Dimnames = from@Dimnames))

setAs("nsTMatrix", "nsyMatrix",
      function(from) .Call(nsTMatrix_as_nsyMatrix, from))


setMethod("t", "nsTMatrix",
	  function(x)
	  new("nsTMatrix", Dim = x@Dim, Dimnames = x@Dimnames,
	      i = x@j, j = x@i, uplo = if (x@uplo == "U") "L" else "U"))

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