SCM

SCM Repository

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

Diff of /pkg/R/dtCMatrix.R

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

revision 1250, Sat Apr 15 13:01:24 2006 UTC revision 1251, Sat Apr 15 13:08:26 2006 UTC
# Line 49  Line 49 
49        })        })
50    
51  setAs("dtCMatrix", "TsparseMatrix", function(from) as(from, "dtTMatrix"))  setAs("dtCMatrix", "TsparseMatrix", function(from) as(from, "dtTMatrix"))
52    
53  setAs("dtCMatrix", "dtrMatrix",  setAs("dtCMatrix", "dtrMatrix",
54        function(from) as(as(from, "dtTMatrix"), "dtrMatrix"))        function(from) as(as(from, "dtTMatrix"), "dtrMatrix"))
55    
56    setMethod("solve", signature(a = "dtCMatrix", b = "missing"),
57              function(a, b, ...) {
58                  if (a@diag == "U") a <- as(as(a, "dtTMatrix"), "dtCMatrix")
59                  .Call("dtCMatrix_solve", a, PACKAGE = "Matrix")
60              }, valueClass = "dtCMatrix")
61    
62    setMethod("solve", signature(a = "dtCMatrix", b = "dgeMatrix"),
63              function(a, b, ...) {
64                  if (a@diag == "U") a <- as(as(a, "dtTMatrix"), "dtCMatrix")
65                  .Call("dtCMatrix_matrix_solve", a, b, TRUE, PACKAGE = "Matrix")
66              }, valueClass = "dgeMatrix")
67    
68    setMethod("solve", signature(a = "dtCMatrix", b = "matrix"),
69              function(a, b, ...) {
70                  if (a@diag == "U") a <- as(as(a, "dtTMatrix"), "dtCMatrix")
71                  storage.mode(b) <- "double"
72                  .Call("dtCMatrix_matrix_solve", a, b, FALSE, PACKAGE = "Matrix")
73              }, valueClass = "dgeMatrix")
74    
75    setMethod("solve", signature(a = "dtCMatrix", b = "numeric"),
76              function(a, b, ...) {
77                  if (a@diag == "U") a <- as(as(a, "dtTMatrix"), "dtCMatrix")
78                  .Call("dtCMatrix_matrix_solve", a, as.matrix(as.double(b)),
79                        FALSE, PACKAGE = "Matrix")
80              }, valueClass = "dgeMatrix")

Legend:
Removed from v.1250  
changed lines
  Added in v.1251

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