The R Project SVN R-packages

Rev

Rev 1387 | Rev 1704 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1387 Rev 1463
Line 235... Line 235...
235
 
235
 
236
setMethod("expm", signature(x = "dgeMatrix"),
236
setMethod("expm", signature(x = "dgeMatrix"),
237
	  function(x) .Call("dgeMatrix_exp", x),
237
	  function(x) .Call("dgeMatrix_exp", x),
238
	  valueClass = "dgeMatrix")
238
	  valueClass = "dgeMatrix")
239
 
239
 
-
 
240
setMethod("colSums", signature(x = "dgeMatrix"),
-
 
241
	  function(x, na.rm = FALSE, dims = 1)
-
 
242
          .Call("dgeMatrix_colsums", x, na.rm, TRUE, FALSE),
-
 
243
	  valueClass = "numeric")
240
 
244
 
-
 
245
setMethod("colMeans", signature(x = "dgeMatrix"),
-
 
246
	  function(x, na.rm = FALSE, dims = 1)
-
 
247
          .Call("dgeMatrix_colsums", x, na.rm, TRUE, TRUE),
-
 
248
	  valueClass = "numeric")
-
 
249
 
-
 
250
setMethod("rowSums", signature(x = "dgeMatrix"),
-
 
251
	  function(x, na.rm = FALSE, dims = 1)
-
 
252
          .Call("dgeMatrix_colsums", x, na.rm, FALSE, FALSE),
-
 
253
	  valueClass = "numeric")
-
 
254
 
-
 
255
setMethod("rowMeans", signature(x = "dgeMatrix"),
-
 
256
	  function(x, na.rm = FALSE, dims = 1)
-
 
257
          .Call("dgeMatrix_colsums", x, na.rm, FALSE, TRUE),
-
 
258
	  valueClass = "numeric")
241
 
259
 
242
### The following all serve for	 as.Matrix()
260
### The following all serve for	 as.Matrix()
243
### which is not yet exported (nor tested):
261
### which is not yet exported (nor tested):
244
 
262
 
245
## utilities for Matrix.class() :
263
## utilities for Matrix.class() :
Line 355... Line 373...
355
    if(is(x, "Matrix")) return(x)
373
    if(is(x, "Matrix")) return(x)
356
    ## else
374
    ## else
357
    as(if(is.matrix(x)) x else as.matrix(x),
375
    as(if(is.matrix(x)) x else as.matrix(x),
358
       Matrix.class(x, tol = tol))
376
       Matrix.class(x, tol = tol))
359
}
377
}
-
 
378