SCM

SCM Repository

[matrix] Diff of /pkg/Matrix/R/ddenseMatrix.R
ViewVC logotype

Diff of /pkg/Matrix/R/ddenseMatrix.R

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

revision 3078, Tue Mar 31 15:27:56 2015 UTC revision 3079, Tue Mar 31 15:29:43 2015 UTC
# Line 43  Line 43 
43        function(from)        function(from)
44        .Call(dense_to_Csparse, .Call(dup_mMatrix_as_dgeMatrix, from)))        .Call(dense_to_Csparse, .Call(dup_mMatrix_as_dgeMatrix, from)))
45    
46  setMethod("as.numeric", signature(x = "ddenseMatrix"),  setMethod("as.numeric", "ddenseMatrix", function(x, ...) ..2dge(x)@x)
           function(x, ...) as(x, "dgeMatrix")@x)  
47    
48  ## -- see also ./Matrix.R  e.g., for a show() method  ## -- see also ./Matrix.R  e.g., for a show() method
49    
# Line 53  Line 52 
52  ## dgeMatrix. Methods for special forms override these.  ## dgeMatrix. Methods for special forms override these.
53    
54  setMethod("norm", signature(x = "ddenseMatrix", type = "missing"),  setMethod("norm", signature(x = "ddenseMatrix", type = "missing"),
55            function(x, type, ...) norm(as(x, "dgeMatrix")))            function(x, type, ...) norm(..2dge(x)))
56    
57  setMethod("norm", signature(x = "ddenseMatrix", type = "character"),  setMethod("norm", signature(x = "ddenseMatrix", type = "character"),
58            function(x, type, ...) norm(as(x, "dgeMatrix"), type))            function(x, type, ...) norm(..2dge(x), type))
59    
60  setMethod("rcond", signature(x = "ddenseMatrix", norm = "missing"),  setMethod("rcond", signature(x = "ddenseMatrix", norm = "missing"),
61            function(x, norm, ...) rcond(as(x, "dgeMatrix"), ...))            function(x, norm, ...) rcond(..2dge(x), ...))
62    
63  setMethod("rcond", signature(x = "ddenseMatrix", norm = "character"),  setMethod("rcond", signature(x = "ddenseMatrix", norm = "character"),
64            function(x, norm, ...) rcond(as(x, "dgeMatrix"), norm, ...))            function(x, norm, ...) rcond(..2dge(x), norm, ...))
65    
66  ## Not really useful; now require *identical* class for result:  ## Not really useful; now require *identical* class for result:
67  ## setMethod("t", signature(x = "ddenseMatrix"),  ## setMethod("t", signature(x = "ddenseMatrix"),
68  ##        function(x) callGeneric(as(x, "dgeMatrix")))  ##        function(x) callGeneric(..2dge(x)))
69    
70  ## "diag" --> specific methods for dge, dtr,dtp, dsy,dsp  ## "diag" --> specific methods for dge, dtr,dtp, dsy,dsp
71    
72  setMethod("solve", signature(a = "ddenseMatrix", b = "missing"),  setMethod("solve", signature(a = "ddenseMatrix", b = "missing"),
73            function(a, b, ...) solve(as(a, "dgeMatrix")))            function(a, b, ...) solve(..2dge(a)))
74    
75  for(.b in c("Matrix","ANY")) ## << against ambiguity notes  for(.b in c("Matrix","ANY")) ## << against ambiguity notes
76  setMethod("solve", signature(a = "ddenseMatrix", b = .b),  setMethod("solve", signature(a = "ddenseMatrix", b = .b),
77            function(a, b, ...) solve(as(a, "dgeMatrix"), b))            function(a, b, ...) solve(..2dge(a), b))
78  for(.b in c("matrix","numeric")) ## << against ambiguity notes  for(.b in c("matrix","numeric")) ## << against ambiguity notes
79  setMethod("solve", signature(a = "ddenseMatrix", b = .b),  setMethod("solve", signature(a = "ddenseMatrix", b = .b),
80            function(a, b, ...) solve(as(a, "dgeMatrix"), Matrix(b)))            function(a, b, ...) solve(..2dge(a), Matrix(b)))
81  rm(.b)  rm(.b)
82    
83  setMethod("lu", signature(x = "ddenseMatrix"),  setMethod("lu", signature(x = "ddenseMatrix"),
84            function(x, ...)            function(x, ...)
85            .set.factors(x, "LU", lu(as(x, "dgeMatrix"), ...)))            .set.factors(x, "LU", lu(..2dge(x), ...)))
86    
87  setMethod("chol", signature(x = "ddenseMatrix"), cholMat)  setMethod("chol", signature(x = "ddenseMatrix"), cholMat)
88    
89  setMethod("determinant", signature(x = "ddenseMatrix", logarithm = "missing"),  setMethod("determinant", signature(x = "ddenseMatrix", logarithm = "missing"),
90            function(x, logarithm, ...) determinant(as(x, "dgeMatrix")))            function(x, logarithm, ...) determinant(..2dge(x)))
91    
92  setMethod("determinant", signature(x = "ddenseMatrix", logarithm = "logical"),  setMethod("determinant", signature(x = "ddenseMatrix", logarithm = "logical"),
93            function(x, logarithm, ...)            function(x, logarithm, ...)
94            determinant(as(x, "dgeMatrix"), logarithm))            determinant(..2dge(x), logarithm))
95    
96  ## now done for "dMatrix":  ## now done for "dMatrix":
97  ## setMethod("expm", signature(x = "ddenseMatrix"),  ## setMethod("expm", signature(x = "ddenseMatrix"),
98  ##           function(x) callGeneric(as(x, "dgeMatrix")))  ##           function(x) callGeneric(..2dge(x)))
99    
100    
101  .trilDense <- function(x, k = 0, ...) {  .trilDense <- function(x, k = 0, ...) {

Legend:
Removed from v.3078  
changed lines
  Added in v.3079

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