SCM

SCM Repository

[matrix] Annotation of /pkg/R/lgCMatrix.R
ViewVC logotype

Annotation of /pkg/R/lgCMatrix.R

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1548 - (view) (download)

1 : bates 720 #### Logical Sparse Matrices in Compressed column-oriented format
2 :    
3 :     ### contains = "lsparseMatrix"
4 :    
5 : bates 1448 ## Can use CsparseMatrix methods for all of these
6 : bates 720
7 : bates 1448 ## setMethod("%*%", signature(x = "lgCMatrix", y = "lgCMatrix"),
8 :     ## function(x, y)
9 :     ## .Call(lgCMatrix_lgCMatrix_mm, x, y),
10 :     ## valueClass = "lgCMatrix")
11 : bates 720
12 : bates 1448 ## setMethod("t", signature(x = "lgCMatrix"),
13 :     ## function(x) .Call(lgCMatrix_trans, x),
14 :     ## valueClass = "lgCMatrix")
15 : bates 723
16 :    
17 : bates 1448 ## setMethod("diag", signature(x = "lgCMatrix"),
18 :     ## function(x, nrow, ncol = n) .Call(lgCMatrix_diag, x))
19 : maechler 1314
20 : bates 1448 ## setMethod("crossprod", signature(x = "lgCMatrix", y = "missing"),
21 :     ## function(x, y = NULL)
22 :     ## .Call(lgCMatrix_crossprod, x, TRUE, NULL),
23 :     ## valueClass = "lsCMatrix")
24 : maechler 1314
25 : bates 1448 ## setMethod("tcrossprod", signature(x = "lgCMatrix", y = "missing"),
26 :     ## function(x, y = NULL)
27 :     ## .Call(lgCMatrix_crossprod, x, FALSE, NULL),
28 :     ## valueClass = "lsCMatrix")
29 :    
30 : bates 723 setAs("lgCMatrix", "dgCMatrix",
31 :     function(from) new("dgCMatrix", i = from@i, p = from@p,
32 : maechler 1548 x = as.double(from@x),
33 : bates 723 Dim = from@Dim, Dimnames = from@Dimnames))
34 :    
35 : bates 729 setAs("lgCMatrix", "lgTMatrix",
36 : maechler 1548 function(from) new("lgTMatrix", i = from@i, x = from@x,
37 : maechler 1280 j = .Call(Matrix_expand_pointers, from@p),
38 : bates 729 Dim = from@Dim, Dimnames = from@Dimnames))
39 :    
40 : maechler 1285 setAs("lgCMatrix", "lgeMatrix",
41 :     function(from)
42 :     new("lgeMatrix", x = c(as(from, "matrix")), # is fast,
43 :     Dim = from@Dim, Dimnames = from@Dimnames))
44 :    
45 : maechler 1548 setAs("lgCMatrix", "matrix", ## FIXME: this is for ngC !
46 : maechler 1280 function(from) .Call(lcsc_to_matrix, from))
47 : maechler 1548
48 : maechler 1282 ## TODO (maybe): write matrix_to_lcsc() in ../src/lgCMatrix.c
49 :     setAs("matrix", "lgCMatrix",
50 :     function(from) as(as(from, "lgTMatrix"), "lgCMatrix"))
51 : maechler 868
52 :    
53 : bates 729 setMethod("image", "lgCMatrix",
54 :     function(x, ...) {
55 :     x <- as(as(x, "dgCMatrix"), "dgTMatrix")
56 :     callGeneric()
57 :     })
58 :    

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