SCM

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : maechler 1548 \name{nsparseMatrix-classes}
2 :     \docType{class}
3 :     \alias{nsparseMatrix-class}
4 :     \alias{ngCMatrix-class}
5 :     \alias{ntCMatrix-class}
6 :     \alias{nsCMatrix-class}
7 :     \alias{ngRMatrix-class}
8 :     \alias{ntRMatrix-class}
9 :     \alias{nsRMatrix-class}
10 :     \alias{ngTMatrix-class}
11 :     \alias{ntTMatrix-class}
12 :     \alias{nsTMatrix-class}
13 :     %
14 :     \alias{-,nsparseMatrix,missing-method}
15 :     \alias{!,nsparseMatrix-method}
16 :     \alias{\%*\%,ngCMatrix,ngCMatrix-method}
17 :     \alias{\%*\%,nsparseMatrix,nsparseMatrix-method}
18 :     \alias{\%*\%,nsparseMatrix,ndenseMatrix-method}
19 :     \alias{\%*\%,ndenseMatrix,nsparseMatrix-method}
20 :     \alias{chol,nsCMatrix,logical-method}
21 :     \alias{chol,nsCMatrix,missing-method}
22 :    
23 : maechler 1738 \alias{coerce,matrix,ngCMatrix-method}
24 :     \alias{coerce,matrix,ngTMatrix-method}
25 :     \alias{coerce,matrix,ntCMatrix-method}
26 :     \alias{coerce,matrix,ntTMatrix-method}
27 : maechler 1767 \alias{coerce,ngCMatrix,dMatrix-method}
28 :     \alias{coerce,ngCMatrix,lMatrix-method}
29 :     \alias{coerce,ngCMatrix,dsparseMatrix-method}
30 :     \alias{coerce,ngCMatrix,lsparseMatrix-method}
31 :     \alias{coerce,ngCMatrix,matrix-method}
32 : maechler 1548 \alias{coerce,ngCMatrix,dgCMatrix-method}
33 : maechler 1767 \alias{coerce,ngCMatrix,lgCMatrix-method}
34 : maechler 1548 \alias{coerce,ngCMatrix,ngTMatrix-method}
35 :     \alias{coerce,ngCMatrix,ngeMatrix-method}
36 : maechler 1738 \alias{coerce,ngCMatrix,ntCMatrix-method}
37 : maechler 1548 \alias{coerce,ngTMatrix,dgTMatrix-method}
38 : maechler 1747 \alias{coerce,ngTMatrix,lgTMatrix-method}
39 : maechler 1738 \alias{coerce,ngTMatrix,matrix-method}
40 : maechler 1548 \alias{coerce,ngTMatrix,ngCMatrix-method}
41 : maechler 1747 \alias{coerce,ngTMatrix,ngeMatrix-method}
42 : maechler 1738 \alias{coerce,ngTMatrix,ntTMatrix-method}
43 : maechler 1548 \alias{coerce,nsCMatrix,dgTMatrix-method}
44 :     \alias{coerce,nsCMatrix,dsCMatrix-method}
45 : maechler 1767 \alias{coerce,nsCMatrix,dsparseMatrix-method}
46 : maechler 1747 \alias{coerce,nsCMatrix,generalMatrix-method}
47 : maechler 1767 \alias{coerce,nsCMatrix,lsparseMatrix-method}
48 : maechler 1738 \alias{coerce,nsCMatrix,matrix-method}
49 : maechler 1767 \alias{coerce,nsCMatrix,lsCMatrix-method}
50 : maechler 1548 \alias{coerce,nsCMatrix,ngCMatrix-method}
51 :     \alias{coerce,nsCMatrix,nsTMatrix-method}
52 : maechler 1599 \alias{coerce,nsTMatrix,dsTMatrix-method}
53 : maechler 1738 \alias{coerce,nsTMatrix,matrix-method}
54 : maechler 1747 \alias{coerce,nsTMatrix,ngCMatrix-method}
55 : maechler 1599 \alias{coerce,nsTMatrix,ngTMatrix-method}
56 : maechler 1738 \alias{coerce,nsTMatrix,nsCMatrix-method}
57 : maechler 1747 \alias{coerce,nsTMatrix,nsyMatrix-method}
58 : maechler 1738 \alias{coerce,ntCMatrix,dMatrix-method}
59 : maechler 1767 \alias{coerce,ntCMatrix,dsparseMatrix-method}
60 :     \alias{coerce,ntCMatrix,lMatrix-method}
61 :     \alias{coerce,ntCMatrix,lsparseMatrix-method}
62 :     \alias{coerce,ntCMatrix,matrix-method}
63 : maechler 1548 \alias{coerce,ntCMatrix,dtCMatrix-method}
64 : maechler 1767 \alias{coerce,ntCMatrix,ltCMatrix-method}
65 : maechler 1548 \alias{coerce,ntCMatrix,ngCMatrix-method}
66 : maechler 1738 \alias{coerce,ntCMatrix,ntTMatrix-method}
67 : maechler 1548 \alias{coerce,ntTMatrix,dtTMatrix-method}
68 : maechler 1738 \alias{coerce,ntTMatrix,matrix-method}
69 : maechler 1747 \alias{coerce,ntTMatrix,ngCMatrix-method}
70 : maechler 1548 \alias{coerce,ntTMatrix,ngTMatrix-method}
71 : maechler 1738 \alias{coerce,ntTMatrix,ntCMatrix-method}
72 : maechler 1747 \alias{coerce,ntTMatrix,ntrMatrix-method}
73 : maechler 1548 %
74 :     \alias{crossprod,ngCMatrix,missing-method}
75 :     \alias{crossprod,ngTMatrix,missing-method}
76 :     \alias{crossprod,nsparseMatrix-method}
77 :     \alias{crossprod,nsparseMatrix,missing-method}
78 :     \alias{crossprod,nsparseMatrix,nsparseMatrix-method}
79 :     \alias{crossprod,nsparseMatrix,ndenseMatrix-method}
80 :     \alias{crossprod,ndenseMatrix,nsparseMatrix-method}
81 :     \alias{image,ngCMatrix-method}
82 :     \alias{image,nsCMatrix-method}
83 : maechler 1599 \alias{image,nsTMatrix-method}
84 : maechler 1548 \alias{image,ntCMatrix-method}
85 :     \alias{image,ntTMatrix-method}
86 :     \alias{t,ngCMatrix-method}
87 :     \alias{t,ngTMatrix-method}
88 :     \alias{t,nsCMatrix-method}
89 :     \alias{t,ntCMatrix-method}
90 :     \alias{tcrossprod,ngCMatrix,missing-method}
91 :     \alias{tcrossprod,ngTMatrix,missing-method}
92 :     \alias{tcrossprod,nsparseMatrix,missing-method}
93 :     \title{Sparse logical matrices}
94 :     \description{The \code{nsparseMatrix} class is a virtual class of sparse
95 :     matrices with \code{TRUE}/\code{FALSE} entries. Only the positions of the
96 :     elements that are \code{TRUE} are stored. These can be stored in the
97 :     ``triplet'' form (classes \code{ngTMatrix}, \code{nsTMatrix}, and
98 :     \code{ntTMatrix} which really contain pairs, not triplets) or in
99 :     compressed column-oriented form (classes \code{ngCMatrix},
100 :     \code{nsCMatrix}, and \code{ntCMatrix}) or in compressed row-oriented
101 :     form (classes \code{ngRMatrix}, \code{nsRMatrix}, and
102 :     \code{ntRMatrix}). The second letter in the name of these non-virtual
103 :     classes indicates \code{g}eneral, \code{s}ymmetric, or \code{t}riangular.
104 :     }
105 :     \section{Objects from the Class}{
106 :     Objects can be created by calls of the form \code{new("ngCMatrix",
107 :     ...)} and so on. More frequently objects are created by coercion of
108 :     a numeric sparse matrix to the logical form for use in
109 :     the symbolic analysis phase
110 :     of an algorithm involving sparse matrices. Such algorithms often
111 :     involve two phases: a symbolic phase wherein the positions of the
112 :     non-zeros in the result are determined and a numeric phase wherein the
113 :     actual results are calculated. During the symbolic phase only the
114 :     positions of the non-zero elements in any operands are of interest,
115 :     hence any numeric sparse matrices can be treated as logical sparse
116 :     matrices.
117 :     }
118 :     \section{Slots}{
119 :     \describe{
120 :     \item{\code{uplo}:}{Object of class \code{"character"}. Must be
121 :     either "U", for upper triangular, and "L", for lower
122 :     triangular. Present in the triangular and symmetric classes but not
123 :     in the general class.}
124 :     \item{\code{diag}:}{Object of class \code{"character"}. Must be
125 :     either \code{"U"}, for unit triangular (diagonal is all ones), or
126 :     \code{"N"} for non-unit. The implicit diagonal elements are not
127 :     explicitly stored when \code{diag} is \code{"U"}. Present in the
128 :     triangular classes only.}
129 :     \item{\code{p}:}{Object of class \code{"integer"} of pointers, one
130 :     for each column (row), to the initial (zero-based) index of elements in
131 :     the column. Present in compressed column-oriented and compressed
132 :     row-oriented forms only.}
133 :     \item{\code{i}:}{Object of class \code{"integer"} of length nnzero
134 :     (number of non-zero elements). These are the row numbers for
135 :     each TRUE element in the matrix. All other elements are FALSE.
136 :     Present in triplet and compressed column-oriented forms only.}
137 :     \item{\code{j}:}{Object of class \code{"integer"} of length nnzero
138 :     (number of non-zero elements). These are the column numbers for
139 :     each TRUE element in the matrix. All other elements are FALSE.
140 :     Present in triplet and compressed column-oriented forms only.}
141 :     \item{\code{Dim}:}{Object of class \code{"integer"} - the dimensions
142 :     of the matrix.}
143 :     }
144 :     }
145 :     \section{Methods}{
146 :     \describe{
147 :     \item{coerce}{\code{signature(from = "dgCMatrix", to = "ngCMatrix")}}
148 :     \item{t}{\code{signature(x = "ngCMatrix")}: returns the transpose
149 :     of \code{x}}
150 :     }
151 :     }
152 :     %\references{}
153 :     %\author{}
154 :     %\note{}
155 :     \seealso{
156 :     the class \code{\linkS4class{dgCMatrix}}
157 :     }
158 :     \examples{
159 :     (m <- Matrix(c(0,0,2:0), 3,5, dimnames=list(LETTERS[1:3],NULL)))
160 :     ## ``extract the nonzero-pattern of (m) into an nMatrix'':
161 :     nm <- as(m, "ngCMatrix")
162 :     str(nm) # no 'x' slot
163 :     !nm # no longer sparse
164 :     ## consistency check:
165 :     stopifnot(xor(as( nm, "matrix"),
166 :     as(!nm, "matrix")))
167 :    
168 :     data(KNex)
169 :     nmm <- as(KNex $ mm, "ngCMatrix")
170 :     str(xlx <- crossprod(nmm))# "nsCMatrix"
171 :     stopifnot(isSymmetric(xlx))
172 :     image(xlx, main=paste("crossprod(nmm) : Sparse", class(xlx)))
173 :     }
174 :     \keyword{classes}
175 :     \keyword{algebra}

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