SCM

SCM Repository

[matrix] Annotation of /pkg/man/sparseMatrix-class.Rd
ViewVC logotype

Annotation of /pkg/man/sparseMatrix-class.Rd

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : maechler 676 \name{sparseMatrix-class}
2 :     \docType{class}
3 : maechler 956 \title{Virtual Class "sparseMatrix" --- Mother of Sparse Matrices}
4 : maechler 676 \alias{sparseMatrix-class}
5 : maechler 1472 %% Group methods
6 :     \alias{Math,sparseMatrix-method}
7 :     %\alias{Math2,sparseMatrix,numeric-method}
8 : maechler 1799 \alias{Ops,sparseMatrix,sparseMatrix-method}
9 :     \alias{Ops,sparseMatrix,numeric-method}
10 :     \alias{Ops,numeric,sparseMatrix-method}
11 : maechler 1654 \alias{Ops,diagonalMatrix,sparseMatrix-method}
12 :     \alias{Ops,sparseMatrix,diagonalMatrix-method}
13 : maechler 1472 %
14 : maechler 1708 \alias{cbind2,sparseMatrix,sparseMatrix-method}
15 :     \alias{cbind2,sparseMatrix,matrix-method}
16 :     \alias{cbind2,matrix,sparseMatrix-method}
17 :     \alias{cbind2,sparseMatrix,numeric-method}
18 :     \alias{cbind2,numeric,sparseMatrix-method}
19 :     \alias{rbind2,sparseMatrix,sparseMatrix-method}
20 :     \alias{rbind2,sparseMatrix,matrix-method}
21 :     \alias{rbind2,matrix,sparseMatrix-method}
22 :     \alias{rbind2,sparseMatrix,numeric-method}
23 :     \alias{rbind2,numeric,sparseMatrix-method}
24 :     %
25 : maechler 1472 \alias{coerce,ANY,sparseMatrix-method}
26 : bates 1898 \alias{coerce,factor,sparseMatrix-method}
27 : maechler 1747 \alias{coerce,sparseMatrix,generalMatrix-method}
28 : maechler 1845 \alias{coerce,sparseMatrix,symmetricMatrix-method}
29 :     \alias{coerce,sparseMatrix,triangularMatrix-method}
30 : maechler 956 \alias{-,sparseMatrix,missing-method}
31 : maechler 1472 \alias{diag,sparseMatrix-method}
32 : maechler 1845 \alias{dim<-,sparseMatrix-method}
33 : maechler 1903 \alias{print,sparseMatrix-method}
34 : maechler 676 \alias{show,sparseMatrix-method}
35 : maechler 1852 \alias{summary,sparseMatrix-method}
36 : maechler 2005 \alias{norm,sparseMatrix,character-method}
37 : maechler 1887 %\alias{colMeans,..} etc are now in ./colSums.Rd
38 : maechler 1271 % graph stuff
39 : maechler 871 \alias{coerce,graph,sparseMatrix-method}
40 : bates 1479 \alias{coerce,graph,CsparseMatrix-method}
41 : maechler 1271 \alias{coerce,graphAM,sparseMatrix-method}
42 : bates 1479 \alias{coerce,graphNEL,CsparseMatrix-method}
43 : maechler 1565 \alias{coerce,graphNEL,TsparseMatrix-method}
44 : maechler 908 \alias{coerce,sparseMatrix,graph-method}
45 :     \alias{coerce,sparseMatrix,graphNEL-method}
46 : maechler 1271 \alias{coerce,TsparseMatrix,graphNEL-method}
47 : maechler 908 \alias{coerce,dgTMatrix,graphNEL-method}
48 : maechler 1271 %
49 : maechler 676 \description{Virtual Mother Class of All Sparse Matrices}
50 :     \section{Slots}{
51 : maechler 925 \describe{
52 :     \item{\code{Dim}:}{Object of class \code{"integer"} - the dimensions
53 :     of the matrix - must be an integer vector with exactly two
54 :     non-negative values.}
55 :     \item{\code{Dimnames}:}{a list of length two - inherited from class
56 : maechler 1281 \code{Matrix}, see \code{\linkS4class{Matrix}}.}
57 : maechler 925 \item{\code{factors}:}{Object of class \code{"list"} - a list
58 :     of factorizations of the matrix. }
59 :     }
60 : maechler 676 }
61 :     \section{Extends}{
62 :     Class \code{"Matrix"}, directly.
63 :     }
64 :     \section{Methods}{
65 :     \describe{
66 : maechler 1855 \item{show}{\code{(object = "sparseMatrix")}: The
67 : maechler 676 \code{\link{show}} method for sparse matrices prints
68 : maechler 1947 \emph{\dQuote{structural}} zeroes as \code{"."} using
69 :     \code{\link{printSpMatrix}()} which allows further customization.}
70 :     \item{print}{\code{signature(x = "sparseMatrix")}, ....\cr
71 :     The \code{\link{print}} method for sparse matrices by default is the
72 :     same as \code{show()} but can be called with extra optional
73 :     arguments, see \code{\link{printSpMatrix}()}.}
74 : maechler 1855 \item{summary}{\code{(object = "sparseMatrix")}: Returns
75 :     an object of S3 class \code{"sparseSummary"} which is basically a
76 :     \code{\link{data.frame}} with columns \code{(i,j,x)} with the
77 :     non-zero entries. The \code{\link{print}} method resemble's
78 :     Matlab's way of printing sparse matrices.}
79 :     \item{diag}{\code{(x = "sparseMatrix")}: extracts the diagonal of a
80 :     sparse matrix.}
81 :     \item{dim<-}{\code{signature(x = "sparseMatrix", value = "ANY")}:
82 :     allows to \emph{reshape} a sparse matrix to a sparse matrix with
83 :     the same entries but different dimensions. \code{value} must be of
84 :     length two and fulfill \code{prod(value) == prod(dim(x))}.}
85 : maechler 1903 \item{coerce}{\code{signature(from = "factor", to = "sparseMatrix")}:
86 : bates 1898 Coercion of a factor to \code{"sparseMatrix"} produces the matrix
87 : maechler 1903 of indicator \bold{rows} stored as an object of class
88 :     \code{"dgCMatrix"}. To obtain columns representing the interaction
89 : bates 1898 of the factor and a numeric covariate, replace the \code{"x"} slot
90 :     of the result by the numeric covariate then take the transpose.}
91 : maechler 676 }
92 : maechler 1855 See also \code{\link{colSums}}, ... %% FIXME
93 :     for methods with separate help pages.
94 : maechler 676 }
95 : bates 685 \note{
96 :     In method selection for multiplication operations (i.e. \code{\%*\%}
97 : maechler 868 and the two-argument form of \code{\link[base]{crossprod}})
98 : bates 685 the sparseMatrix class takes precedence in the sense that if one
99 :     operand is a sparse matrix and the other is any type of dense matrix
100 :     then the dense matrix is coerced to a \code{dgeMatrix} and the
101 :     appropriate sparse matrix method is used.
102 :     }
103 : maechler 676 %\author{Martin}
104 :     \examples{
105 :     showClass("sparseMatrix") ## and look at the help() of its subclasses
106 : maechler 1737 M <- Matrix(0, 10000, 100)
107 :     M[1,1] <- M[2,3] <- 3.14
108 : maechler 1903 M ## show(.) method suppresses printing of the majority of rows
109 :    
110 :     ## factor -> t( <sparse design matrix> ) :
111 :     (fact <- gl(5, 3, 30, labels = LETTERS[1:5]))
112 :     (Xt <- as(fact, "sparseMatrix")) # indicator rows
113 :     X <- t(Xt)
114 : maechler 676 }
115 :     \keyword{classes}

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