| Line 14... |
Line 14... |
| 14 |
Objects can be created by calls of the form \code{new("dsRMatrix", ...)}.
|
14 |
Objects can be created by calls of the form \code{new("dsRMatrix", ...)}.
|
| 15 |
}
|
15 |
}
|
| 16 |
\section{Slots}{
|
16 |
\section{Slots}{
|
| 17 |
\describe{
|
17 |
\describe{
|
| 18 |
\item{\code{uplo}:}{A character object indicating if the upper
|
18 |
\item{\code{uplo}:}{A character object indicating if the upper
|
| 19 |
triangle (\code{"U"} or \code{"u"}) or the lower triangle
|
19 |
triangle (\code{"U"}) or the lower triangle (\code{"L"}) is
|
| 20 |
(\code{"L"} or \code{"l"}) is stored. At present only the lower
|
- |
|
| 21 |
triangle form is allowed.}
|
20 |
stored. At present only the lower triangle form is allowed.}
|
| 22 |
%% FIXME: this was by copy-paste-edit: is it ok?
|
- |
|
| 23 |
\item{\code{j}:}{Object of class \code{"integer"} of length
|
21 |
\item{\code{j}:}{Object of class \code{"integer"} of length
|
| 24 |
\code{nnzero} (number of non-zero elements). These are the row
|
22 |
\code{nnzero} (number of non-zero elements). These are the row
|
| 25 |
numbers for each non-zero element in the matrix.}
|
23 |
numbers for each non-zero element in the matrix.}
|
| 26 |
\item{\code{p}:}{Object of class \code{"integer"} of pointers, one
|
24 |
\item{\code{p}:}{Object of class \code{"integer"} of pointers, one
|
| 27 |
for each row, to the initial (zero-based) index of elements in
|
25 |
for each row, to the initial (zero-based) index of elements in
|
| 28 |
the row. (Only present in the \code{dsRMatrix} class.)}
|
26 |
the row.}
|
| 29 |
\item{\code{factors}:}{Object of class \code{"list"} - a list
|
27 |
\item{\code{factors}:}{Object of class \code{"list"} - a list
|
| 30 |
of factorizations of the matrix. }
|
28 |
of factorizations of the matrix.}
|
| 31 |
\item{\code{x}:}{Object of class \code{"numeric"} - the non-zero
|
29 |
\item{\code{x}:}{Object of class \code{"numeric"} - the non-zero
|
| 32 |
elements of the matrix.}
|
30 |
elements of the matrix.}
|
| 33 |
\item{\code{Dim}:}{Object of class \code{"integer"} - the dimensions
|
31 |
\item{\code{Dim}:}{Object of class \code{"integer"} - the dimensions
|
| 34 |
of the matrix - must be an integer vector with exactly two
|
32 |
of the matrix - must be an integer vector with exactly two
|
| 35 |
non-negative values.}
|
33 |
non-negative values.}
|
| 36 |
\item{\code{Dimnames}:}{List of length two, see \code{\link{Matrix}}.}
|
34 |
\item{\code{Dimnames}:}{List of length two, see \code{\link{Matrix}}.}
|
| 37 |
}
|
35 |
}
|
| 38 |
}
|
36 |
}
|
| 39 |
\section{Extends}{
|
37 |
\section{Extends}{
|
| - |
|
38 |
Classes \code{\linkS4class{RsparseMatrix}}, \code{\linkS4class{dsparseMatrix}} and
|
| 40 |
Class \code{"dgRMatrix"}, directly.
|
39 |
\code{\linkS4class{symmetricMatrix}}, directly.
|
| - |
|
40 |
|
| 41 |
Class \code{"dsparseMatrix"}, by class \code{"dgRMatrix"}.
|
41 |
Class \code{"dMatrix"}, by class \code{"dsparseMatrix"},
|
| 42 |
Class \code{"dMatrix"}, by class \code{"dgRMatrix"}.
|
42 |
class \code{"sparseMatrix"}, by class \code{"dsparseMatrix"} or
|
| 43 |
Class \code{"sparseMatrix"}, by class \code{"dgRMatrix"}.
|
43 |
\code{"RsparseMatrix"};
|
| 44 |
Class \code{"Matrix"}, by class \code{"dgRMatrix"}.
|
44 |
class \code{"compMatrix"} by class \code{"symmetricMatrix"} and of course,
|
| 45 |
Class \code{"Matrix"}, by class \code{"dgRMatrix"}.
|
45 |
class \code{"Matrix"}.
|
| 46 |
}
|
46 |
}
|
| 47 |
\section{Methods}{
|
47 |
\section{Methods}{
|
| 48 |
No methods currently with class \code{"dsRMatrix"} in the signature.
|
- |
|
| 49 |
% \describe{
|
48 |
\describe{
|
| 50 |
% \item{solve}{\code{signature(a = "dsRMatrix", b = "matrix")}: Solve
|
49 |
\item{forceSymmetric}{\code{signature(x = "dsRMatrix", uplo = "missing")}:
|
| 51 |
% a linear system of equations defined by \code{x} using a Cholesky
|
50 |
a trivial method just returning \code{x}}
|
| - |
|
51 |
\item{forceSymmetric}{\code{signature(x = "dsRMatrix", uplo = "character")}:
|
| - |
|
52 |
if \code{uplo == x@uplo}, this trivially returns \code{x};
|
| 52 |
% decomposition.}
|
53 |
otherwise \code{t(x)}.}
|
| 53 |
% ......
|
54 |
|
| 54 |
% \item{coerce}{\code{signature(from = "dsRMatrix", to = "dgTMatrix")}}
|
55 |
\item{coerce}{\code{signature(from = "dsCMatrix", to = "dsRMatrix")}}
|
| 55 |
% ......
|
- |
|
| 56 |
% }
|
56 |
}
|
| 57 |
}
|
57 |
}
|
| 58 |
%\references{}
|
- |
|
| 59 |
%\author{}
|
- |
|
| 60 |
%\note{}
|
- |
|
| 61 |
\seealso{
|
58 |
\seealso{
|
| 62 |
the classes \code{\linkS4class{dgCMatrix}},
|
59 |
the classes \code{\linkS4class{dgCMatrix}},
|
| 63 |
\code{\linkS4class{dgTMatrix}}, and \code{\linkS4class{dgeMatrix}}.
|
60 |
\code{\linkS4class{dgTMatrix}}, and \code{\linkS4class{dgeMatrix}}.
|
| 64 |
}
|
61 |
}
|
| 65 |
\examples{
|
62 |
\examples{
|
| Line 67... |
Line 64... |
| 67 |
m2 <- new("dsRMatrix", Dim = c(2L,2L),
|
64 |
m2 <- new("dsRMatrix", Dim = c(2L,2L),
|
| 68 |
x = c(3,1), j = c(1L,1L), p = 0:2)
|
65 |
x = c(3,1), j = c(1L,1L), p = 0:2)
|
| 69 |
m2
|
66 |
m2
|
| 70 |
stopifnot(colSums(as(m2, "TsparseMatrix")) == 3:4)
|
67 |
stopifnot(colSums(as(m2, "TsparseMatrix")) == 3:4)
|
| 71 |
str(m2)
|
68 |
str(m2)
|
| 72 |
if(FALSE)## FIXME: missing coercion
|
69 |
(ds2 <- forceSymmetric(diag(2))) # dsy*
|
| 73 |
str(m3 <- as(Matrix(diag(2)), "dsRMatrix"))
|
70 |
dR <- as(ds2, "RsparseMatrix")
|
| - |
|
71 |
dR # dsRMatrix
|
| 74 |
}
|
72 |
}
|
| 75 |
\keyword{classes}
|
73 |
\keyword{classes}
|
| 76 |
\keyword{algebra}
|
74 |
\keyword{algebra}
|