SCM

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

1 : bates 10 \name{Matrix-class}
2 :     \docType{class}
3 :     \alias{Matrix-class}
4 : maechler 956 \alias{-,Matrix,missing-method}
5 :     \alias{+,Matrix,missing-method}
6 : bates 683 \alias{\%*\%,Matrix,numeric-method}
7 :     \alias{\%*\%,numeric,Matrix-method}
8 : maechler 925 \alias{\%*\%,Matrix,Matrix-method}
9 : maechler 1189 % "[" are in ./Xtrct-methods.Rd <<<<<<<<
10 : maechler 908 \alias{cbind2,Matrix,Matrix-method}
11 :     \alias{cbind2,Matrix,NULL-method}
12 :     \alias{cbind2,Matrix,missing-method}
13 :     \alias{cbind2,NULL,Matrix-method}
14 : maechler 925 \alias{rbind2,Matrix,Matrix-method}
15 :     \alias{rbind2,Matrix,NULL-method}
16 :     \alias{rbind2,Matrix,missing-method}
17 :     \alias{rbind2,NULL,Matrix-method}
18 : bates 683 \alias{crossprod,Matrix,numeric-method}
19 : maechler 925 \alias{crossprod,Matrix,ANY-method}
20 : bates 683 \alias{crossprod,numeric,Matrix-method}
21 : maechler 1315 \alias{diag,Matrix-method}
22 : maechler 1329 \alias{head,Matrix-method}
23 :     \alias{tail,Matrix-method}
24 : bates 683 \alias{solve,Matrix,numeric-method}
25 : maechler 611 \alias{dim,Matrix-method}
26 :     \alias{dimnames,Matrix-method}
27 :     \alias{dimnames<-,Matrix,list-method}
28 : bates 10 \alias{show,Matrix-method}
29 : maechler 956 \alias{as.array,Matrix-method}
30 : maechler 658 \alias{as.matrix,Matrix-method}
31 : maechler 956 \alias{as.vector,Matrix,missing-method}
32 : maechler 946 \alias{t,Matrix-method}
33 : maechler 658 \alias{unname,Matrix-method}
34 : maechler 621 %\alias{coerce,Matrix,matrix-method}
35 : maechler 946 \alias{Compare,Matrix,Matrix-method}
36 :     \alias{Compare,Matrix,ANY-method}
37 :     \alias{Compare,ANY,Matrix-method}
38 : maechler 956 \alias{crossprod,ANY,Matrix-method}
39 :     \alias{kronecker,ANY,Matrix-method}
40 :     \alias{kronecker,Matrix,ANY-method}
41 : maechler 1226 \alias{[,Matrix,lMatrix,missing,ANY-method}
42 :     \alias{[,Matrix,logical,missing,ANY-method}
43 : maechler 946 %
44 : maechler 664 \title{Virtual Class "Matrix" Class of Matrices}
45 : maechler 502 \description{
46 : maechler 611 The \code{Matrix} class is a class contained by all actual
47 : maechler 664 classes in the \pkg{Matrix} package. It is a \dQuote{virtual} class.
48 : maechler 502 }
49 : maechler 538 \section{Slots}{
50 : maechler 956 Common to \emph{all} matrix objects in the package:
51 : maechler 538 \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}:}{list of length two; each component
56 :     containing NULL or a \code{\link{character}} vector length
57 :     equal the corresponding \code{Dim} element.}
58 :     }
59 : maechler 502 }
60 : bates 10 \section{Methods}{
61 :     \describe{
62 : maechler 611 \item{dim}{\code{signature(x = "Matrix")}: extract matrix dimensions
63 :     \code{\link{dim}}.}
64 :     \item{dimnames}{\code{signature(x = "Matrix")}: extract
65 :     \code{\link{dimnames}}.}
66 :     \item{dimnames<-}{\code{signature(x = "Matrix", value = "list")}: set
67 :     the \code{dimnames} to a \code{\link{list}} of length 2, see
68 :     \code{\link{dimnames<-}}.}
69 :     \item{show}{\code{signature(object = "Matrix")}: \code{\link{show}}
70 :     method for \code{\link{print}}ing.}
71 : maechler 1329 \item{head}{\code{signature(object = "Matrix")}: return only the
72 :     \emph{\dQuote{head}}, i.e., the first few rows.}
73 :     \item{tail}{\code{signature(object = "Matrix")}: return only the
74 :     \emph{\dQuote{tail}}, i.e., the last few rows of the respective matrix.}
75 : maechler 956 \cr %------------------------------------
76 :     \item{as.matrix, as.array}{\code{signature(x = "Matrix")}: the same as
77 :     \code{as(x, "matrix")}; see also the note below.}
78 :     \item{as.vector}{\code{signature(x = "Matrix", mode = "missing")}:
79 :     \code{as.vector(m)} should be identical to \code{as.vector(as(m,
80 :     "matrix"))}, implemented more efficiently for some subclasses.}
81 : bates 10 }
82 : maechler 1290 There are many more methods that (conceptually should) work for all
83 :     \code{"Matrix"} objects, e.g., \code{\link{colSums}},
84 :     \code{\link{rowMeans}}. Even \pkg{base} functions may work
85 :     automagically (if they first call \code{\link{as.matrix}()} on their
86 :     principal argument), e.g., \code{\link{apply}}, \code{\link{eigen}},
87 :     \code{\link{svd}} or \code{\link{kappa}} all do work via coercion to a
88 :     \dQuote{traditional} (dense) \code{\link{matrix}}.
89 :     %% --> ../tests/base-matrix-fun.R
90 : bates 10 }
91 : maechler 956 \note{
92 :     Loading the \code{Matrix} namespace \dQuote{overloads}
93 :     \code{\link{as.matrix}} and \code{\link{as.array}} in the \pkg{base}
94 :     namespace by the equivalent of \code{function(x) as(x, "matrix")}.
95 :     Consequently, \code{as.matrix(m)} or \code{as.array(m)} will properly
96 :     work when \code{m} inherits from the \code{"Matrix"} class ---
97 :     \emph{also} for functions in package \pkg{base} and other packages.
98 :     E.g., \code{\link{apply}} or \code{\link{outer}} can therefore be applied
99 :     to \code{"Matrix"} matrices.
100 :     }
101 : bates 10 %\references{}
102 : maechler 956 \author{Douglas Bates \email{bates@stat.wisc.edu} and Martin Maechler}
103 : bates 10 \seealso{
104 : maechler 1281 the classes \code{\linkS4class{dgeMatrix}},
105 :     \code{\linkS4class{dgCMatrix}}, and function
106 : maechler 502 \code{\link{Matrix}} for construction (and examples).
107 : bates 10 }
108 : maechler 1182 \examples{
109 : maechler 956 slotNames("Matrix")
110 :    
111 :     cl <- getClass("Matrix")
112 :     names(cl@subclasses) # more than 40 ..
113 :    
114 :     showClass("Matrix")#> output with slots and all subclasses
115 :     }
116 : bates 10 \keyword{classes}
117 :     \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