| Line 24... |
Line 24... |
| 24 |
function(x, y) x)
|
24 |
function(x, y) x)
|
| 25 |
setMethod("cbind2", signature(x = "NULL", y="Matrix"),
|
25 |
setMethod("cbind2", signature(x = "NULL", y="Matrix"),
|
| 26 |
function(x, y) x)
|
26 |
function(x, y) x)
|
| 27 |
## using "atomicVector" not just "numeric"
|
27 |
## using "atomicVector" not just "numeric"
|
| 28 |
setMethod("cbind2", signature(x = "Matrix", y = "atomicVector"),
|
28 |
setMethod("cbind2", signature(x = "Matrix", y = "atomicVector"),
|
| 29 |
function(x, y) callGeneric(x, matrix(y, nrow = nrow(x))))
|
29 |
function(x, y) cbind2(x, matrix(y, nrow = nrow(x))))
|
| 30 |
setMethod("cbind2", signature(x = "atomicVector", y = "Matrix"),
|
30 |
setMethod("cbind2", signature(x = "atomicVector", y = "Matrix"),
|
| 31 |
function(x, y) callGeneric(matrix(x, nrow = nrow(y)), y))
|
31 |
function(x, y) cbind2(matrix(x, nrow = nrow(y)), y))
|
| 32 |
setMethod("cbind2", signature(x = "ANY", y = "Matrix"),
|
32 |
setMethod("cbind2", signature(x = "ANY", y = "Matrix"),
|
| 33 |
function(x, y) .bail.out.2(.Generic, class(x), class(y)))
|
33 |
function(x, y) .bail.out.2(.Generic, class(x), class(y)))
|
| 34 |
setMethod("cbind2", signature(x = "Matrix", y = "ANY"),
|
34 |
setMethod("cbind2", signature(x = "Matrix", y = "ANY"),
|
| 35 |
function(x, y) .bail.out.2(.Generic, class(x), class(y)))
|
35 |
function(x, y) .bail.out.2(.Generic, class(x), class(y)))
|
| 36 |
|
36 |
|
| Line 39... |
Line 39... |
| 39 |
setMethod("rbind2", signature(x = "Matrix", y = "missing"),
|
39 |
setMethod("rbind2", signature(x = "Matrix", y = "missing"),
|
| 40 |
function(x, y) x)
|
40 |
function(x, y) x)
|
| 41 |
setMethod("rbind2", signature(x = "NULL", y="Matrix"),
|
41 |
setMethod("rbind2", signature(x = "NULL", y="Matrix"),
|
| 42 |
function(x, y) x)
|
42 |
function(x, y) x)
|
| 43 |
setMethod("rbind2", signature(x = "Matrix", y = "atomicVector"),
|
43 |
setMethod("rbind2", signature(x = "Matrix", y = "atomicVector"),
|
| 44 |
function(x, y) callGeneric(x, matrix(y, ncol = ncol(x))))
|
44 |
function(x, y) rbind2(x, matrix(y, ncol = ncol(x))))
|
| 45 |
setMethod("rbind2", signature(x = "atomicVector", y = "Matrix"),
|
45 |
setMethod("rbind2", signature(x = "atomicVector", y = "Matrix"),
|
| 46 |
function(x, y) callGeneric(matrix(x, ncol = ncol(y)), y))
|
46 |
function(x, y) rbind2(matrix(x, ncol = ncol(y)), y))
|
| 47 |
setMethod("rbind2", signature(x = "ANY", y = "Matrix"),
|
47 |
setMethod("rbind2", signature(x = "ANY", y = "Matrix"),
|
| 48 |
function(x, y) .bail.out.2(.Generic, class(x), class(y)))
|
48 |
function(x, y) .bail.out.2(.Generic, class(x), class(y)))
|
| 49 |
setMethod("rbind2", signature(x = "Matrix", y = "ANY"),
|
49 |
setMethod("rbind2", signature(x = "Matrix", y = "ANY"),
|
| 50 |
function(x, y) .bail.out.2(.Generic, class(x), class(y)))
|
50 |
function(x, y) .bail.out.2(.Generic, class(x), class(y)))
|
| 51 |
|
51 |
|
| Line 93... |
Line 93... |
| 93 |
y
|
93 |
y
|
| 94 |
})
|
94 |
})
|
| 95 |
|
95 |
|
| 96 |
|
96 |
|
| 97 |
setMethod("cbind2", signature(x = "denseMatrix", y = "matrix"),
|
97 |
setMethod("cbind2", signature(x = "denseMatrix", y = "matrix"),
|
| 98 |
function(x, y) callGeneric(x, as_geSimpl(y)))
|
98 |
function(x, y) cbind2(x, as_geSimpl(y)))
|
| 99 |
setMethod("cbind2", signature(x = "matrix", y = "denseMatrix"),
|
99 |
setMethod("cbind2", signature(x = "matrix", y = "denseMatrix"),
|
| 100 |
function(x, y) callGeneric(as_geSimpl(x), y))
|
100 |
function(x, y) cbind2(as_geSimpl(x), y))
|
| 101 |
|
101 |
|
| 102 |
setMethod("cbind2", signature(x = "denseMatrix", y = "denseMatrix"),
|
102 |
setMethod("cbind2", signature(x = "denseMatrix", y = "denseMatrix"),
|
| 103 |
function(x, y) {
|
103 |
function(x, y) {
|
| 104 |
nr <- rowCheck(x,y)
|
104 |
nr <- rowCheck(x,y)
|
| 105 |
ncx <- x@Dim[2]
|
105 |
ncx <- x@Dim[2]
|
| Line 140... |
Line 140... |
| 140 |
new(paste(.M.kind(x), "geMatrix", sep=''), x = c(x),
|
140 |
new(paste(.M.kind(x), "geMatrix", sep=''), x = c(x),
|
| 141 |
Dim = y@Dim + 1:0, Dimnames = list(dn, y@Dimnames[[2]]))
|
141 |
Dim = y@Dim + 1:0, Dimnames = list(dn, y@Dimnames[[2]]))
|
| 142 |
})
|
142 |
})
|
| 143 |
|
143 |
|
| 144 |
setMethod("rbind2", signature(x = "denseMatrix", y = "matrix"),
|
144 |
setMethod("rbind2", signature(x = "denseMatrix", y = "matrix"),
|
| 145 |
function(x, y) callGeneric(x, as_geSimpl(y)))
|
145 |
function(x, y) rbind2(x, as_geSimpl(y)))
|
| 146 |
setMethod("rbind2", signature(x = "matrix", y = "denseMatrix"),
|
146 |
setMethod("rbind2", signature(x = "matrix", y = "denseMatrix"),
|
| 147 |
function(x, y) callGeneric(as_geSimpl(x), y))
|
147 |
function(x, y) rbind2(as_geSimpl(x), y))
|
| 148 |
|
148 |
|
| 149 |
setMethod("rbind2", signature(x = "denseMatrix", y = "denseMatrix"),
|
149 |
setMethod("rbind2", signature(x = "denseMatrix", y = "denseMatrix"),
|
| 150 |
function(x, y) {
|
150 |
function(x, y) {
|
| 151 |
nc <- colCheck(x,y)
|
151 |
nc <- colCheck(x,y)
|
| 152 |
nrx <- x@Dim[1]
|
152 |
nrx <- x@Dim[1]
|
| Line 199... |
Line 199... |
| 199 |
function(x,y) rbind2(.Call(dense_to_Csparse, x), diag2Sp(y)))
|
199 |
function(x,y) rbind2(.Call(dense_to_Csparse, x), diag2Sp(y)))
|
| 200 |
|
200 |
|
| 201 |
## These are already defined for "Matrix"
|
201 |
## These are already defined for "Matrix"
|
| 202 |
## -- repeated here for method dispatch disambiguation {"design-FIXME" ?}
|
202 |
## -- repeated here for method dispatch disambiguation {"design-FIXME" ?}
|
| 203 |
setMethod("cbind2", signature(x = cls, y = "atomicVector"),
|
203 |
setMethod("cbind2", signature(x = cls, y = "atomicVector"),
|
| 204 |
function(x, y) callGeneric(x, matrix(y, nrow = nrow(x))))
|
204 |
function(x, y) cbind2(x, matrix(y, nrow = nrow(x))))
|
| 205 |
setMethod("cbind2", signature(x = "atomicVector", y = cls),
|
205 |
setMethod("cbind2", signature(x = "atomicVector", y = cls),
|
| 206 |
function(x, y) callGeneric(matrix(x, nrow = nrow(y)), y))
|
206 |
function(x, y) cbind2(matrix(x, nrow = nrow(y)), y))
|
| 207 |
setMethod("rbind2", signature(x = cls, y = "atomicVector"),
|
207 |
setMethod("rbind2", signature(x = cls, y = "atomicVector"),
|
| 208 |
function(x, y) callGeneric(x, matrix(y, ncol = ncol(x))))
|
208 |
function(x, y) rbind2(x, matrix(y, ncol = ncol(x))))
|
| 209 |
setMethod("rbind2", signature(x = "atomicVector", y = cls),
|
209 |
setMethod("rbind2", signature(x = "atomicVector", y = cls),
|
| 210 |
function(x, y) callGeneric(matrix(x, ncol = ncol(y)), y))
|
210 |
function(x, y) rbind2(matrix(x, ncol = ncol(y)), y))
|
| 211 |
}
|
211 |
}
|
| 212 |
|
212 |
|
| 213 |
|
213 |
|
| 214 |
## originally from ./dsparseMatrix.R : --------------------------------
|
214 |
## originally from ./dsparseMatrix.R : --------------------------------
|
| 215 |
|
215 |
|