SCM

SCM Repository

[matrix] Annotation of /pkg/man/lsparseMatrix-classes.Rd
ViewVC logotype

Annotation of /pkg/man/lsparseMatrix-classes.Rd

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1618 - (view) (download) (as text)

1 : bates 723 \name{lsparseMatrix-classes}
2 : bates 720 \docType{class}
3 : bates 723 \alias{lsparseMatrix-class}
4 : bates 720 \alias{lgCMatrix-class}
5 : bates 722 \alias{ltCMatrix-class}
6 :     \alias{lsCMatrix-class}
7 : bates 723 \alias{lgRMatrix-class}
8 :     \alias{ltRMatrix-class}
9 :     \alias{lsRMatrix-class}
10 :     \alias{lgTMatrix-class}
11 :     \alias{ltTMatrix-class}
12 :     \alias{lsTMatrix-class}
13 : maechler 946 %
14 : maechler 956 \alias{-,lsparseMatrix,missing-method}
15 :     \alias{!,lsparseMatrix-method}
16 : bates 720 \alias{\%*\%,lgCMatrix,lgCMatrix-method}
17 : maechler 891 \alias{\%*\%,lsparseMatrix,lsparseMatrix-method}
18 : maechler 925 \alias{\%*\%,lsparseMatrix,ldenseMatrix-method}
19 :     \alias{\%*\%,ldenseMatrix,lsparseMatrix-method}
20 : bates 735 \alias{chol,lsCMatrix,logical-method}
21 :     \alias{chol,lsCMatrix,missing-method}
22 : maechler 956
23 : bates 725 \alias{coerce,lgCMatrix,dgCMatrix-method}
24 : bates 735 \alias{coerce,lgCMatrix,lgTMatrix-method}
25 : maechler 1618 \alias{coerce,lgCMatrix,lsCMatrix-method}
26 : maechler 1285 \alias{coerce,lgCMatrix,lgeMatrix-method}
27 : maechler 868 \alias{coerce,lgCMatrix,matrix-method}
28 : maechler 946 \alias{coerce,lgTMatrix,dgTMatrix-method}
29 : bates 735 \alias{coerce,lgTMatrix,lgCMatrix-method}
30 : maechler 1618 \alias{coerce,lgTMatrix,lsCMatrix-method}
31 : maechler 868 \alias{coerce,lgTMatrix,matrix-method}
32 : maechler 946 \alias{coerce,lsCMatrix,dgTMatrix-method}
33 : bates 725 \alias{coerce,lsCMatrix,dsCMatrix-method}
34 : maechler 946 \alias{coerce,lsCMatrix,lgCMatrix-method}
35 :     \alias{coerce,lsCMatrix,lsTMatrix-method}
36 :     \alias{coerce,lsCMatrix,matrix-method}
37 : maechler 1599 \alias{coerce,lsTMatrix,dsTMatrix-method}
38 :     \alias{coerce,lsTMatrix,lgTMatrix-method}
39 :     \alias{coerce,lsTMatrix,matrix-method}
40 : bates 735 \alias{coerce,ltCMatrix,dtCMatrix-method}
41 : maechler 1174 \alias{coerce,ltCMatrix,dMatrix-method}
42 : maechler 1201 \alias{coerce,ltCMatrix,lgCMatrix-method}
43 : maechler 946 \alias{coerce,ltCMatrix,matrix-method}
44 : maechler 1282 \alias{coerce,matrix,lgCMatrix-method}
45 : maechler 1618 \alias{coerce,matrix,lsCMatrix-method}
46 : maechler 1282 \alias{coerce,matrix,lgTMatrix-method}
47 : maechler 1202 \alias{coerce,matrix,ltCMatrix-method}
48 : maechler 946 %
49 : maechler 1548 \alias{coerce,lsparseMatrix,matrix-method}
50 : maechler 1109 \alias{coerce,ltTMatrix,dtTMatrix-method}
51 : maechler 1201 \alias{coerce,ltTMatrix,lgTMatrix-method}
52 : maechler 1109 \alias{coerce,ltTMatrix,matrix-method}
53 :     %
54 : bates 723 \alias{crossprod,lgCMatrix,missing-method}
55 : bates 735 \alias{crossprod,lgTMatrix,missing-method}
56 : maechler 891 \alias{crossprod,lsparseMatrix-method}
57 :     \alias{crossprod,lsparseMatrix,missing-method}
58 : maechler 925 \alias{crossprod,lsparseMatrix,lsparseMatrix-method}
59 :     \alias{crossprod,lsparseMatrix,ldenseMatrix-method}
60 :     \alias{crossprod,ldenseMatrix,lsparseMatrix-method}
61 : maechler 1314 \alias{diag,lgCMatrix-method}
62 :     \alias{diag,lsparseMatrix-method}
63 : bates 735 \alias{image,lgCMatrix-method}
64 :     \alias{image,lsCMatrix-method}
65 : maechler 1599 \alias{image,lsTMatrix-method}
66 : bates 735 \alias{image,ltCMatrix-method}
67 : maechler 1109 \alias{image,ltTMatrix-method}
68 : bates 720 \alias{t,lgCMatrix-method}
69 : bates 735 \alias{t,lgTMatrix-method}
70 :     \alias{t,lsCMatrix-method}
71 :     \alias{t,ltCMatrix-method}
72 : maechler 1087 \alias{tcrossprod,lgCMatrix,missing-method}
73 :     \alias{tcrossprod,lgTMatrix,missing-method}
74 :     \alias{tcrossprod,lsparseMatrix,missing-method}
75 : bates 723 \title{Sparse logical matrices}
76 :     \description{The \code{lsparseMatrix} class is a virtual class of sparse
77 :     matrices with \code{TRUE}/\code{FALSE} entries. Only the positions of the
78 :     elements that are \code{TRUE} are stored. These can be stored in the
79 :     ``triplet'' form (classes \code{lgTMatrix}, \code{lsTMatrix}, and
80 :     \code{ltTMatrix} which really contain pairs, not triplets) or in
81 : maechler 858 compressed column-oriented form (classes \code{lgCMatrix},
82 :     \code{lsCMatrix}, and \code{ltCMatrix}) or in compressed row-oriented
83 :     form (classes \code{lgRMatrix}, \code{lsRMatrix}, and
84 :     \code{ltRMatrix}). The second letter in the name of these non-virtual
85 :     classes indicates \code{g}eneral, \code{s}ymmetric, or \code{t}riangular.
86 : bates 723 }
87 : bates 720 \section{Objects from the Class}{
88 : bates 723 Objects can be created by calls of the form \code{new("lgCMatrix",
89 :     ...)} and so on. More frequently objects are created by coercion of
90 :     a numeric sparse matrix to the logical form for use in
91 :     the symbolic analysis phase
92 :     of an algorithm involving sparse matrices. Such algorithms often
93 :     involve two phases: a symbolic phase wherein the positions of the
94 :     non-zeros in the result are determined and a numeric phase wherein the
95 :     actual results are calculated. During the symbolic phase only the
96 :     positions of the non-zero elements in any operands are of interest,
97 :     hence any numeric sparse matrices can be treated as logical sparse
98 :     matrices.
99 : bates 720 }
100 :     \section{Slots}{
101 :     \describe{
102 : maechler 1548 \item{\code{x}:}{Object of class \code{"logical"}, i.e., either
103 :     \code{TRUE}, \code{\link{NA}}, or \code{FALSE}.}
104 : bates 722 \item{\code{uplo}:}{Object of class \code{"character"}. Must be
105 :     either "U", for upper triangular, and "L", for lower
106 :     triangular. Present in the triangular and symmetric classes but not
107 :     in the general class.}
108 :     \item{\code{diag}:}{Object of class \code{"character"}. Must be
109 :     either \code{"U"}, for unit triangular (diagonal is all ones), or
110 :     \code{"N"} for non-unit. The implicit diagonal elements are not
111 :     explicitly stored when \code{diag} is \code{"U"}. Present in the
112 :     triangular classes only.}
113 : bates 720 \item{\code{p}:}{Object of class \code{"integer"} of pointers, one
114 : bates 723 for each column (row), to the initial (zero-based) index of elements in
115 :     the column. Present in compressed column-oriented and compressed
116 :     row-oriented forms only.}
117 : bates 720 \item{\code{i}:}{Object of class \code{"integer"} of length nnzero
118 :     (number of non-zero elements). These are the row numbers for
119 : bates 723 each TRUE element in the matrix. All other elements are FALSE.
120 :     Present in triplet and compressed column-oriented forms only.}
121 :     \item{\code{j}:}{Object of class \code{"integer"} of length nnzero
122 :     (number of non-zero elements). These are the column numbers for
123 :     each TRUE element in the matrix. All other elements are FALSE.
124 :     Present in triplet and compressed column-oriented forms only.}
125 : bates 720 \item{\code{Dim}:}{Object of class \code{"integer"} - the dimensions
126 :     of the matrix.}
127 :     }
128 :     }
129 :     \section{Methods}{
130 :     \describe{
131 :     \item{coerce}{\code{signature(from = "dgCMatrix", to = "lgCMatrix")}}
132 :     \item{t}{\code{signature(x = "lgCMatrix")}: returns the transpose
133 :     of \code{x}}
134 :     }
135 :     }
136 :     %\references{}
137 :     %\author{}
138 : bates 723 %\note{}
139 : bates 720 \seealso{
140 : maechler 1281 the class \code{\linkS4class{dgCMatrix}}
141 : bates 720 }
142 : maechler 858 \examples{
143 : maechler 1548 str(m <- Matrix(c(0,0,2:0), 3,5, dimnames=list(LETTERS[1:3],NULL)))
144 :     (lm <- (m > 1)) # lgC
145 :     stopifnot(is(lm,"lsparseMatrix"))
146 : maechler 1285 !lm # no longer sparse
147 : maechler 1576 %% FIXME: m <= 1 -- unfinished implementation ( ../R/dMatrix.R )
148 : maechler 956
149 : maechler 1228 data(KNex)
150 : maechler 1548 str(mmG.1 <- (KNex $ mm) > 0.1)# "lgC..."
151 :     ## from logical to nz_pattern -- okay when there are no NA's :
152 : maechler 1551 nmG.1 <- as(mmG.1, "nMatrix")
153 :     ## from logical to "double"
154 : maechler 1575 dmG.1 <- as(mmG.1, "dMatrix") # and back:
155 :     lmG.1 <- as(dmG.1, "lMatrix")
156 :     stopifnot(validObject(lmG.1), identical(lmG.1, mmG.1))
157 : maechler 1551
158 :     class(xnx <- crossprod(nmG.1))# "nsC.."
159 :     class(xlx <- crossprod(mmG.1))# "dsC.." : numeric
160 : maechler 1576 table(xlx@x != 0)# almost have are (non-structural!) 0
161 :     stopifnot(isSymmetric(xlx), isSymmetric(xnx),
162 :     ## compare xnx and xlx :
163 :     sapply(slotNames(xnx),
164 :     function(n) identical(slot(xnx, n), slot(xlx, n))))
165 : maechler 858 }
166 : bates 720 \keyword{classes}
167 :     \keyword{algebra}

R-Forge@R-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business University of Wisconsin - Madison Powered By FusionForge