SCM

SCM Repository

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

Diff of /pkg/R/lsCMatrix.R

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

revision 1280, Tue May 23 08:01:44 2006 UTC revision 1331, Sat Jul 22 17:59:53 2006 UTC
# Line 19  Line 19 
19  setAs("lsCMatrix", "dgTMatrix",  setAs("lsCMatrix", "dgTMatrix",
20        function(from) as(as(x, "dsCMatrix"), "dgTMatrix"))        function(from) as(as(x, "dsCMatrix"), "dgTMatrix"))
21    
22    ## have rather tril() and triu() methods than
23    ## setAs("lsCMatrix", "ltCMatrix", ....)
24    setMethod("tril", "lsCMatrix",
25              function(x, k = 0, ...) {
26                  if(x@uplo == "L" && k == 0)
27                      ## same internal structure (speedup potential !?)
28                      new("ltCMatrix", uplo = x@uplo, i = x@i, p = x@p,
29                          Dim = x@Dim, Dimnames = x@Dimnames)
30                  else tril(as(x, "lgCMatrix"), k = k, ...)
31              })
32    setMethod("triu", "lsCMatrix",
33              function(x, k = 0, ...) {
34                  if(x@uplo == "U" && k == 0)
35                      ## same internal structure (speedup potential !?)
36                      new("ltCMatrix", uplo = x@uplo, i = x@i, p = x@p,
37                          Dim = x@Dim, Dimnames = x@Dimnames)
38                  else triu(as(x, "lgCMatrix"), k = k, ...)
39              })
40    
41  ## FIXME: generalize to "lsparseMatrix" or (class union)  "symmetric sparse"  ## FIXME: generalize to "lsparseMatrix" or (class union)  "symmetric sparse"
42  setMethod("image", "lsCMatrix",  setMethod("image", "lsCMatrix",
43            function(x, ...) {            function(x, ...) {

Legend:
Removed from v.1280  
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