# SCM Repository

[matrix] Diff of /pkg/R/dMatrix.R
 [matrix] / pkg / R / dMatrix.R

# Diff of /pkg/R/dMatrix.R

revision 682, Thu Mar 31 08:07:02 2005 UTC revision 683, Thu Mar 31 17:10:16 2005 UTC
# Line 10  Line 10
10  setAs("dMatrix", "matrix",  setAs("dMatrix", "matrix",
11        function(from) as(as(from, "dgeMatrix"), "matrix"))        function(from) as(as(from, "dgeMatrix"), "matrix"))
12
13    ## Methods for operations where one argument is integer
14
15    setMethod("%*%", signature(x = "dMatrix", y = "integer"),
16              function(x, y)
17              callGeneric(x, array(as.numeric(y), c(length(y), 1))),
18              valueClass = "dgeMatrix")
19
20    setMethod("%*%", signature(x = "integer", y = "dMatrix"),
21              function(x, y)
22              callGeneric(array(as.numeric(x), c(1, length(x))), y),
23              valueClass = "dgeMatrix")
24
25    setMethod("crossprod", signature(x = "dMatrix", y = "integer"),
26              function(x, y = NULL)
27              callGeneric(x, array(as.numeric(y), c(length(y), 1))),
28              valueClass = "dgeMatrix")
29
30    setMethod("crossprod", signature(x = "integer", y = "dMatrix"),
31              function(x, y = NULL)
32              callGeneric(array(as.numeric(x), c(1, length(x))), y),
33              valueClass = "dgeMatrix")
34
35    setMethod("solve", signature(a = "dMatrix", b = "integer"),
36              function(a, b, ...)
37              callGeneric(a, array(as.numeric(b), c(length(b), 1))),
38              valueClass = "dgeMatrix")
39
40
41  ## Group Methods, see ?Arith (e.g.)  ## Group Methods, see ?Arith (e.g.)
42  ## -----  ## -----
43

Legend:
 Removed from v.682 changed lines Added in v.683