@@ -17,12 +17,12 @@ address:
1717 - code : b
1818 address : \url{https://github.com/dselivanov}
1919 - code : c
20- address : \url{http ://dirk.eddelbuettel.com}
20+ address : \url{https ://dirk.eddelbuettel.com}
2121 - code : d
2222 address : \url{https://github.com/thirdwing}
23-
23+
2424lead_author_surname : Ni, Selivanov, Eddelbuettel and Kou
25-
25+
2626doi : " https://cran.r-project.org/package=RcppArmadillo"
2727
2828footer_contents : " RcppArmadillo Vignette"
@@ -42,7 +42,7 @@ bibliography: RcppArmadillo.bib
4242header-includes :
4343 \newcommand{\proglang}[1]{\textsf{#1}}
4444 \newcommand{\pkg}[1]{\textbf{#1}}
45- \newcommand{\R}{\proglang{R}\ }
45+ \newcommand{\R}{\proglang{R}\ }
4646 \newcommand{\Rns}{\proglang{R}}
4747
4848vignette : >
@@ -64,16 +64,16 @@ library(Matrix)
6464
6565The documentation is intended for the convenience of RcppArmadillo sparse matrix users based on
6666integration of the documentation of library
67- [ Matrix] ( https://cran.r-project.org/web/packages/ Matrix/Matrix.pdf ) \citep{CRAN: Matrix } and
68- [ Armadillo] ( http ://arma.sourceforge.net/docs.html#SpMat)
67+ [ Matrix] ( https://cran.r-project.org/package= Matrix/Matrix.pdf ) \citep{CRAN: Matrix } and
68+ [ Armadillo] ( https ://arma.sourceforge.net/docs.html#SpMat)
6969\citep{Sanderson:2010: Armadillo ,Sanderson+Curtin:2016}.
7070
7171There are 31 types of sparse matrices in the [ Matrix] ( https://cran.r-project.org/package=Matrix )
7272package that can be used directly. But for now, only 12 of them are supported in RcppArmadillo:
7373` dgCMatrix ` , ` dtCMatrix ` , ` dsCMatrix ` , ` dgTMatrix ` , ` dtTMatrix ` , ` dsTMatrix ` , ` dgRMatrix ` ,
7474` dtRMatrix ` , ` dsRMatrix ` , ` indMatrix ` , ` pMatrix ` , ` ddiMatrix ` .
7575
76- In the [ Armadillo] ( http ://arma.sourceforge.net/docs.html#SpMat) library, sparse matrix content is
76+ In the [ Armadillo] ( https ://arma.sourceforge.net/docs.html#SpMat) library, sparse matrix content is
7777currently stored as
7878[ CSC] ( https://en.wikipedia.org/wiki/Sparse_matrix#Compressed_sparse_column_.28CSC_or_CCS.29 )
7979format. Such kind of format is quite similar to numeric column-oriented sparse matrix in the library
@@ -103,12 +103,12 @@ or `arma::` as appropriate.
103103
104104- Description: general column-oriented numeric sparse matrix.
105105- Constructor\vspace{-4pt}
106- - ` new("dgCMatrix", ...) `
107- - ` Matrix(*, sparse = TRUE) `
106+ - ` new("dgCMatrix", ...) `
107+ - ` Matrix(*, sparse = TRUE) `
108108 - ` sparseMatrix() `
109109- Coercion\vspace{-4pt}
110- - ` as(*, "CsparseMatrix") `
111- - ` as(*, "dgCMatrix") `
110+ - ` as(*, "CsparseMatrix") `
111+ - ` as(*, "dgCMatrix") `
112112
113113### C++ Code
114114
@@ -125,10 +125,10 @@ arma::sp_mat sqrt_(arma::sp_mat X) {
125125R> i <- c(1,3:8)
126126R> j <- c(2,9,6:10)
127127R> x <- 7 * (1:7)
128- R> A <- sparseMatrix(i, j, x = x)
128+ R> A <- sparseMatrix(i, j, x = x)
129129R> sqrt_(A)
1301308 x 10 sparse Matrix of class "dgCMatrix"
131-
131+
132132[1,] . 2.645751 . . . . . . . .
133133[2,] . . . . . . . . . .
134134[3,] . . . . . . . . 3.741657 .
@@ -145,13 +145,13 @@ R> sqrt_(A)
145145
146146- Description: triangular column-oriented numeric sparse matrix.
147147- Constructor\vspace{-4pt}
148- - ` new("dtCMatrix", ...) `
149- - ` Matrix(*, sparse = TRUE) `
148+ - ` new("dtCMatrix", ...) `
149+ - ` Matrix(*, sparse = TRUE) `
150150 - ` sparseMatrix(*, triangular=TRUE) `
151151- Coercion\vspace{-4pt}
152- - ` as(*, "triangularMatrix") `
153- - ` as(*, "dtCMatrix") `
154-
152+ - ` as(*, "triangularMatrix") `
153+ - ` as(*, "dtCMatrix") `
154+
155155
156156### C++ Code
157157
@@ -185,16 +185,16 @@ R> symmatl_(dtC)
185185
186186- Description: symmetric column-oriented numeric sparse matrix.
187187- Constructor\vspace{-4pt}
188- - ` new("dsCMatrix", ...) `
189- - ` Matrix(*, sparse = TRUE) `
188+ - ` new("dsCMatrix", ...) `
189+ - ` Matrix(*, sparse = TRUE) `
190190 - ` sparseMatrix(*, symmetric = TRUE) `
191191- Coercion\vspace{-4pt}
192192 - ` as(*, "symmetricMatrix") `
193193 - ` as(*, "dsCMatrix") `
194194
195195### C++ Code
196196
197- ``` cpp
197+ ``` cpp
198198// [[Rcpp::export]]
199199arma::sp_mat trimatu_ (arma::sp_mat X) {
200200 return arma::trimatu(X);
@@ -210,7 +210,7 @@ R> x <- 7 * (1:7)
210210R> dsC <- sparseMatrix(i, j, x = x, symmetric = TRUE)
211211R> trimatu_(dsC)
21221210 x 10 sparse Matrix of class "dgCMatrix"
213-
213+
214214[1,] . 7 . . . . . . . .
215215[2,] . . . . . . . . . .
216216[3,] . . . . . . . . 14 .
@@ -230,8 +230,8 @@ R> trimatu_(dsC)
230230
231231- Description: general numeric sparse matrix in triplet form.
232232- Constructor\vspace{-6pt}
233- - ` new("dgTMatrix", ...) `
234- - ` sparseMatrix(*, giveCsparse=FALSE) `
233+ - ` new("dgTMatrix", ...) `
234+ - ` sparseMatrix(*, giveCsparse=FALSE) `
235235 - ` spMatrix() `
236236- Coercion\vspace{-6pt}
237237 - ` as(*, "TsparseMatrix") `
@@ -259,7 +259,7 @@ int trace_(arma::sp_mat X) {
259259### R Code
260260
261261```r
262- R> dgT <- new("dgTMatrix", i = c(1L,1L,0L,3L,3L), j = c(2L,2L,4L,0L,0L),
262+ R> dgT <- new("dgTMatrix", i = c(1L,1L,0L,3L,3L), j = c(2L,2L,4L,0L,0L),
263263 x=10*1:5, Dim=4:5)
264264R> dgT_t <- trans_(dgT)
265265R> prod <- multiply(dgT, dgT_t)
@@ -273,9 +273,9 @@ R> trace_(prod)
273273### Synopsis
274274
275275- Description: triangular numeric sparse matrix in triplet form.
276- - Constructor\vspace{-4pt}
277- - ` new("dtTMatrix", ...) `
278- - ` code{sparseMatrix(*, triangular=TRUE, giveCsparse=FALSE) `
276+ - Constructor\vspace{-4pt}
277+ - ` new("dtTMatrix", ...) `
278+ - ` code{sparseMatrix(*, triangular=TRUE, giveCsparse=FALSE) `
279279- Coercion\vspace{-4pt}
280280 - ` as(*, "triangularMatrix") `
281281 - ` as(*, "dtTMatrix") `
@@ -310,7 +310,7 @@ R> diag_ones(dtT)
310310
311311- Description: symmetric numeric sparse matrix in triplet form.
312312- Constructor\vspace{-4pt}
313- - ` new("dsTMatrix", ...) `
313+ - ` new("dsTMatrix", ...) `
314314 - ` sparseMatrix(*, symmetric=TRUE, giveCsparse=FALSE) `
315315- Coercion\vspace{-4pt}
316316 - ` as(*, "symmetricMatrix") `
@@ -344,7 +344,7 @@ R> trace_(dsT)
344344 - ` new("dgRMatrix", ...) `
345345- Coercion\vspace{-4pt}
346346 - ` as(*, "RsparseMatrix") `
347- - ` as(*, "dgRatrix") `
347+ - ` as(*, "dgRatrix") `
348348
349349### C++ Code
350350
@@ -375,7 +375,7 @@ R> square_(dgR)
375375
376376- Description: triangular row-oriented numeric sparse matrix.
377377- Constructor\vspace{-4pt}
378- - ` new("dtRMatrix", ...) `
378+ - ` new("dtRMatrix", ...) `
379379
380380### C++ Code
381381
@@ -436,9 +436,9 @@ R> sign_(dsR)
436436### Synopsis
437437
438438- Description: index matrix.
439- - Constructor\vspace{-4pt}
439+ - Constructor\vspace{-4pt}
440440 - new("indMatrix", ...)
441- - Coercion\vspace{-4pt}
441+ - Coercion\vspace{-4pt}
442442 - ` as(*, "indMatrix") `
443443
444444### C++ Code
@@ -455,7 +455,7 @@ arma::sp_mat multiply(arma::sp_mat A, arma::sp_mat B) {
455455
456456```r
457457R> ind <- as(2:4, "indMatrix")
458- R> dgT <- new("dgTMatrix", i = c(1L,1L,0L,3L,3L), j = c(2L,2L,4L,0L,0L),
458+ R> dgT <- new("dgTMatrix", i = c(1L,1L,0L,3L,3L), j = c(2L,2L,4L,0L,0L),
459459 x=10*1:5, Dim=4:5)
460460R> multiply(ind, dgT)
4614613 x 5 sparse Matrix of class "dgCMatrix"
@@ -473,7 +473,7 @@ R> multiply(ind, dgT)
473473- Description: permutation matrix.
474474- Constructor\vspace{-4pt}
475475 - ` new("pMatrix", ...) `
476- - Coercion\vspace{-4pt}
476+ - Coercion\vspace{-4pt}
477477 - ` as(*, "pMatrix") `
478478
479479### C++ Code
@@ -490,7 +490,7 @@ arma::sp_mat multiply(arma::sp_mat A, arma::sp_mat B) {
490490
491491```r
492492R> pM <- as(c(2,3,1,4), "pMatrix")
493- R> dgT <- new("dgTMatrix", i = c(1L,1L,0L,3L,3L), j = c(2L,2L,4L,0L,0L),
493+ R> dgT <- new("dgTMatrix", i = c(1L,1L,0L,3L,3L), j = c(2L,2L,4L,0L,0L),
494494 x=10*1:5, Dim=4:5)
495495R> multiply(pM, dgT)
4964964 x 5 sparse Matrix of class "dgCMatrix"
0 commit comments