SCM

SCM Repository

[matrix] Diff of /pkg/R/dsCMatrix.R
ViewVC logotype

Diff of /pkg/R/dsCMatrix.R

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1330, Fri Jul 21 08:28:18 2006 UTC revision 1331, Sat Jul 22 17:59:53 2006 UTC
# Line 44  Line 44 
44  setAs("dsCMatrix", "dsyMatrix",  setAs("dsCMatrix", "dsyMatrix",
45        function(from) as(as(from, "dsTMatrix"), "dsyMatrix"))        function(from) as(as(from, "dsTMatrix"), "dsyMatrix"))
46    
47    ## have rather tril() and triu() methods than
48    ## setAs("dsCMatrix", "dtCMatrix", ....)
49    setMethod("tril", "dsCMatrix",
50              function(x, k = 0, ...) {
51                  if(x@uplo == "L" && k == 0)
52                      ## same internal structure (speedup potential !?)
53                      new("dtCMatrix", uplo = x@uplo, i = x@i, p = x@p,
54                          x = x@x, Dim = x@Dim, Dimnames = x@Dimnames)
55                  else tril(as(x, "dgCMatrix"), k = k, ...)
56              })
57    setMethod("triu", "dsCMatrix",
58              function(x, k = 0, ...) {
59                  if(x@uplo == "U" && k == 0)
60                      ## same internal structure (speedup potential !?)
61                      new("dtCMatrix", uplo = x@uplo, i = x@i, p = x@p,
62                          x = x@x, Dim = x@Dim, Dimnames = x@Dimnames)
63                  else triu(as(x, "dgCMatrix"), k = k, ...)
64              })
65    
66  setMethod("solve", signature(a = "dsCMatrix", b = "dgeMatrix"),  setMethod("solve", signature(a = "dsCMatrix", b = "dgeMatrix"),
67            function(a, b, ...)            function(a, b, ...)
68            .Call(dsCMatrix_matrix_solve, a, b, TRUE),            .Call(dsCMatrix_matrix_solve, a, b, TRUE),

Legend:
Removed from v.1330  
changed lines
  Added in v.1331

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