├── .Rbuildignore ├── .clang-format ├── .github ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── ISSUE_TEMPLATE │ └── issue_template.md ├── SUPPORT.md └── workflows │ ├── R-CMD-check.yaml │ ├── format.yaml │ ├── pr-commands.yaml │ ├── rhub.yaml │ └── test-coverage.yaml ├── .gitignore ├── CRAN-SUBMISSION ├── DESCRIPTION ├── LICENSE.md ├── Makefile ├── NAMESPACE ├── NEWS.md ├── R ├── cpp11armadillo-package.R ├── template.R ├── vendor.R └── version.R ├── README.Rmd ├── README.md ├── _pkgdown.yml ├── configure ├── configure.win ├── cpp11armadillotest ├── .Rbuildignore ├── .gitignore ├── DESCRIPTION ├── LICENSE.md ├── NAMESPACE ├── R │ ├── cpp11.R │ └── cpp11armadillotest-package.R ├── cleanup ├── configure ├── data │ └── mtcars_mat.rda ├── dev │ ├── configure.ac │ └── data.r ├── man │ ├── cpp11armadillotest-package.Rd │ └── mtcars_mat.Rd ├── src │ ├── 00_main.h │ ├── 01_ols.cpp │ ├── 02_eigen.cpp │ ├── 03_chol.cpp │ ├── 04_qr.cpp │ ├── 05_capm.cpp │ ├── 06_typedefs.cpp │ ├── 07_reproducibility.cpp │ ├── 08_official_documentation_adapted.cpp │ ├── 09_regression.cpp │ ├── 10_sparse_matrices.cpp │ ├── Makevars │ ├── Makevars.in │ ├── Makevars.win │ └── cpp11.cpp ├── tests │ ├── testthat.R │ └── testthat │ │ ├── test-capm.R │ │ ├── test-chol.R │ │ ├── test-eigenvalues.R │ │ ├── test-official-documentation-adapted.R │ │ ├── test-ols.R │ │ ├── test-qr.R │ │ ├── test-regression.R │ │ ├── test-reproducibility.R │ │ ├── test-sparse-matrices.R │ │ └── test-typedefs.R └── vignettes │ ├── .gitignore │ └── intro.Rmd ├── cran-comments.md ├── docs ├── 404.html ├── CODE_OF_CONDUCT.html ├── CONTRIBUTING.html ├── LICENSE.html ├── SUPPORT.html ├── apple-touch-icon.png ├── articles │ ├── basic-usage.html │ ├── basic-usage_files │ │ └── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ ├── configuration.html │ ├── configuration_files │ │ └── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ ├── decompositions-factorisations-inverses-and-equation-solvers-dense.html │ ├── decompositions-factorisations-inverses-and-equation-solvers-dense_files │ │ └── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ ├── decompositions-factorisations-inverses-and-equation-solvers-sparse.html │ ├── decompositions-factorisations-inverses-and-equation-solvers-sparse_files │ │ └── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ ├── functions-of-vector-matrices-cubes.html │ ├── functions-of-vector-matrices-cubes_files │ │ └── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ ├── generated-vectors-matrices-cubes.html │ ├── generated-vectors-matrices-cubes_files │ │ └── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ ├── index.html │ ├── linear-model.html │ ├── linear-model_files │ │ └── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ ├── matrix-vector-cube-and-field-classes.html │ ├── matrix-vector-cube-and-field-classes_files │ │ └── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ ├── member-functions-and-variables.html │ ├── member-functions-and-variables_files │ │ └── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ ├── miscellaneous.html │ ├── miscellaneous_files │ │ └── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ ├── save-load.html │ ├── save-load_files │ │ └── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ ├── signal-and-image-processing.html │ ├── signal-and-image-processing_files │ │ └── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ ├── sparse-matrices.html │ ├── sparse-matrices_files │ │ └── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ ├── statistics-and-clustering.html │ ├── statistics-and-clustering_files │ │ └── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ ├── syntax-comparison-for-matlab-users.html │ └── syntax-comparison-for-matlab-users_files │ │ └── accessible-code-block-0.0.1 │ │ └── empty-anchor.js ├── authors.html ├── deps │ ├── bootstrap-5.3.1 │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.bundle.min.js.map │ │ ├── bootstrap.min.css │ │ ├── font.css │ │ └── fonts │ │ │ ├── 1Ptxg8zYS_SKggPN4iEgvnHyvveLxVs9pbCIPrc.woff │ │ │ ├── 1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCIPrc.woff │ │ │ ├── 1adeadb2fe618c5ed46221f15e12b9c8.woff │ │ │ ├── 4iCs6KVjbNBYlgo6ew.woff │ │ │ ├── 4iCs6KVjbNBYlgoKfw7w.woff │ │ │ ├── 4iCv6KVjbNBYlgoCxCvTtA.woff │ │ │ ├── 4iCv6KVjbNBYlgoCxCvjsGyL.woff │ │ │ ├── 6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7nsDQ.woff │ │ │ ├── 6xK1dSBYKcSV-LCoeQqfX1RYOo3qPa7j.woff │ │ │ ├── 6xK3dSBYKcSV-LCoeQqfX1RYOo3aPA.woff │ │ │ ├── 6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7j.woff │ │ │ ├── 6xKydSBYKcSV-LCoeQqfX1RYOo3i54rAkw.woff │ │ │ ├── 6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vAkw.woff │ │ │ ├── 6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdo.woff │ │ │ ├── 6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zAkw.woff │ │ │ ├── 6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdo.woff │ │ │ ├── CSR54z1Qlv-GDxkbKVQ_dFsvWNRevw.woff │ │ │ ├── CSR54z1Qlv-GDxkbKVQ_dFsvaNA.woff │ │ │ ├── CSR64z1Qlv-GDxkbKVQ_TOQ.woff │ │ │ ├── CSR64z1Qlv-GDxkbKVQ_fOAKSw.woff │ │ │ ├── HI_diYsKILxRpg3hIP6sJ7fM7PqPMcMnZFqUwX28DBKXhM0.woff │ │ │ ├── HI_diYsKILxRpg3hIP6sJ7fM7PqPMcMnZFqUwX28DMyQhM0.woff │ │ │ ├── HI_jiYsKILxRpg3hIP6sJ7fM7PqlOPHYvDP_W9O7GQTTbI1rSg.woff │ │ │ ├── HI_jiYsKILxRpg3hIP6sJ7fM7PqlOPHYvDP_W9O7GQTTsoprSg.woff │ │ │ ├── JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCtZ6Ew9.woff │ │ │ ├── JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCtr6Ew9.woff │ │ │ ├── JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCuM70w9.woff │ │ │ ├── KFOlCnqEu92Fr1MmEU9fBBc-.woff │ │ │ ├── KFOlCnqEu92Fr1MmEU9vAA.woff │ │ │ ├── KFOlCnqEu92Fr1MmSU5fBBc-.woff │ │ │ ├── KFOlCnqEu92Fr1MmSU5vAA.woff │ │ │ ├── KFOlCnqEu92Fr1MmWUlfBBc-.woff │ │ │ ├── KFOlCnqEu92Fr1MmWUlvAA.woff │ │ │ ├── KFOmCnqEu92Fr1Me5g.woff │ │ │ ├── KFOmCnqEu92Fr1Mu4mxM.woff │ │ │ ├── QGYpz_kZZAGCONcK2A4bGOj8mNhL.woff │ │ │ ├── S6u8w4BMUTPHjxsAXC-s.woff │ │ │ ├── S6u8w4BMUTPHjxswWA.woff │ │ │ ├── S6u9w4BMUTPHh6UVSwiPHw.woff │ │ │ ├── S6u9w4BMUTPHh6UVeww.woff │ │ │ ├── S6u9w4BMUTPHh7USSwiPHw.woff │ │ │ ├── S6u9w4BMUTPHh7USeww.woff │ │ │ ├── S6uyw4BMUTPHjx4wWA.woff │ │ │ ├── S6uyw4BMUTPHvxo.woff │ │ │ ├── UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuFuYMZs.woff │ │ │ ├── UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuI6fMZs.woff │ │ │ ├── UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfMZs.woff │ │ │ ├── XRXI3I6Li01BKofiOc5wtlZ2di8HDFwmRTA.woff │ │ │ ├── XRXI3I6Li01BKofiOc5wtlZ2di8HDGUmRTA.woff │ │ │ ├── XRXI3I6Li01BKofiOc5wtlZ2di8HDLshRTA.woff │ │ │ ├── a98f7a7574819ba83bec6279a2cecd95.woff │ │ │ ├── memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk0ZjaVQ.woff │ │ │ ├── memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWVAexg.woff │ │ │ ├── memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkaVQ.woff │ │ │ ├── memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWVAexg.woff │ │ │ ├── memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkaVQ.woff │ │ │ ├── memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk_RkaVQ.woff │ │ │ ├── memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkxhjaVQ.woff │ │ │ ├── memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjWVAexg.woff │ │ │ ├── memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjaVQ.woff │ │ │ ├── memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1x4gaVQ.woff │ │ │ ├── memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1y4k.woff │ │ │ ├── memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsgH1y4k.woff │ │ │ ├── memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgshZ1y4k.woff │ │ │ ├── memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4gaVQ.woff │ │ │ ├── memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0C4k.woff │ │ │ ├── memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4gaVQ.woff │ │ │ ├── memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0C4k.woff │ │ │ ├── memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjr0C4k.woff │ │ │ └── q5uGsou0JOdh94bfvQlr.woff │ ├── bootstrap-toc-1.0.1 │ │ └── bootstrap-toc.min.js │ ├── clipboard.js-2.0.11 │ │ └── clipboard.min.js │ ├── data-deps.txt │ ├── font-awesome-6.4.2 │ │ ├── css │ │ │ ├── all.css │ │ │ ├── all.min.css │ │ │ ├── v4-shims.css │ │ │ └── v4-shims.min.css │ │ └── webfonts │ │ │ ├── fa-brands-400.ttf │ │ │ ├── fa-brands-400.woff2 │ │ │ ├── fa-regular-400.ttf │ │ │ ├── fa-regular-400.woff2 │ │ │ ├── fa-solid-900.ttf │ │ │ ├── fa-solid-900.woff2 │ │ │ ├── fa-v4compatibility.ttf │ │ │ └── fa-v4compatibility.woff2 │ ├── headroom-0.11.0 │ │ ├── headroom.min.js │ │ └── jQuery.headroom.min.js │ ├── jquery-3.6.0 │ │ ├── jquery-3.6.0.js │ │ ├── jquery-3.6.0.min.js │ │ └── jquery-3.6.0.min.map │ └── search-1.0.0 │ │ ├── autocomplete.jquery.min.js │ │ ├── fuse.min.js │ │ └── mark.min.js ├── favicon-96x96.png ├── favicon.ico ├── favicon.svg ├── index.html ├── katex-auto.js ├── lightswitch.js ├── link.svg ├── logo.svg ├── news │ └── index.html ├── pkgdown.js ├── pkgdown.yml ├── reference │ ├── armadillo_version.html │ ├── check_cpp11.html │ ├── cpp11armadillo-package.html │ ├── cpp11armadillo.html │ ├── cpp_vendor.html │ ├── figures │ │ └── logo.svg │ ├── index.html │ └── pkg_template.html ├── search.json ├── site.webmanifest ├── sitemap.xml ├── web-app-manifest-192x192.png └── web-app-manifest-512x512.png ├── inst ├── CITATION ├── WORDLIST ├── arxiv_preprint │ ├── .gitignore │ ├── chicago.csl │ ├── move_pdf.sh │ ├── paper.qmd │ ├── references.bib │ └── template.tex ├── extdata │ ├── NAMESPACE │ ├── README.md │ ├── cleanup │ ├── configure │ ├── dev │ │ ├── 01_load_or_install.R │ │ ├── 02_test.R │ │ ├── 03_readme_and_license.R │ │ └── data.r │ └── src │ │ ├── 00_main.h │ │ ├── 01_ols.cpp │ │ ├── 02_your_functions.cpp │ │ ├── Makevars.in │ │ └── Makevars.win ├── include │ ├── armadillo.hpp │ ├── armadillo │ │ ├── BaseCube_bones.hpp │ │ ├── BaseCube_meat.hpp │ │ ├── Base_bones.hpp │ │ ├── Base_meat.hpp │ │ ├── Col_bones.hpp │ │ ├── Col_meat.hpp │ │ ├── CubeToMatOp_bones.hpp │ │ ├── CubeToMatOp_meat.hpp │ │ ├── Cube_bones.hpp │ │ ├── Cube_meat.hpp │ │ ├── GenCube_bones.hpp │ │ ├── GenCube_meat.hpp │ │ ├── Gen_bones.hpp │ │ ├── Gen_meat.hpp │ │ ├── GlueCube_bones.hpp │ │ ├── GlueCube_meat.hpp │ │ ├── Glue_bones.hpp │ │ ├── Glue_meat.hpp │ │ ├── MapMat_bones.hpp │ │ ├── MapMat_meat.hpp │ │ ├── Mat_bones.hpp │ │ ├── Mat_meat.hpp │ │ ├── OpCube_bones.hpp │ │ ├── OpCube_meat.hpp │ │ ├── Op_bones.hpp │ │ ├── Op_meat.hpp │ │ ├── Proxy.hpp │ │ ├── ProxyCube.hpp │ │ ├── Row_bones.hpp │ │ ├── Row_meat.hpp │ │ ├── SizeCube_bones.hpp │ │ ├── SizeCube_meat.hpp │ │ ├── SizeMat_bones.hpp │ │ ├── SizeMat_meat.hpp │ │ ├── SpBase_bones.hpp │ │ ├── SpBase_meat.hpp │ │ ├── SpCol_bones.hpp │ │ ├── SpCol_meat.hpp │ │ ├── SpGlue_bones.hpp │ │ ├── SpGlue_meat.hpp │ │ ├── SpMat_bones.hpp │ │ ├── SpMat_iterators_meat.hpp │ │ ├── SpMat_meat.hpp │ │ ├── SpOp_bones.hpp │ │ ├── SpOp_meat.hpp │ │ ├── SpProxy.hpp │ │ ├── SpRow_bones.hpp │ │ ├── SpRow_meat.hpp │ │ ├── SpSubview_bones.hpp │ │ ├── SpSubview_col_list_bones.hpp │ │ ├── SpSubview_col_list_meat.hpp │ │ ├── SpSubview_iterators_meat.hpp │ │ ├── SpSubview_meat.hpp │ │ ├── SpToDGlue_bones.hpp │ │ ├── SpToDGlue_meat.hpp │ │ ├── SpToDOp_bones.hpp │ │ ├── SpToDOp_meat.hpp │ │ ├── SpValProxy_bones.hpp │ │ ├── SpValProxy_meat.hpp │ │ ├── access.hpp │ │ ├── arma_cmath.hpp │ │ ├── arma_config.hpp │ │ ├── arma_forward.hpp │ │ ├── arma_ostream_bones.hpp │ │ ├── arma_ostream_meat.hpp │ │ ├── arma_rel_comparators.hpp │ │ ├── arma_rng.hpp │ │ ├── arma_rng_cxx03.hpp │ │ ├── arma_static_check.hpp │ │ ├── arma_str.hpp │ │ ├── arma_version.hpp │ │ ├── arrayops_bones.hpp │ │ ├── arrayops_meat.hpp │ │ ├── auxlib_bones.hpp │ │ ├── auxlib_meat.hpp │ │ ├── band_helper.hpp │ │ ├── compiler_check.hpp │ │ ├── compiler_setup.hpp │ │ ├── compiler_setup_post.hpp │ │ ├── cond_rel_bones.hpp │ │ ├── cond_rel_meat.hpp │ │ ├── config.hpp │ │ ├── config.hpp.cmake │ │ ├── constants.hpp │ │ ├── constants_old.hpp │ │ ├── csv_name.hpp │ │ ├── debug.hpp │ │ ├── def_arpack.hpp │ │ ├── def_atlas.hpp │ │ ├── def_blas.hpp │ │ ├── def_fftw3.hpp │ │ ├── def_lapack.hpp │ │ ├── def_superlu.hpp │ │ ├── diagmat_proxy.hpp │ │ ├── diagview_bones.hpp │ │ ├── diagview_meat.hpp │ │ ├── diskio_bones.hpp │ │ ├── diskio_meat.hpp │ │ ├── distr_param.hpp │ │ ├── eGlueCube_bones.hpp │ │ ├── eGlueCube_meat.hpp │ │ ├── eGlue_bones.hpp │ │ ├── eGlue_meat.hpp │ │ ├── eOpCube_bones.hpp │ │ ├── eOpCube_meat.hpp │ │ ├── eOp_bones.hpp │ │ ├── eOp_meat.hpp │ │ ├── eglue_core_bones.hpp │ │ ├── eglue_core_meat.hpp │ │ ├── eop_aux.hpp │ │ ├── eop_core_bones.hpp │ │ ├── eop_core_meat.hpp │ │ ├── fft_engine_fftw3.hpp │ │ ├── fft_engine_kissfft.hpp │ │ ├── field_bones.hpp │ │ ├── field_meat.hpp │ │ ├── fill.hpp │ │ ├── fn_accu.hpp │ │ ├── fn_all.hpp │ │ ├── fn_any.hpp │ │ ├── fn_approx_equal.hpp │ │ ├── fn_as_scalar.hpp │ │ ├── fn_chi2rnd.hpp │ │ ├── fn_chol.hpp │ │ ├── fn_clamp.hpp │ │ ├── fn_cond_rcond.hpp │ │ ├── fn_conv.hpp │ │ ├── fn_conv_to.hpp │ │ ├── fn_cor.hpp │ │ ├── fn_cov.hpp │ │ ├── fn_cross.hpp │ │ ├── fn_cumprod.hpp │ │ ├── fn_cumsum.hpp │ │ ├── fn_det.hpp │ │ ├── fn_diagmat.hpp │ │ ├── fn_diags_spdiags.hpp │ │ ├── fn_diagvec.hpp │ │ ├── fn_diff.hpp │ │ ├── fn_dot.hpp │ │ ├── fn_eig_gen.hpp │ │ ├── fn_eig_pair.hpp │ │ ├── fn_eig_sym.hpp │ │ ├── fn_eigs_gen.hpp │ │ ├── fn_eigs_sym.hpp │ │ ├── fn_elem.hpp │ │ ├── fn_eps.hpp │ │ ├── fn_expmat.hpp │ │ ├── fn_eye.hpp │ │ ├── fn_fft.hpp │ │ ├── fn_fft2.hpp │ │ ├── fn_find.hpp │ │ ├── fn_find_unique.hpp │ │ ├── fn_flip.hpp │ │ ├── fn_hess.hpp │ │ ├── fn_hist.hpp │ │ ├── fn_histc.hpp │ │ ├── fn_index_max.hpp │ │ ├── fn_index_min.hpp │ │ ├── fn_inplace_strans.hpp │ │ ├── fn_inplace_trans.hpp │ │ ├── fn_interp1.hpp │ │ ├── fn_interp2.hpp │ │ ├── fn_intersect.hpp │ │ ├── fn_inv.hpp │ │ ├── fn_inv_sympd.hpp │ │ ├── fn_join.hpp │ │ ├── fn_kmeans.hpp │ │ ├── fn_kron.hpp │ │ ├── fn_log_det.hpp │ │ ├── fn_log_normpdf.hpp │ │ ├── fn_logmat.hpp │ │ ├── fn_lu.hpp │ │ ├── fn_max.hpp │ │ ├── fn_mean.hpp │ │ ├── fn_median.hpp │ │ ├── fn_min.hpp │ │ ├── fn_misc.hpp │ │ ├── fn_mvnrnd.hpp │ │ ├── fn_n_unique.hpp │ │ ├── fn_nonzeros.hpp │ │ ├── fn_norm.hpp │ │ ├── fn_normalise.hpp │ │ ├── fn_normcdf.hpp │ │ ├── fn_normpdf.hpp │ │ ├── fn_numel.hpp │ │ ├── fn_ones.hpp │ │ ├── fn_orth_null.hpp │ │ ├── fn_pinv.hpp │ │ ├── fn_polyfit.hpp │ │ ├── fn_polyval.hpp │ │ ├── fn_powext.hpp │ │ ├── fn_powmat.hpp │ │ ├── fn_princomp.hpp │ │ ├── fn_prod.hpp │ │ ├── fn_qr.hpp │ │ ├── fn_quantile.hpp │ │ ├── fn_qz.hpp │ │ ├── fn_randg.hpp │ │ ├── fn_randi.hpp │ │ ├── fn_randn.hpp │ │ ├── fn_randperm.hpp │ │ ├── fn_randu.hpp │ │ ├── fn_range.hpp │ │ ├── fn_rank.hpp │ │ ├── fn_regspace.hpp │ │ ├── fn_repelem.hpp │ │ ├── fn_repmat.hpp │ │ ├── fn_reshape.hpp │ │ ├── fn_resize.hpp │ │ ├── fn_reverse.hpp │ │ ├── fn_roots.hpp │ │ ├── fn_schur.hpp │ │ ├── fn_shift.hpp │ │ ├── fn_shuffle.hpp │ │ ├── fn_size.hpp │ │ ├── fn_solve.hpp │ │ ├── fn_sort.hpp │ │ ├── fn_sort_index.hpp │ │ ├── fn_speye.hpp │ │ ├── fn_spones.hpp │ │ ├── fn_sprandn.hpp │ │ ├── fn_sprandu.hpp │ │ ├── fn_spsolve.hpp │ │ ├── fn_sqrtmat.hpp │ │ ├── fn_stddev.hpp │ │ ├── fn_strans.hpp │ │ ├── fn_sum.hpp │ │ ├── fn_svd.hpp │ │ ├── fn_svds.hpp │ │ ├── fn_sylvester.hpp │ │ ├── fn_symmat.hpp │ │ ├── fn_toeplitz.hpp │ │ ├── fn_trace.hpp │ │ ├── fn_trans.hpp │ │ ├── fn_trapz.hpp │ │ ├── fn_trig.hpp │ │ ├── fn_trimat.hpp │ │ ├── fn_trimat_ind.hpp │ │ ├── fn_trunc_exp.hpp │ │ ├── fn_trunc_log.hpp │ │ ├── fn_unique.hpp │ │ ├── fn_var.hpp │ │ ├── fn_vecnorm.hpp │ │ ├── fn_vectorise.hpp │ │ ├── fn_wishrnd.hpp │ │ ├── fn_zeros.hpp │ │ ├── glue_affmul_bones.hpp │ │ ├── glue_affmul_meat.hpp │ │ ├── glue_atan2_bones.hpp │ │ ├── glue_atan2_meat.hpp │ │ ├── glue_conv_bones.hpp │ │ ├── glue_conv_meat.hpp │ │ ├── glue_cor_bones.hpp │ │ ├── glue_cor_meat.hpp │ │ ├── glue_cov_bones.hpp │ │ ├── glue_cov_meat.hpp │ │ ├── glue_cross_bones.hpp │ │ ├── glue_cross_meat.hpp │ │ ├── glue_hist_bones.hpp │ │ ├── glue_hist_meat.hpp │ │ ├── glue_histc_bones.hpp │ │ ├── glue_histc_meat.hpp │ │ ├── glue_hypot_bones.hpp │ │ ├── glue_hypot_meat.hpp │ │ ├── glue_intersect_bones.hpp │ │ ├── glue_intersect_meat.hpp │ │ ├── glue_join_bones.hpp │ │ ├── glue_join_meat.hpp │ │ ├── glue_kron_bones.hpp │ │ ├── glue_kron_meat.hpp │ │ ├── glue_max_bones.hpp │ │ ├── glue_max_meat.hpp │ │ ├── glue_min_bones.hpp │ │ ├── glue_min_meat.hpp │ │ ├── glue_mixed_bones.hpp │ │ ├── glue_mixed_meat.hpp │ │ ├── glue_mvnrnd_bones.hpp │ │ ├── glue_mvnrnd_meat.hpp │ │ ├── glue_polyfit_bones.hpp │ │ ├── glue_polyfit_meat.hpp │ │ ├── glue_polyval_bones.hpp │ │ ├── glue_polyval_meat.hpp │ │ ├── glue_powext_bones.hpp │ │ ├── glue_powext_meat.hpp │ │ ├── glue_quantile_bones.hpp │ │ ├── glue_quantile_meat.hpp │ │ ├── glue_relational_bones.hpp │ │ ├── glue_relational_meat.hpp │ │ ├── glue_solve_bones.hpp │ │ ├── glue_solve_meat.hpp │ │ ├── glue_times_bones.hpp │ │ ├── glue_times_meat.hpp │ │ ├── glue_times_misc_bones.hpp │ │ ├── glue_times_misc_meat.hpp │ │ ├── glue_toeplitz_bones.hpp │ │ ├── glue_toeplitz_meat.hpp │ │ ├── glue_trapz_bones.hpp │ │ ├── glue_trapz_meat.hpp │ │ ├── gmm_diag_bones.hpp │ │ ├── gmm_diag_meat.hpp │ │ ├── gmm_full_bones.hpp │ │ ├── gmm_full_meat.hpp │ │ ├── gmm_misc_bones.hpp │ │ ├── gmm_misc_meat.hpp │ │ ├── hdf5_misc.hpp │ │ ├── hdf5_name.hpp │ │ ├── include_hdf5.hpp │ │ ├── include_superlu.hpp │ │ ├── injector_bones.hpp │ │ ├── injector_meat.hpp │ │ ├── memory.hpp │ │ ├── mp_misc.hpp │ │ ├── mtGlueCube_bones.hpp │ │ ├── mtGlueCube_meat.hpp │ │ ├── mtGlue_bones.hpp │ │ ├── mtGlue_meat.hpp │ │ ├── mtOpCube_bones.hpp │ │ ├── mtOpCube_meat.hpp │ │ ├── mtOp_bones.hpp │ │ ├── mtOp_meat.hpp │ │ ├── mtSpGlue_bones.hpp │ │ ├── mtSpGlue_meat.hpp │ │ ├── mtSpOp_bones.hpp │ │ ├── mtSpOp_meat.hpp │ │ ├── mtSpReduceOp_bones.hpp │ │ ├── mtSpReduceOp_meat.hpp │ │ ├── mul_gemm.hpp │ │ ├── mul_gemm_mixed.hpp │ │ ├── mul_gemv.hpp │ │ ├── mul_herk.hpp │ │ ├── mul_syrk.hpp │ │ ├── newarp_DenseGenMatProd_bones.hpp │ │ ├── newarp_DenseGenMatProd_meat.hpp │ │ ├── newarp_DoubleShiftQR_bones.hpp │ │ ├── newarp_DoubleShiftQR_meat.hpp │ │ ├── newarp_EigsSelect.hpp │ │ ├── newarp_GenEigsSolver_bones.hpp │ │ ├── newarp_GenEigsSolver_meat.hpp │ │ ├── newarp_SortEigenvalue.hpp │ │ ├── newarp_SparseGenMatProd_bones.hpp │ │ ├── newarp_SparseGenMatProd_meat.hpp │ │ ├── newarp_SparseGenRealShiftSolve_bones.hpp │ │ ├── newarp_SparseGenRealShiftSolve_meat.hpp │ │ ├── newarp_SymEigsShiftSolver_bones.hpp │ │ ├── newarp_SymEigsShiftSolver_meat.hpp │ │ ├── newarp_SymEigsSolver_bones.hpp │ │ ├── newarp_SymEigsSolver_meat.hpp │ │ ├── newarp_TridiagEigen_bones.hpp │ │ ├── newarp_TridiagEigen_meat.hpp │ │ ├── newarp_UpperHessenbergEigen_bones.hpp │ │ ├── newarp_UpperHessenbergEigen_meat.hpp │ │ ├── newarp_UpperHessenbergQR_bones.hpp │ │ ├── newarp_UpperHessenbergQR_meat.hpp │ │ ├── newarp_cx_attrib.hpp │ │ ├── op_all_bones.hpp │ │ ├── op_all_meat.hpp │ │ ├── op_any_bones.hpp │ │ ├── op_any_meat.hpp │ │ ├── op_chi2rnd_bones.hpp │ │ ├── op_chi2rnd_meat.hpp │ │ ├── op_chol_bones.hpp │ │ ├── op_chol_meat.hpp │ │ ├── op_clamp_bones.hpp │ │ ├── op_clamp_meat.hpp │ │ ├── op_col_as_mat_bones.hpp │ │ ├── op_col_as_mat_meat.hpp │ │ ├── op_cond_bones.hpp │ │ ├── op_cond_meat.hpp │ │ ├── op_cor_bones.hpp │ │ ├── op_cor_meat.hpp │ │ ├── op_cov_bones.hpp │ │ ├── op_cov_meat.hpp │ │ ├── op_cumprod_bones.hpp │ │ ├── op_cumprod_meat.hpp │ │ ├── op_cumsum_bones.hpp │ │ ├── op_cumsum_meat.hpp │ │ ├── op_cx_scalar_bones.hpp │ │ ├── op_cx_scalar_meat.hpp │ │ ├── op_det_bones.hpp │ │ ├── op_det_meat.hpp │ │ ├── op_diagmat_bones.hpp │ │ ├── op_diagmat_meat.hpp │ │ ├── op_diagvec_bones.hpp │ │ ├── op_diagvec_meat.hpp │ │ ├── op_diff_bones.hpp │ │ ├── op_diff_meat.hpp │ │ ├── op_dot_bones.hpp │ │ ├── op_dot_meat.hpp │ │ ├── op_dotext_bones.hpp │ │ ├── op_dotext_meat.hpp │ │ ├── op_expmat_bones.hpp │ │ ├── op_expmat_meat.hpp │ │ ├── op_fft_bones.hpp │ │ ├── op_fft_meat.hpp │ │ ├── op_find_bones.hpp │ │ ├── op_find_meat.hpp │ │ ├── op_find_unique_bones.hpp │ │ ├── op_find_unique_meat.hpp │ │ ├── op_flip_bones.hpp │ │ ├── op_flip_meat.hpp │ │ ├── op_hist_bones.hpp │ │ ├── op_hist_meat.hpp │ │ ├── op_htrans_bones.hpp │ │ ├── op_htrans_meat.hpp │ │ ├── op_index_max_bones.hpp │ │ ├── op_index_max_meat.hpp │ │ ├── op_index_min_bones.hpp │ │ ├── op_index_min_meat.hpp │ │ ├── op_inv_gen_bones.hpp │ │ ├── op_inv_gen_meat.hpp │ │ ├── op_inv_spd_bones.hpp │ │ ├── op_inv_spd_meat.hpp │ │ ├── op_log_det_bones.hpp │ │ ├── op_log_det_meat.hpp │ │ ├── op_logmat_bones.hpp │ │ ├── op_logmat_meat.hpp │ │ ├── op_max_bones.hpp │ │ ├── op_max_meat.hpp │ │ ├── op_mean_bones.hpp │ │ ├── op_mean_meat.hpp │ │ ├── op_median_bones.hpp │ │ ├── op_median_meat.hpp │ │ ├── op_min_bones.hpp │ │ ├── op_min_meat.hpp │ │ ├── op_misc_bones.hpp │ │ ├── op_misc_meat.hpp │ │ ├── op_nonzeros_bones.hpp │ │ ├── op_nonzeros_meat.hpp │ │ ├── op_norm2est_bones.hpp │ │ ├── op_norm2est_meat.hpp │ │ ├── op_norm_bones.hpp │ │ ├── op_norm_meat.hpp │ │ ├── op_normalise_bones.hpp │ │ ├── op_normalise_meat.hpp │ │ ├── op_orth_null_bones.hpp │ │ ├── op_orth_null_meat.hpp │ │ ├── op_pinv_bones.hpp │ │ ├── op_pinv_meat.hpp │ │ ├── op_powmat_bones.hpp │ │ ├── op_powmat_meat.hpp │ │ ├── op_princomp_bones.hpp │ │ ├── op_princomp_meat.hpp │ │ ├── op_prod_bones.hpp │ │ ├── op_prod_meat.hpp │ │ ├── op_range_bones.hpp │ │ ├── op_range_meat.hpp │ │ ├── op_rank_bones.hpp │ │ ├── op_rank_meat.hpp │ │ ├── op_rcond_bones.hpp │ │ ├── op_rcond_meat.hpp │ │ ├── op_relational_bones.hpp │ │ ├── op_relational_meat.hpp │ │ ├── op_repelem_bones.hpp │ │ ├── op_repelem_meat.hpp │ │ ├── op_repmat_bones.hpp │ │ ├── op_repmat_meat.hpp │ │ ├── op_reshape_bones.hpp │ │ ├── op_reshape_meat.hpp │ │ ├── op_resize_bones.hpp │ │ ├── op_resize_meat.hpp │ │ ├── op_reverse_bones.hpp │ │ ├── op_reverse_meat.hpp │ │ ├── op_roots_bones.hpp │ │ ├── op_roots_meat.hpp │ │ ├── op_row_as_mat_bones.hpp │ │ ├── op_row_as_mat_meat.hpp │ │ ├── op_shift_bones.hpp │ │ ├── op_shift_meat.hpp │ │ ├── op_shuffle_bones.hpp │ │ ├── op_shuffle_meat.hpp │ │ ├── op_sort_bones.hpp │ │ ├── op_sort_index_bones.hpp │ │ ├── op_sort_index_meat.hpp │ │ ├── op_sort_meat.hpp │ │ ├── op_sp_as_dense_bones.hpp │ │ ├── op_sp_as_dense_meat.hpp │ │ ├── op_sp_diagvec_bones.hpp │ │ ├── op_sp_diagvec_meat.hpp │ │ ├── op_sp_max_bones.hpp │ │ ├── op_sp_max_meat.hpp │ │ ├── op_sp_mean_bones.hpp │ │ ├── op_sp_mean_meat.hpp │ │ ├── op_sp_min_bones.hpp │ │ ├── op_sp_min_meat.hpp │ │ ├── op_sp_minus_bones.hpp │ │ ├── op_sp_minus_meat.hpp │ │ ├── op_sp_nonzeros_bones.hpp │ │ ├── op_sp_nonzeros_meat.hpp │ │ ├── op_sp_plus_bones.hpp │ │ ├── op_sp_plus_meat.hpp │ │ ├── op_sp_stddev_bones.hpp │ │ ├── op_sp_stddev_meat.hpp │ │ ├── op_sp_sum_bones.hpp │ │ ├── op_sp_sum_meat.hpp │ │ ├── op_sp_var_bones.hpp │ │ ├── op_sp_var_meat.hpp │ │ ├── op_sp_vecnorm_bones.hpp │ │ ├── op_sp_vecnorm_meat.hpp │ │ ├── op_sqrtmat_bones.hpp │ │ ├── op_sqrtmat_meat.hpp │ │ ├── op_stddev_bones.hpp │ │ ├── op_stddev_meat.hpp │ │ ├── op_strans_bones.hpp │ │ ├── op_strans_meat.hpp │ │ ├── op_sum_bones.hpp │ │ ├── op_sum_meat.hpp │ │ ├── op_symmat_bones.hpp │ │ ├── op_symmat_meat.hpp │ │ ├── op_toeplitz_bones.hpp │ │ ├── op_toeplitz_meat.hpp │ │ ├── op_trimat_bones.hpp │ │ ├── op_trimat_meat.hpp │ │ ├── op_unique_bones.hpp │ │ ├── op_unique_meat.hpp │ │ ├── op_var_bones.hpp │ │ ├── op_var_meat.hpp │ │ ├── op_vecnorm_bones.hpp │ │ ├── op_vecnorm_meat.hpp │ │ ├── op_vectorise_bones.hpp │ │ ├── op_vectorise_meat.hpp │ │ ├── op_wishrnd_bones.hpp │ │ ├── op_wishrnd_meat.hpp │ │ ├── operator_cube_div.hpp │ │ ├── operator_cube_minus.hpp │ │ ├── operator_cube_plus.hpp │ │ ├── operator_cube_relational.hpp │ │ ├── operator_cube_schur.hpp │ │ ├── operator_cube_times.hpp │ │ ├── operator_div.hpp │ │ ├── operator_minus.hpp │ │ ├── operator_ostream.hpp │ │ ├── operator_plus.hpp │ │ ├── operator_relational.hpp │ │ ├── operator_schur.hpp │ │ ├── operator_times.hpp │ │ ├── podarray_bones.hpp │ │ ├── podarray_meat.hpp │ │ ├── promote_type.hpp │ │ ├── restrictors.hpp │ │ ├── running_stat_bones.hpp │ │ ├── running_stat_meat.hpp │ │ ├── running_stat_vec_bones.hpp │ │ ├── running_stat_vec_meat.hpp │ │ ├── sp_auxlib_bones.hpp │ │ ├── sp_auxlib_meat.hpp │ │ ├── span.hpp │ │ ├── spdiagview_bones.hpp │ │ ├── spdiagview_meat.hpp │ │ ├── spglue_join_bones.hpp │ │ ├── spglue_join_meat.hpp │ │ ├── spglue_kron_bones.hpp │ │ ├── spglue_kron_meat.hpp │ │ ├── spglue_max_bones.hpp │ │ ├── spglue_max_meat.hpp │ │ ├── spglue_merge_bones.hpp │ │ ├── spglue_merge_meat.hpp │ │ ├── spglue_min_bones.hpp │ │ ├── spglue_min_meat.hpp │ │ ├── spglue_minus_bones.hpp │ │ ├── spglue_minus_meat.hpp │ │ ├── spglue_plus_bones.hpp │ │ ├── spglue_plus_meat.hpp │ │ ├── spglue_relational_bones.hpp │ │ ├── spglue_relational_meat.hpp │ │ ├── spglue_schur_bones.hpp │ │ ├── spglue_schur_meat.hpp │ │ ├── spglue_times_bones.hpp │ │ ├── spglue_times_meat.hpp │ │ ├── spop_diagmat_bones.hpp │ │ ├── spop_diagmat_meat.hpp │ │ ├── spop_htrans_bones.hpp │ │ ├── spop_htrans_meat.hpp │ │ ├── spop_misc_bones.hpp │ │ ├── spop_misc_meat.hpp │ │ ├── spop_norm_bones.hpp │ │ ├── spop_norm_meat.hpp │ │ ├── spop_normalise_bones.hpp │ │ ├── spop_normalise_meat.hpp │ │ ├── spop_relational_bones.hpp │ │ ├── spop_relational_meat.hpp │ │ ├── spop_repmat_bones.hpp │ │ ├── spop_repmat_meat.hpp │ │ ├── spop_reverse_bones.hpp │ │ ├── spop_reverse_meat.hpp │ │ ├── spop_shift_bones.hpp │ │ ├── spop_shift_meat.hpp │ │ ├── spop_strans_bones.hpp │ │ ├── spop_strans_meat.hpp │ │ ├── spop_symmat_bones.hpp │ │ ├── spop_symmat_meat.hpp │ │ ├── spop_trimat_bones.hpp │ │ ├── spop_trimat_meat.hpp │ │ ├── spop_vectorise_bones.hpp │ │ ├── spop_vectorise_meat.hpp │ │ ├── spsolve_factoriser_bones.hpp │ │ ├── spsolve_factoriser_meat.hpp │ │ ├── strip.hpp │ │ ├── subview_bones.hpp │ │ ├── subview_cube_bones.hpp │ │ ├── subview_cube_each_bones.hpp │ │ ├── subview_cube_each_meat.hpp │ │ ├── subview_cube_meat.hpp │ │ ├── subview_cube_slices_bones.hpp │ │ ├── subview_cube_slices_meat.hpp │ │ ├── subview_each_bones.hpp │ │ ├── subview_each_meat.hpp │ │ ├── subview_elem1_bones.hpp │ │ ├── subview_elem1_meat.hpp │ │ ├── subview_elem2_bones.hpp │ │ ├── subview_elem2_meat.hpp │ │ ├── subview_field_bones.hpp │ │ ├── subview_field_meat.hpp │ │ ├── subview_meat.hpp │ │ ├── sym_helper.hpp │ │ ├── traits.hpp │ │ ├── translate_arpack.hpp │ │ ├── translate_atlas.hpp │ │ ├── translate_blas.hpp │ │ ├── translate_fftw3.hpp │ │ ├── translate_lapack.hpp │ │ ├── translate_superlu.hpp │ │ ├── trimat_helper.hpp │ │ ├── typedef_elem.hpp │ │ ├── typedef_elem_check.hpp │ │ ├── typedef_mat.hpp │ │ ├── typedef_mat_fixed.hpp │ │ ├── unwrap.hpp │ │ ├── unwrap_cube.hpp │ │ ├── unwrap_spmat.hpp │ │ ├── upgrade_val.hpp │ │ ├── wall_clock_bones.hpp │ │ ├── wall_clock_meat.hpp │ │ ├── xtrans_mat_bones.hpp │ │ ├── xtrans_mat_meat.hpp │ │ ├── xvec_htrans_bones.hpp │ │ └── xvec_htrans_meat.hpp │ ├── cpp11armadillo.hpp │ ├── r_messages.hpp │ ├── update_instructions.md │ └── wrappers │ │ ├── matrices.hpp │ │ ├── sparse_matrices.hpp │ │ └── vectors.hpp └── rstudio │ └── templates │ └── project │ ├── cpp11armadillo_small.png │ └── hello_world.dcf ├── man ├── armadillo_version.Rd ├── check_cpp11.Rd ├── cpp11armadillo-package.Rd ├── cpp_vendor.Rd ├── figures │ └── logo.svg └── pkg_template.Rd ├── softwarex-article ├── .gitignore ├── README.txt ├── benchcpp11armadillo │ ├── .Rbuildignore │ ├── DESCRIPTION │ ├── NAMESPACE │ ├── R │ │ ├── benchcpp11armadillo-package.R │ │ ├── cpp11.R │ │ └── solverpp11armadillo-package.R │ ├── README │ ├── dev │ │ ├── 01_load_or_install.R │ │ ├── 02_test.R │ │ ├── 03_readme_and_license.R │ │ └── data.r │ ├── man │ │ └── benchcpp11armadillo-package.Rd │ └── src │ │ ├── 01_bench.cpp │ │ ├── Makevars │ │ ├── Makevars.win │ │ └── cpp11.cpp ├── benchrcpparmadillo │ ├── .Rbuildignore │ ├── DESCRIPTION │ ├── NAMESPACE │ ├── R │ │ ├── RcppExports.R │ │ ├── benchrcpparmadillo-package.R │ │ └── solvercpparmadillo-package.R │ ├── man │ │ └── benchrcpparmadillo-package.Rd │ └── src │ │ ├── 01_bench.cpp │ │ ├── Makevars │ │ ├── Makevars.win │ │ └── RcppExports.cpp ├── bibliography.bib ├── changes.odt ├── cpp11armadillo.qmd ├── data │ ├── 00-run-benchmark-eigenvalues-py.sh │ ├── 00-run-benchmark-multi-py.sh │ ├── 00-run-benchmark-py.sh │ ├── 00-run-benchmark.sh │ ├── README.txt │ ├── benchmark-eig.rds │ ├── benchmark-eigenvalues.py │ ├── benchmark-multi.py │ ├── benchmark-multi.rds │ ├── benchmark-speed-eigenvalues-py.txt │ ├── benchmark-speed-multi-py.txt │ ├── benchmarks.r │ ├── cpp11armadillobenchmark-py.txt │ ├── cpp11armadillobenchmark.txt │ ├── pybenchmark.txt │ ├── stackoverflow.csv │ └── stackoverflow.sql ├── move_pdf.sh ├── references.bib ├── response-to-reviewers-new.txt ├── softwarex.csl ├── stackoverflow.svg └── template.tex ├── tests ├── testthat.R └── testthat │ ├── helper.R │ ├── test-template.R │ ├── test-vendor.R │ └── test-version.R └── vignettes ├── .gitignore ├── basic-usage.Rmd ├── configuration.Rmd ├── decompositions-factorisations-inverses-and-equation-solvers-dense.Rmd ├── decompositions-factorisations-inverses-and-equation-solvers-sparse.Rmd ├── functions-of-vector-matrices-cubes.Rmd ├── generated-vectors-matrices-cubes.Rmd ├── linear-model.Rmd ├── matrix-vector-cube-and-field-classes.Rmd ├── member-functions-and-variables.Rmd ├── miscellaneous.Rmd ├── references.bib ├── save-load.Rmd ├── signal-and-image-processing.Rmd ├── sparse-matrices.Rmd ├── statistics-and-clustering.Rmd └── syntax-comparison-for-matlab-users.Rmd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^\.Renviron$ 4 | ^docs$ 5 | ^vignettes/images$ 6 | ^\.github$ 7 | ^\.vscode$ 8 | ^dev$ 9 | ^LICENSE\.md$ 10 | ^README\.Rmd$ 11 | ^README\.html$ 12 | ^cpp11armadillotest$ 13 | ^econometrics$ 14 | ^pkgdown$ 15 | ^Makefile$ 16 | ^\.clang-format$ 17 | ^CRAN-SUBMISSION$ 18 | ^cran-comments\.md$ 19 | inst/arxiv_preprint 20 | inst/paper 21 | ^_pkgdown\.yml$ 22 | ^inst/include/update_instructions\.md$ 23 | ^softwarex-article$ 24 | -------------------------------------------------------------------------------- /.clang-format: -------------------------------------------------------------------------------- 1 | BasedOnStyle: Google 2 | DerivePointerAlignment: false 3 | ColumnLimit: 90 4 | IncludeBlocks: Preserve 5 | -------------------------------------------------------------------------------- /.github/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/issue_template.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report or feature request 3 | about: Describe a bug you've seen or make a case for a new feature 4 | --- 5 | 6 | Please briefly describe your problem and what output you expect. 7 | 8 | Please include a minimal reproducible example (AKA a reprex). If you've never heard of a [reprex](http://reprex.tidyverse.org/) before, start by reading . 9 | 10 | Brief description of the problem 11 | 12 | ```r 13 | # insert reprex here 14 | ``` 15 | -------------------------------------------------------------------------------- /.github/workflows/format.yaml: -------------------------------------------------------------------------------- 1 | on: 2 | push: 3 | branches: main 4 | pull_request: 5 | branches: 6 | - main 7 | 8 | name: format_check 9 | 10 | jobs: 11 | format_check: 12 | runs-on: ubuntu-24.04 13 | steps: 14 | - uses: actions/checkout@v4 15 | 16 | - name: Set up LLVM repository 17 | run: | 18 | sudo apt-get update 19 | sudo apt-get install -y wget gnupg 20 | wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - 21 | sudo sh -c 'echo "deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main" >> /etc/apt/sources.list' 22 | sudo sh -c 'echo "deb-src http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main" >> /etc/apt/sources.list' 23 | sudo apt-get update 24 | 25 | - name: Install ClangFormat 26 | run: sudo apt-get install -y clang-format-19 27 | 28 | - name: Run ClangFormat 29 | run: make format clang_format=clang-format-19 30 | 31 | - name: Check for a non-empty diff 32 | run: git diff-files -U --exit-code 33 | -------------------------------------------------------------------------------- /.github/workflows/test-coverage.yaml: -------------------------------------------------------------------------------- 1 | # Workflow derived from https://github.com/r-lib/actions/tree/v2/examples 2 | # Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help 3 | on: 4 | push: 5 | branches: [main] 6 | pull_request: 7 | branches: [main] 8 | 9 | name: test-coverage 10 | 11 | jobs: 12 | test-coverage: 13 | runs-on: ubuntu-22.04 14 | env: 15 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} 16 | 17 | steps: 18 | - uses: actions/checkout@v4 19 | 20 | - uses: r-lib/actions/setup-r@v2 21 | with: 22 | use-public-rspm: true 23 | 24 | - uses: r-lib/actions/setup-r-dependencies@v2 25 | with: 26 | extra-packages: any::covr 27 | needs: coverage 28 | 29 | - name: Install cpp11armadillotest 30 | run: | 31 | options(warn = 2) 32 | pak::pkg_install("pachadotdev/cpp11armadillo", dependencies = TRUE) 33 | pak::local_install_dev_deps("cpp11armadillotest", dependencies = TRUE) 34 | install.packages("cpp11armadillotest", repos = NULL, INSTALL_opts = "--install-tests", type = "source") 35 | shell: Rscript {0} 36 | 37 | - name: Test coverage 38 | run: covr::codecov(quiet = FALSE) 39 | shell: Rscript {0} 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | .Rhistory 6 | .vscode 7 | inst/doc 8 | README.html 9 | *.o 10 | *.so 11 | dev/benchmarks.rds 12 | dev/benchmarks.r 13 | dev/benchmarks_cpp11.cpp 14 | pkgdown 15 | inst/arxiv_preprint/paper.aux 16 | inst/arxiv_preprint/paper.idx 17 | inst/arxiv_preprint/paper.out 18 | inst/arxiv_preprint/paper.pdf 19 | inst/arxiv_preprint/paper.toc 20 | inst/arxiv_preprint/paper.tex 21 | inst/paper 22 | econometrics/dev/hansen-codes 23 | econometrics/dev/econometricsprograms.zip 24 | -------------------------------------------------------------------------------- /CRAN-SUBMISSION: -------------------------------------------------------------------------------- 1 | Version: 0.5.2 2 | Date: 2025-05-22 23:08:14 UTC 3 | SHA: c6ae36039e01dcfb52321a83209c08749cfd0337 4 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: cpp11armadillo 2 | Type: Package 3 | Title: An 'Armadillo' Interface 4 | Description: Provides function declarations and inline function definitions that 5 | facilitate communication between R and the 'Armadillo' 'C++' library for 6 | linear algebra and scientific computing. This implementation is detailed 7 | in Vargas Sepulveda and Schneider Malamud (2024) 8 | . 9 | Version: 0.5.3 10 | Authors@R: c( 11 | person( 12 | given = "Mauricio", 13 | family = "Vargas Sepulveda", 14 | role = c("aut", "cre"), 15 | email = "m.sepulveda@mail.utoronto.ca", 16 | comment = c(ORCID = "0000-0003-1017-7574")), 17 | person( 18 | given = "Jonathan", 19 | family = "Schneider Malamud", 20 | role = c("ctb")), 21 | person( 22 | given = "Conrad", 23 | family = "Sanderson", 24 | role = c("aut"), 25 | comment = "Armadillo library (C++)") 26 | ) 27 | Imports: 28 | cpp11 29 | Suggests: 30 | desc, 31 | knitr, 32 | mockery, 33 | rmarkdown, 34 | testthat (>= 3.0.0), 35 | withr 36 | Depends: R(>= 3.5.0) 37 | License: Apache License (>= 2) 38 | BugReports: https://github.com/pachadotdev/cpp11armadillo/issues 39 | URL: https://pacha.dev/cpp11armadillo/, 40 | https://github.com/pachadotdev/cpp11armadillo 41 | RoxygenNote: 7.3.2 42 | Encoding: UTF-8 43 | VignetteBuilder: knitr 44 | Config/testthat/edition: 3 45 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | clean: 2 | @Rscript -e 'devtools::clean_dll()' 3 | @Rscript -e 'devtools::clean_dll("cpp11armadillotest")' 4 | 5 | test: 6 | @echo "Testing R code" 7 | @Rscript -e 'devtools::document(); devtools::test(); devtools::install()' 8 | @echo "Testing C++ code" 9 | @Rscript -e 'devtools::clean_dll("cpp11armadillotest"); devtools::load_all("cpp11armadillotest"); devtools::test("cpp11armadillotest")' 10 | 11 | check: 12 | @echo "Local" 13 | @Rscript -e 'devtools::install()' 14 | @Rscript -e 'devtools::check(); devtools::check("cpp11armadillotest")' 15 | 16 | site: 17 | @Rscript -e 'devtools::document()' 18 | @Rscript -e 'pkgdown::build_site()' 19 | 20 | install: 21 | @Rscript -e 'devtools::install()' 22 | 23 | clang_format=`which clang-format-19` 24 | 25 | format: $(shell find . -name '*.h') $(shell find . -name '*.hpp') $(shell find . -name '*.cpp') 26 | @${clang_format} -i $? 27 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(armadillo_version) 4 | export(cpp_vendor) 5 | export(pkg_template) 6 | -------------------------------------------------------------------------------- /R/cpp11armadillo-package.R: -------------------------------------------------------------------------------- 1 | #' @keywords internal 2 | "_PACKAGE" 3 | 4 | #' Check that cpp11 can be used 5 | #' @keywords internal 6 | #' @return integer value 7 | check_cpp11 <- function() { 8 | cpp11::cpp_source( 9 | code = ' 10 | #include "cpp11/integers.hpp" 11 | 12 | [[cpp11::register]] int add_one() { 13 | int x = 0; 14 | x++; 15 | return x; 16 | } 17 | ' 18 | ) 19 | } 20 | -------------------------------------------------------------------------------- /R/version.R: -------------------------------------------------------------------------------- 1 | #' Get Armadillo version 2 | #' 3 | #' Provides the Armadillo C++ library version name and number included in the 4 | #' package. 5 | #' 6 | #' @export 7 | #' @return A string with the Armadillo version name and number 8 | #' @examples 9 | #' armadillo_version() 10 | armadillo_version <- function() { 11 | # finp <- system.file("include/armadillo/arma_version.hpp", package = "cpp11armadillo") 12 | # lines <- readLines(finp) 13 | 14 | # number <- c( 15 | # grep("ARMA_VERSION_MAJOR", lines, value = T)[[1]], 16 | # grep("ARMA_VERSION_MINOR", lines, value = T)[[1]], 17 | # grep("ARMA_VERSION_PATCH", lines, value = T)[[1]] 18 | # ) 19 | # number <- gsub("[^0-9]", "", number) 20 | 21 | # name <- grep("ARMA_VERSION_NAME", lines, value = T)[[1]] 22 | # name <- gsub(".*\"(.*)\".*", "\\1", name) 23 | 24 | # paste(name, paste(number, collapse = ".")) 25 | 26 | return("Stochastic Parrot 14.2.2") 27 | } 28 | -------------------------------------------------------------------------------- /_pkgdown.yml: -------------------------------------------------------------------------------- 1 | template: 2 | bootstrap: 5 3 | 4 | url: ../cpp11armadillo/ 5 | destination: docs 6 | -------------------------------------------------------------------------------- /configure: -------------------------------------------------------------------------------- 1 | # We make sure that the R and Armadillo bindings are compatible (i.e., messages) 2 | # this is why we add the R and cpp11 path 3 | CPP11_INCLUDE_PATH=`${R_HOME}/bin/Rscript -e "cat(system.file('include', package = 'cpp11'))"` 4 | INST_INCLUDE_PATH="./inst/include" 5 | 6 | # Check if CPP11_INCLUDE_PATH is empty 7 | if [ -z "$CPP11_INCLUDE_PATH" ]; then 8 | echo "Error: cpp11 include path is empty. Please ensure the cpp11 package is installed." 9 | exit 1 10 | fi 11 | 12 | PKG_CPPFLAGS="-I${INST_INCLUDE_PATH} -I${CPP11_INCLUDE_PATH}" 13 | 14 | # Debugging: Print the values of the variables 15 | echo "==================================" 16 | echo " Compiler Configuration Variables " 17 | echo " " 18 | echo "CPP11_INCLUDE_PATH: ${CPP11_INCLUDE_PATH}" 19 | echo "INST_INCLUDE_PATH: ${INST_INCLUDE_PATH}" 20 | echo "PKG_CPPFLAGS: ${PKG_CPPFLAGS}" 21 | 22 | # Create a temporary C++ file to test the compatibility with Armadillo 23 | cat < conftest.cpp 24 | #include 25 | using namespace arma; 26 | int main() { 27 | Mat A(2, 2, fill::ones); 28 | return 0; 29 | } 30 | EOF 31 | 32 | # Test Armadillo using R CMD SHLIB 33 | echo "===================================" 34 | echo " Testing minimal Armadillo example " 35 | echo " " 36 | if ! PKG_CPPFLAGS="${PKG_CPPFLAGS}" "${R_HOME}/bin/R" CMD SHLIB conftest.cpp 37 | then 38 | echo "Armadillo is not compatible with the C++ compiler used by R." 39 | rm -f conftest.cpp conftest.o conftest.so 40 | exit 1 41 | else 42 | echo "Armadillo is compatible with the C++ compiler used by R." 43 | rm -f conftest.cpp conftest.o conftest.so 44 | fi 45 | -------------------------------------------------------------------------------- /configure.win: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/configure.win -------------------------------------------------------------------------------- /cpp11armadillotest/.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^\.Renviron$ 4 | ^docs$ 5 | ^vignettes/images$ 6 | ^\.github$ 7 | ^\.vscode$ 8 | ^dev$ 9 | ^LICENSE\.md$ 10 | ^README$ 11 | ^README\.Rmd$ 12 | ^src/Makevars$ 13 | ^A\.bin$ 14 | ^A\.csv$ 15 | ^A\.txt$ 16 | ^F\.bin$ 17 | ^F\.ppm$ 18 | -------------------------------------------------------------------------------- /cpp11armadillotest/.gitignore: -------------------------------------------------------------------------------- 1 | inst/doc 2 | A.bin 3 | A.csv 4 | A.txt 5 | F.bin 6 | F.ppm 7 | -------------------------------------------------------------------------------- /cpp11armadillotest/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: cpp11armadillotest 2 | Type: Package 3 | Title: Testing cpp11armadillo 4 | Version: 0.1 5 | Authors@R: c( 6 | person( 7 | given = "Mauricio", 8 | family = "Vargas Sepulveda", 9 | role = c("aut", "cre"), 10 | email = "m.sepulveda@mail.utoronto.ca", 11 | comment = c(ORCID = "0000-0003-1017-7574")) 12 | ) 13 | Suggests: 14 | knitr, 15 | rmarkdown, 16 | testthat (>= 3.0.0) 17 | Depends: R(>= 3.5.0) 18 | Description: Testing cpp11armadillo. I run this within a tiny package to test 19 | the compiled code. 20 | License: Apache License (>= 2) 21 | BugReports: https://github.com/pachadotdev/cpp11armadillo/issues 22 | URL: https://github.com/pachadotdev/cpp11armadillo 23 | RoxygenNote: 7.3.2 24 | Encoding: UTF-8 25 | NeedsCompilation: yes 26 | VignetteBuilder: knitr 27 | LinkingTo: cpp11, cpp11armadillo 28 | Config/testthat/edition: 3 29 | LazyData: true 30 | Remotes: 31 | pachadotdev/cpp11armadillo 32 | -------------------------------------------------------------------------------- /cpp11armadillotest/NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | useDynLib(cpp11armadillotest, .registration = TRUE) 4 | -------------------------------------------------------------------------------- /cpp11armadillotest/R/cpp11armadillotest-package.R: -------------------------------------------------------------------------------- 1 | #' @useDynLib cpp11armadillotest, .registration = TRUE 2 | #' @keywords internal 3 | "_PACKAGE" 4 | 5 | #' Mtcars dataset in matrix form 6 | #' 7 | #' Reshaped dataframe to test Armadillo linear algebra functions with 8 | #' simple linear models of the form mpg_i = a + b cyl_i or 9 | #' mpg_i = b cyl_i + c_1 cyl4_i + c_2 cyl6_i + c_3 cyl8_i 10 | #' 11 | #' @format A list with two matrices: `y` and `x`, where `y` is the `mpg` 12 | #' variable and `x` is a matrix with the rest of the dataset. 13 | #' @source R's `mtcars` dataset. 14 | "mtcars_mat" 15 | -------------------------------------------------------------------------------- /cpp11armadillotest/cleanup: -------------------------------------------------------------------------------- 1 | rm -f src/Makevars configure.log 2 | -------------------------------------------------------------------------------- /cpp11armadillotest/configure: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Set the number of cores 4 | if [ -z "$PKG_NCORES" ]; then 5 | PKG_NCORES=$(getconf _NPROCESSORS_ONLN) 6 | if [ -z "$PKG_NCORES" ] || [ "$PKG_NCORES" -lt 1 ]; then 7 | PKG_NCORES=1 8 | elif [ "$PKG_NCORES" -gt 1 ]; then 9 | PKG_NCORES=$((PKG_NCORES / 2)) 10 | fi 11 | fi 12 | 13 | # Write Makevars 14 | sed -e "s|@ncores@|$PKG_NCORES|" \ 15 | src/Makevars.in > src/Makevars 16 | -------------------------------------------------------------------------------- /cpp11armadillotest/data/mtcars_mat.rda: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/cpp11armadillotest/data/mtcars_mat.rda -------------------------------------------------------------------------------- /cpp11armadillotest/dev/configure.ac: -------------------------------------------------------------------------------- 1 | AC_INIT([pkgname], [0.1]) 2 | AC_LANG(C++) 3 | AC_PROG_CXX 4 | AC_OPENMP 5 | AC_CHECK_LIB([lapack], [main]) 6 | AC_CHECK_LIB([blas], [main]) 7 | AC_CHECK_LIB([gfortran], [main]) 8 | AC_CONFIG_FILES([src/Makevars]) 9 | AC_OUTPUT 10 | -------------------------------------------------------------------------------- /cpp11armadillotest/dev/data.r: -------------------------------------------------------------------------------- 1 | x <- as.matrix(mtcars[, -1]) 2 | 3 | # cyl gear and carb are categorical variables 4 | str(mtcars) 5 | unique(mtcars$cyl) 6 | unique(mtcars$gear) 7 | unique(mtcars$carb) 8 | 9 | # add new column to x 10 | x <- cbind(x, cyl4 = as.numeric(mtcars$cyl == 4)) 11 | x <- cbind(x, cyl6 = as.numeric(mtcars$cyl == 6)) 12 | x <- cbind(x, cyl8 = as.numeric(mtcars$cyl == 8)) 13 | x <- x[, !(colnames(x) == "cyl")] 14 | 15 | x <- cbind(x, gear3 = as.numeric(mtcars$gear == 3)) 16 | x <- cbind(x, gear4 = as.numeric(mtcars$gear == 4)) 17 | x <- cbind(x, gear5 = as.numeric(mtcars$gear == 5)) 18 | x <- x[, !(colnames(x) == "gear")] 19 | 20 | x <- cbind(x, carb1 = as.numeric(mtcars$carb == 1)) 21 | x <- cbind(x, carb2 = as.numeric(mtcars$carb == 2)) 22 | x <- cbind(x, carb3 = as.numeric(mtcars$carb == 3)) 23 | x <- cbind(x, carb4 = as.numeric(mtcars$carb == 4)) 24 | x <- cbind(x, carb6 = as.numeric(mtcars$carb == 6)) 25 | x <- cbind(x, carb8 = as.numeric(mtcars$carb == 8)) 26 | x <- x[, !(colnames(x) == "carb")] 27 | 28 | y <- matrix(mtcars[, 1]) 29 | colnames(y) <- "mpg" 30 | rownames(y) <- rownames(mtcars) 31 | 32 | dim(x) 33 | dim(y) 34 | 35 | mtcars_mat <- list(x = x, y = y) 36 | 37 | use_data(mtcars_mat, overwrite = TRUE) 38 | -------------------------------------------------------------------------------- /cpp11armadillotest/man/cpp11armadillotest-package.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/cpp11armadillotest-package.R 3 | \docType{package} 4 | \name{cpp11armadillotest-package} 5 | \alias{cpp11armadillotest} 6 | \alias{cpp11armadillotest-package} 7 | \title{cpp11armadillotest: Testing cpp11armadillo} 8 | \description{ 9 | Testing cpp11armadillo. I run this within a tiny package to test the compiled code. 10 | } 11 | \seealso{ 12 | Useful links: 13 | \itemize{ 14 | \item \url{https://github.com/pachadotdev/cpp11armadillo} 15 | \item Report bugs at \url{https://github.com/pachadotdev/cpp11armadillo/issues} 16 | } 17 | 18 | } 19 | \author{ 20 | \strong{Maintainer}: Mauricio Vargas Sepulveda \email{m.sepulveda@mail.utoronto.ca} (\href{https://orcid.org/0000-0003-1017-7574}{ORCID}) 21 | 22 | } 23 | \keyword{internal} 24 | -------------------------------------------------------------------------------- /cpp11armadillotest/man/mtcars_mat.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/cpp11armadillotest-package.R 3 | \docType{data} 4 | \name{mtcars_mat} 5 | \alias{mtcars_mat} 6 | \title{Mtcars dataset in matrix form} 7 | \format{ 8 | A list with two matrices: `y` and `x`, where `y` is the `mpg` 9 | variable and `x` is a matrix with the rest of the dataset. 10 | } 11 | \source{ 12 | R's `mtcars` dataset. 13 | } 14 | \usage{ 15 | mtcars_mat 16 | } 17 | \description{ 18 | Reshaped dataframe to test Armadillo linear algebra functions with 19 | simple linear models of the form mpg_i = a + b cyl_i or 20 | mpg_i = b cyl_i + c_1 cyl4_i + c_2 cyl6_i + c_3 cyl8_i 21 | } 22 | \keyword{datasets} 23 | -------------------------------------------------------------------------------- /cpp11armadillotest/src/00_main.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace arma; 5 | using namespace cpp11; 6 | -------------------------------------------------------------------------------- /cpp11armadillotest/src/01_ols.cpp: -------------------------------------------------------------------------------- 1 | #include "00_main.h" 2 | 3 | Mat ols_(const doubles_matrix<>& y, const doubles_matrix<>& x) { 4 | Mat Y = as_Mat(y); // Col Y = as_Col(y); also works 5 | Mat X = as_Mat(x); 6 | 7 | Mat XtX = X.t() * X; // X'X 8 | Mat XtX_inv = inv(XtX); // (X'X)^(-1) 9 | Mat beta = XtX_inv * X.t() * Y; // (X'X)^(-1)(X'Y) 10 | 11 | return beta; 12 | } 13 | 14 | [[cpp11::register]] doubles_matrix<> ols_mat(const doubles_matrix<>& y, 15 | const doubles_matrix<>& x) { 16 | Mat beta = ols_(y, x); 17 | return as_doubles_matrix(beta); 18 | } 19 | 20 | [[cpp11::register]] doubles ols_dbl(const doubles_matrix<>& y, 21 | const doubles_matrix<>& x) { 22 | Mat beta = ols_(y, x); 23 | return as_doubles(beta); 24 | } 25 | -------------------------------------------------------------------------------- /cpp11armadillotest/src/03_chol.cpp: -------------------------------------------------------------------------------- 1 | #include "00_main.h" 2 | 3 | [[cpp11::register]] doubles_matrix<> chol_mat(const doubles_matrix<>& x, 4 | std::string type) { 5 | Mat X = as_Mat(x); 6 | 7 | Mat res; 8 | 9 | if (type == "upper") { 10 | res = chol(X); 11 | } else if (type == "lower") { 12 | res = chol(X, "lower"); 13 | } else { 14 | stop("Invalid type"); 15 | } 16 | 17 | return as_doubles_matrix(res); 18 | } 19 | -------------------------------------------------------------------------------- /cpp11armadillotest/src/04_qr.cpp: -------------------------------------------------------------------------------- 1 | #include "00_main.h" 2 | 3 | // The same example from the first script but using QR instead of directly 4 | // obtaining the inverse 5 | 6 | Mat ols_qr_(const doubles_matrix<>& y, const doubles_matrix<>& x, 7 | const bool econ) { 8 | Mat Y = as_Mat(y); // Col Y = as_Col(y); also works 9 | Mat X = as_Mat(x); 10 | 11 | // no need to define the dimensions of Q and R 12 | // qr() will automatically initialize them 13 | Mat Q; 14 | Mat R; 15 | 16 | bool computable; 17 | 18 | if (!econ) { 19 | computable = qr(Q, R, X); 20 | } else { 21 | computable = qr_econ(Q, R, X); 22 | } 23 | 24 | if (!computable) { 25 | stop("QR decomposition failed"); 26 | } else { 27 | return solve(R, Q.t() * Y); 28 | } 29 | } 30 | 31 | [[cpp11::register]] doubles_matrix<> ols_qr_mat(const doubles_matrix<>& y, 32 | const doubles_matrix<>& x, 33 | const bool econ) { 34 | Mat beta = ols_qr_(y, x, econ); 35 | return as_doubles_matrix(beta); 36 | } 37 | 38 | [[cpp11::register]] doubles ols_qr_dbl(const doubles_matrix<>& y, 39 | const doubles_matrix<>& x, const bool econ) { 40 | Mat beta = ols_qr_(y, x, econ); 41 | return as_doubles(beta); 42 | } 43 | -------------------------------------------------------------------------------- /cpp11armadillotest/src/05_capm.cpp: -------------------------------------------------------------------------------- 1 | #include "00_main.h" 2 | 3 | [[cpp11::register]] doubles_matrix<> capm(const doubles_matrix<>& r, 4 | const doubles_matrix<>& m, double f) { 5 | Mat R = as_Mat(r); 6 | Mat M = as_Mat(m); 7 | 8 | Mat F = ones>(R.n_cols, 1) * f; 9 | Mat M_avg = 10 | ones>(R.n_cols, 1) * as_scalar(mean(M, 0)); // Market average return 11 | 12 | Mat beta = cov(R, M) / as_scalar(var(M)); // CAPM betas 13 | 14 | Mat out = F + beta % (M_avg - F); // Expected returns 15 | 16 | return as_doubles_matrix(out); 17 | } 18 | -------------------------------------------------------------------------------- /cpp11armadillotest/src/07_reproducibility.cpp: -------------------------------------------------------------------------------- 1 | #include "00_main.h" 2 | 3 | [[cpp11::register]] integers_matrix<> random_matrix_nxn(const int& n) { 4 | GetRNGstate(); // Ensure R's RNG state is synchronized 5 | arma::Mat y(n, n); 6 | ::arma_rng::randi::fill(y.memptr(), y.n_elem, 0, 9); 7 | PutRNGstate(); // Ensure R's RNG state is synchronized 8 | return as_integers_matrix(y); 9 | } 10 | -------------------------------------------------------------------------------- /cpp11armadillotest/src/10_sparse_matrices.cpp: -------------------------------------------------------------------------------- 1 | #include "00_main.h" 2 | 3 | [[cpp11::register]] SEXP test_dgCMatrix_to_SpMat(SEXP x) { 4 | // Convert from dgCMatrix to SpMat 5 | SpMat A = as_SpMat(x); 6 | 7 | // Optional: perform some operation on A 8 | // For example, multiply each element by 2 9 | A *= 1.0; 10 | 11 | // Convert back to dgCMatrix and return 12 | return as_dgCMatrix(A); 13 | } 14 | 15 | // [[cpp11::register]] SEXP sum_matrices_(SEXP x) { 16 | // // Convert from dgCMatrix to SpMat 17 | // SpMat A = as_SpMat(x); 18 | 19 | // // Create a matrix B with a diagonal of random numbers 20 | // SpMat B(A.n_rows, A.n_cols); 21 | // for (uword i = 0; i < A.n_rows; ++i) { 22 | // B(i, i) = randu(); 23 | // } 24 | 25 | // A += B; // Add the two matrices 26 | 27 | // // Convert back to dgCMatrix and return 28 | // return as_dgCMatrix(A); 29 | // } 30 | -------------------------------------------------------------------------------- /cpp11armadillotest/src/Makevars: -------------------------------------------------------------------------------- 1 | # DARMA_OPENMP_THREADS is a natural number between 1 and the number of cores 2 | PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -DARMA_OPENMP_THREADS=4 3 | PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) 4 | 5 | # Debugging 6 | 7 | # uncomment one of the following lines to enable debugging 8 | # PKG_CPPFLAGS = -UDEBUG -g 9 | # PKG_CPPFLAGS = -UDEBUG -g -I vendor/ 10 | 11 | # uncomment to disable compiler optimizations 12 | # PKG_CXXFLAGS = -Wall -O0 -pedantic 13 | -------------------------------------------------------------------------------- /cpp11armadillotest/src/Makevars.in: -------------------------------------------------------------------------------- 1 | # DARMA_OPENMP_THREADS is a natural number between 1 and the number of cores 2 | PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -DARMA_OPENMP_THREADS=@ncores@ 3 | PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) 4 | 5 | # Debugging 6 | 7 | # uncomment one of the following lines to enable debugging 8 | # PKG_CPPFLAGS = -UDEBUG -g 9 | # PKG_CPPFLAGS = -UDEBUG -g -I vendor/ 10 | 11 | # uncomment to disable compiler optimizations 12 | # PKG_CXXFLAGS = -Wall -O0 -pedantic 13 | -------------------------------------------------------------------------------- /cpp11armadillotest/src/Makevars.win: -------------------------------------------------------------------------------- 1 | # DARMA_OPENMP_THREADS is a natural number between 1 and the number of cores 2 | PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -DARMA_OPENMP_THREADS=1 3 | PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) 4 | 5 | # Debugging 6 | 7 | # uncomment one of the following lines to enable debugging 8 | # PKG_CPPFLAGS = -UDEBUG -g 9 | # PKG_CPPFLAGS = -UDEBUG -g -I vendor/ 10 | 11 | # uncomment to disable compiler optimizations 12 | # PKG_CXXFLAGS = -Wall -O0 -pedantic 13 | -------------------------------------------------------------------------------- /cpp11armadillotest/tests/testthat.R: -------------------------------------------------------------------------------- 1 | # This file is part of the standard setup for testthat. 2 | # It is recommended that you do not modify it. 3 | # 4 | # Where should you do additional test configuration? 5 | # Learn more about the roles of various files in: 6 | # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview 7 | # * https://testthat.r-lib.org/articles/special-files.html 8 | 9 | library(testthat) 10 | library(cpp11armadillotest) 11 | 12 | test_check("cpp11armadillotest") 13 | -------------------------------------------------------------------------------- /cpp11armadillotest/tests/testthat/test-capm.R: -------------------------------------------------------------------------------- 1 | test_that("CAPM Model", { 2 | set.seed(200100) 3 | f <- 0.02 4 | m <- matrix(rnorm(3, 0, 0.1), nrow = 3, ncol = 1) 5 | r <- matrix(rnorm(6, 0, 0.1), nrow = 3, ncol = 2) 6 | 7 | beta <- cov(r, m) / as.double(var(m)) 8 | m_avg <- mean(m) 9 | 10 | capm_r <- f + beta * (m_avg - f) 11 | capm_cpp <- capm(r, m, f) 12 | 13 | expect_equal(capm_r, capm_cpp) 14 | }) 15 | -------------------------------------------------------------------------------- /cpp11armadillotest/tests/testthat/test-chol.R: -------------------------------------------------------------------------------- 1 | test_that("Cholesky decomposition 1", { 2 | set.seed(200100) 3 | x <- matrix(runif(25, 0, 1), nrow = 5, ncol = 5) 4 | x <- t(x) %*% x 5 | y <- chol_mat(x, type = "upper") 6 | z <- chol_mat(x, type = "lower") 7 | 8 | expect_true(all(y[lower.tri(y)] == 0)) 9 | expect_true(all(z[upper.tri(z)] == 0)) 10 | 11 | expect_true(all.equal(x, t(y) %*% y)) 12 | expect_true(all.equal(x, z %*% t(z))) 13 | }) 14 | -------------------------------------------------------------------------------- /cpp11armadillotest/tests/testthat/test-eigenvalues.R: -------------------------------------------------------------------------------- 1 | test_that("cpp11armadillo vs base R (sorted)", { 2 | x <- mtcars_mat$x 3 | y <- mtcars_mat$y 4 | 5 | x <- x[, c("wt", "cyl4", "cyl6", "cyl8")] 6 | 7 | x <- cor(x) 8 | 9 | # Armadillo computation 10 | a <- sort(eigen_sym_mat(x)) 11 | 12 | # Base R computation 13 | b <- sort(eigen(x)$values) 14 | 15 | expect_equal(a, b) 16 | }) 17 | 18 | test_that("eigen_gen wrapper works as expected", { 19 | x <- mtcars_mat$x 20 | y <- mtcars_mat$y 21 | 22 | x <- x[, c("wt", "cyl4", "cyl6", "cyl8")] 23 | 24 | x <- cor(x) 25 | 26 | expect_equal(eigen_gen_mat(x), eigen_gen_mat_complex_wrapper(x)) 27 | 28 | expect_equal(eigen_gen_mat_complex_wrapper(x), eigen_gen_no_wrapper(x)) 29 | 30 | # case where the imaginary part is not zero 31 | 32 | x <- matrix(c(4 / 5, 3 / 5, 1, -3 / 5, 4 / 5, 2, 0, 0, 2), 3, 3) 33 | 34 | a <- eigen_gen_mat_complex_wrapper(x) 35 | 36 | b <- c() 37 | for (i in 1:3) { 38 | b[i] <- complex(real = a$real[i], imaginary = a$imag[i]) 39 | } 40 | b <- sort(b) 41 | 42 | c <- sort(eigen(x)$values) 43 | 44 | expect_equal(b, c) 45 | }) 46 | -------------------------------------------------------------------------------- /cpp11armadillotest/tests/testthat/test-ols.R: -------------------------------------------------------------------------------- 1 | test_that("Ordinary Least Squares Matrix (i.e., transposition and inverses)", { 2 | x <- mtcars_mat$x 3 | y <- mtcars_mat$y 4 | 5 | x <- x[, c("wt", "cyl4", "cyl6", "cyl8")] 6 | 7 | # Armadillo computation 8 | a <- ols_mat(y, x) 9 | b <- matrix(ols_dbl(y, x), ncol = 1) 10 | 11 | # Base R computation 12 | c <- matrix(solve(t(x) %*% x) %*% t(x) %*% y, ncol = 1) 13 | 14 | expect_equal(a, c) 15 | expect_equal(b, c) 16 | }) 17 | -------------------------------------------------------------------------------- /cpp11armadillotest/tests/testthat/test-qr.R: -------------------------------------------------------------------------------- 1 | test_that("Ordinary Least Squares Matrix via QR", { 2 | x <- mtcars_mat$x 3 | y <- mtcars_mat$y 4 | 5 | x <- x[, c("wt", "cyl4", "cyl6", "cyl8")] 6 | 7 | # Armadillo computation 8 | a <- ols_qr_mat(y, x, econ = TRUE) 9 | b <- matrix(ols_qr_dbl(y, x, econ = TRUE), ncol = 1) 10 | c <- ols_qr_mat(y, x, econ = FALSE) 11 | d <- matrix(ols_qr_dbl(y, x, econ = FALSE), ncol = 1) 12 | 13 | # Base R computation 14 | e <- matrix(solve(t(x) %*% x) %*% t(x) %*% y, ncol = 1) 15 | 16 | expect_equal(a, e) 17 | expect_equal(b, e) 18 | expect_equal(c, e) 19 | expect_equal(d, e) 20 | }) 21 | -------------------------------------------------------------------------------- /cpp11armadillotest/tests/testthat/test-regression.R: -------------------------------------------------------------------------------- 1 | test_that("examples derived from official documentation", { 2 | x <- model.matrix(mpg ~ wt, data = mtcars) 3 | y <- model.response(model.frame(mpg ~ wt, data = mtcars)) 4 | betas <- ols_(x, y) 5 | expect_equal(betas, unname(coef(lm(mpg ~ wt, data = mtcars)))) 6 | 7 | betas2 <- poisson_(x, y) 8 | 9 | betas3 <- suppressWarnings( 10 | glm(mpg ~ wt, data = mtcars, family = poisson)$coefficients 11 | ) 12 | 13 | expect_equal(betas2, unname(betas3)) 14 | }) 15 | -------------------------------------------------------------------------------- /cpp11armadillotest/tests/testthat/test-reproducibility.R: -------------------------------------------------------------------------------- 1 | test_that("elemental tests for quasi-random values", { 2 | set.seed(1234) 3 | m1 <- random_matrix_nxn(5) 4 | set.seed(1234) 5 | m2 <- random_matrix_nxn(5) 6 | set.seed(4321) 7 | m3 <- random_matrix_nxn(5) 8 | set.seed(4321) 9 | m4 <- random_matrix_nxn(5) 10 | 11 | expect_equal(m1, m2) 12 | expect_equal(m3, m4) 13 | }) 14 | -------------------------------------------------------------------------------- /cpp11armadillotest/tests/testthat/test-sparse-matrices.R: -------------------------------------------------------------------------------- 1 | test_that("sparse matrices copy works", { 2 | M <- Matrix::Matrix(c(0, 0, 0, 2, 6, 0, -1, 5, 0, 4, 3, 0, 0, 0, 5, 0), 3 | nrow = 4, ncol = 4, sparse = TRUE 4 | ) 5 | 6 | N <- test_dgCMatrix_to_SpMat(M) 7 | 8 | expect_equal(N, M) 9 | }) 10 | -------------------------------------------------------------------------------- /cpp11armadillotest/vignettes/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.R 3 | -------------------------------------------------------------------------------- /cpp11armadillotest/vignettes/intro.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Add Title" 3 | output: rmarkdown::html_vignette 4 | vignette: > 5 | %\VignetteIndexEntry{intro} 6 | %\VignetteEngine{knitr::rmarkdown} 7 | %\VignetteEncoding{UTF-8} 8 | --- 9 | 10 | ```{r, include = FALSE} 11 | knitr::opts_chunk$set( 12 | collapse = TRUE, 13 | comment = "#>" 14 | ) 15 | ``` 16 | 17 | Write extended documentation for your package. 18 | 19 | ```{r setup} 20 | library(cpp11armadillotest) 21 | ``` 22 | -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | ## R CMD check results 2 | 3 | 0 errors | 0 warnings | 0 note 4 | 5 | * This update enforces zero-copy semantics for the different functions, 6 | improving performance and memory usage. 7 | -------------------------------------------------------------------------------- /docs/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/apple-touch-icon.png -------------------------------------------------------------------------------- /docs/articles/basic-usage_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/configuration_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/decompositions-factorisations-inverses-and-equation-solvers-dense_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/decompositions-factorisations-inverses-and-equation-solvers-sparse_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/functions-of-vector-matrices-cubes_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/generated-vectors-matrices-cubes_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/linear-model_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/matrix-vector-cube-and-field-classes_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/member-functions-and-variables_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/miscellaneous_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/save-load_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/signal-and-image-processing_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/sparse-matrices_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/statistics-and-clustering_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/syntax-comparison-for-matlab-users_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVs9pbCIPrc.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVs9pbCIPrc.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCIPrc.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/1Ptxg8zYS_SKggPN4iEgvnHyvveLxVvaorCIPrc.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/1adeadb2fe618c5ed46221f15e12b9c8.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/1adeadb2fe618c5ed46221f15e12b9c8.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/4iCs6KVjbNBYlgo6ew.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/4iCs6KVjbNBYlgo6ew.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/4iCs6KVjbNBYlgoKfw7w.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/4iCs6KVjbNBYlgoKfw7w.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/4iCv6KVjbNBYlgoCxCvTtA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/4iCv6KVjbNBYlgoCxCvTtA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/4iCv6KVjbNBYlgoCxCvjsGyL.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/4iCv6KVjbNBYlgoCxCvjsGyL.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7nsDQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPZ7nsDQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPa7j.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/6xK1dSBYKcSV-LCoeQqfX1RYOo3qPa7j.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3aPA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3aPA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7j.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/6xK3dSBYKcSV-LCoeQqfX1RYOo3qOK7j.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rAkw.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3i54rAkw.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vAkw.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vAkw.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdo.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ig4vwlxdo.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zAkw.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zAkw.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdo.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/6xKydSBYKcSV-LCoeQqfX1RYOo3ik4zwlxdo.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/CSR54z1Qlv-GDxkbKVQ_dFsvWNRevw.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/CSR54z1Qlv-GDxkbKVQ_dFsvWNRevw.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/CSR54z1Qlv-GDxkbKVQ_dFsvaNA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/CSR54z1Qlv-GDxkbKVQ_dFsvaNA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/CSR64z1Qlv-GDxkbKVQ_TOQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/CSR64z1Qlv-GDxkbKVQ_TOQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/CSR64z1Qlv-GDxkbKVQ_fOAKSw.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/CSR64z1Qlv-GDxkbKVQ_fOAKSw.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/HI_diYsKILxRpg3hIP6sJ7fM7PqPMcMnZFqUwX28DBKXhM0.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/HI_diYsKILxRpg3hIP6sJ7fM7PqPMcMnZFqUwX28DBKXhM0.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/HI_diYsKILxRpg3hIP6sJ7fM7PqPMcMnZFqUwX28DMyQhM0.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/HI_diYsKILxRpg3hIP6sJ7fM7PqPMcMnZFqUwX28DMyQhM0.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/HI_jiYsKILxRpg3hIP6sJ7fM7PqlOPHYvDP_W9O7GQTTbI1rSg.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/HI_jiYsKILxRpg3hIP6sJ7fM7PqlOPHYvDP_W9O7GQTTbI1rSg.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/HI_jiYsKILxRpg3hIP6sJ7fM7PqlOPHYvDP_W9O7GQTTsoprSg.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/HI_jiYsKILxRpg3hIP6sJ7fM7PqlOPHYvDP_W9O7GQTTsoprSg.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCtZ6Ew9.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCtZ6Ew9.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCtr6Ew9.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCtr6Ew9.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCuM70w9.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/JTUHjIg1_i6t8kCHKm4532VJOt5-QNFgpCuM70w9.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmEU9fBBc-.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmEU9fBBc-.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmEU9vAA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmEU9vAA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmSU5fBBc-.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmSU5fBBc-.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmSU5vAA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmSU5vAA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmWUlfBBc-.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmWUlfBBc-.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmWUlvAA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/KFOlCnqEu92Fr1MmWUlvAA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/KFOmCnqEu92Fr1Me5g.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/KFOmCnqEu92Fr1Me5g.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/KFOmCnqEu92Fr1Mu4mxM.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/KFOmCnqEu92Fr1Mu4mxM.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/QGYpz_kZZAGCONcK2A4bGOj8mNhL.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/QGYpz_kZZAGCONcK2A4bGOj8mNhL.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/S6u8w4BMUTPHjxsAXC-s.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/S6u8w4BMUTPHjxsAXC-s.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/S6u8w4BMUTPHjxswWA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/S6u8w4BMUTPHjxswWA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/S6u9w4BMUTPHh6UVSwiPHw.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/S6u9w4BMUTPHh6UVSwiPHw.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/S6u9w4BMUTPHh6UVeww.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/S6u9w4BMUTPHh6UVeww.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/S6u9w4BMUTPHh7USSwiPHw.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/S6u9w4BMUTPHh7USSwiPHw.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/S6u9w4BMUTPHh7USeww.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/S6u9w4BMUTPHh7USeww.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/S6uyw4BMUTPHjx4wWA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/S6uyw4BMUTPHjx4wWA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/S6uyw4BMUTPHvxo.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/S6uyw4BMUTPHvxo.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuFuYMZs.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuFuYMZs.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuI6fMZs.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuI6fMZs.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfMZs.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfMZs.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/XRXI3I6Li01BKofiOc5wtlZ2di8HDFwmRTA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/XRXI3I6Li01BKofiOc5wtlZ2di8HDFwmRTA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/XRXI3I6Li01BKofiOc5wtlZ2di8HDGUmRTA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/XRXI3I6Li01BKofiOc5wtlZ2di8HDGUmRTA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/XRXI3I6Li01BKofiOc5wtlZ2di8HDLshRTA.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/XRXI3I6Li01BKofiOc5wtlZ2di8HDLshRTA.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/a98f7a7574819ba83bec6279a2cecd95.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/a98f7a7574819ba83bec6279a2cecd95.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk0ZjaVQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk0ZjaVQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWVAexg.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkWVAexg.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkaVQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk5hkaVQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWVAexg.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkWVAexg.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkaVQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk8ZkaVQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk_RkaVQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0Rk_RkaVQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkxhjaVQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkxhjaVQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjWVAexg.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjWVAexg.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjaVQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memQYaGs126MiZpBA-UFUIcVXSCEkx2cmqvXlWq8tWZ0Pw86hd0RkyFjaVQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1x4gaVQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1x4gaVQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1y4k.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsg-1y4k.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsgH1y4k.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsgH1y4k.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgshZ1y4k.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgshZ1y4k.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4gaVQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0B4gaVQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0C4k.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsiH0C4k.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4gaVQ.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0B4gaVQ.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0C4k.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjZ0C4k.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjr0C4k.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/memSYaGs126MiZpBA-UvWbX2vVnXBbObj2OVZyOOSr4dVJWUgsjr0C4k.woff -------------------------------------------------------------------------------- /docs/deps/bootstrap-5.3.1/fonts/q5uGsou0JOdh94bfvQlr.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/bootstrap-5.3.1/fonts/q5uGsou0JOdh94bfvQlr.woff -------------------------------------------------------------------------------- /docs/deps/data-deps.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-brands-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/font-awesome-6.4.2/webfonts/fa-brands-400.ttf -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-brands-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/font-awesome-6.4.2/webfonts/fa-brands-400.woff2 -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-regular-400.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/font-awesome-6.4.2/webfonts/fa-regular-400.ttf -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-regular-400.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/font-awesome-6.4.2/webfonts/fa-regular-400.woff2 -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-solid-900.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/font-awesome-6.4.2/webfonts/fa-solid-900.ttf -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-solid-900.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/font-awesome-6.4.2/webfonts/fa-solid-900.woff2 -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-v4compatibility.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/font-awesome-6.4.2/webfonts/fa-v4compatibility.ttf -------------------------------------------------------------------------------- /docs/deps/font-awesome-6.4.2/webfonts/fa-v4compatibility.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/deps/font-awesome-6.4.2/webfonts/fa-v4compatibility.woff2 -------------------------------------------------------------------------------- /docs/deps/headroom-0.11.0/jQuery.headroom.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * headroom.js v0.9.4 - Give your page some headroom. Hide your header until you need it 3 | * Copyright (c) 2017 Nick Williams - http://wicky.nillia.ms/headroom.js 4 | * License: MIT 5 | */ 6 | 7 | !function(a){a&&(a.fn.headroom=function(b){return this.each(function(){var c=a(this),d=c.data("headroom"),e="object"==typeof b&&b;e=a.extend(!0,{},Headroom.options,e),d||(d=new Headroom(this,e),d.init(),c.data("headroom",d)),"string"==typeof b&&(d[b](),"destroy"===b&&c.removeData("headroom"))})},a("[data-headroom]").each(function(){var b=a(this);b.headroom(b.data())}))}(window.Zepto||window.jQuery); -------------------------------------------------------------------------------- /docs/favicon-96x96.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/favicon-96x96.png -------------------------------------------------------------------------------- /docs/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/favicon.ico -------------------------------------------------------------------------------- /docs/katex-auto.js: -------------------------------------------------------------------------------- 1 | // https://github.com/jgm/pandoc/blob/29fa97ab96b8e2d62d48326e1b949a71dc41f47a/src/Text/Pandoc/Writers/HTML.hs#L332-L345 2 | document.addEventListener("DOMContentLoaded", function () { 3 | var mathElements = document.getElementsByClassName("math"); 4 | var macros = []; 5 | for (var i = 0; i < mathElements.length; i++) { 6 | var texText = mathElements[i].firstChild; 7 | if (mathElements[i].tagName == "SPAN") { 8 | katex.render(texText.data, mathElements[i], { 9 | displayMode: mathElements[i].classList.contains("display"), 10 | throwOnError: false, 11 | macros: macros, 12 | fleqn: false 13 | }); 14 | }}}); 15 | -------------------------------------------------------------------------------- /docs/link.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /docs/pkgdown.yml: -------------------------------------------------------------------------------- 1 | pandoc: 2.9.2.1 2 | pkgdown: 2.0.7 3 | pkgdown_sha: ~ 4 | articles: 5 | basic-usage: basic-usage.html 6 | configuration: configuration.html 7 | decompositions-factorisations-inverses-and-equation-solvers-dense: decompositions-factorisations-inverses-and-equation-solvers-dense.html 8 | decompositions-factorisations-inverses-and-equation-solvers-sparse: decompositions-factorisations-inverses-and-equation-solvers-sparse.html 9 | functions-of-vector-matrices-cubes: functions-of-vector-matrices-cubes.html 10 | generated-vectors-matrices-cubes: generated-vectors-matrices-cubes.html 11 | linear-model: linear-model.html 12 | matrix-vector-cube-and-field-classes: matrix-vector-cube-and-field-classes.html 13 | member-functions-and-variables: member-functions-and-variables.html 14 | miscellaneous: miscellaneous.html 15 | save-load: save-load.html 16 | signal-and-image-processing: signal-and-image-processing.html 17 | sparse-matrices: sparse-matrices.html 18 | statistics-and-clustering: statistics-and-clustering.html 19 | syntax-comparison-for-matlab-users: syntax-comparison-for-matlab-users.html 20 | last_built: 2025-06-06T19:21Z 21 | urls: 22 | reference: ../cpp11armadillo/reference 23 | article: ../cpp11armadillo/articles 24 | 25 | -------------------------------------------------------------------------------- /docs/reference/cpp11armadillo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /docs/site.webmanifest: -------------------------------------------------------------------------------- 1 | { 2 | "name": "", 3 | "short_name": "", 4 | "icons": [ 5 | { 6 | "src": "/web-app-manifest-192x192.png", 7 | "sizes": "192x192", 8 | "type": "image/png", 9 | "purpose": "maskable" 10 | }, 11 | { 12 | "src": "/web-app-manifest-512x512.png", 13 | "sizes": "512x512", 14 | "type": "image/png", 15 | "purpose": "maskable" 16 | } 17 | ], 18 | "theme_color": "#ffffff", 19 | "background_color": "#ffffff", 20 | "display": "standalone" 21 | } -------------------------------------------------------------------------------- /docs/web-app-manifest-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/web-app-manifest-192x192.png -------------------------------------------------------------------------------- /docs/web-app-manifest-512x512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/docs/web-app-manifest-512x512.png -------------------------------------------------------------------------------- /inst/CITATION: -------------------------------------------------------------------------------- 1 | bibentry( 2 | "Article", 3 | title = "{cpp11armadillo}: An {R} package to use the Armadillo {C++} library", 4 | author = "Mauricio Vargas Sepulveda, Jonathan Schneider Malamud", 5 | month = "May", 6 | year = 2025, 7 | journal = "{SoftwareX}", 8 | volume = 30, 9 | pages = 102087, 10 | doi = "10.1016/j.softx.2025.102087" 11 | ) 12 | -------------------------------------------------------------------------------- /inst/WORDLIST: -------------------------------------------------------------------------------- 1 | cpp 2 | -------------------------------------------------------------------------------- /inst/arxiv_preprint/.gitignore: -------------------------------------------------------------------------------- 1 | /.quarto/ 2 | -------------------------------------------------------------------------------- /inst/arxiv_preprint/move_pdf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cp "$1" "/home/pacha/github/cpp11armadillo/inst/arxiv_preprint/paper.pdf" 3 | -------------------------------------------------------------------------------- /inst/extdata/NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | -------------------------------------------------------------------------------- /inst/extdata/cleanup: -------------------------------------------------------------------------------- 1 | rm -f src/Makevars configure.log 2 | -------------------------------------------------------------------------------- /inst/extdata/configure: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # Set the number of cores 4 | if [ -z "$PKG_NCORES" ]; then 5 | PKG_NCORES=$(getconf _NPROCESSORS_ONLN) 6 | if [ -z "$PKG_NCORES" ] || [ "$PKG_NCORES" -lt 1 ]; then 7 | PKG_NCORES=1 8 | elif [ "$PKG_NCORES" -gt 1 ]; then 9 | PKG_NCORES=$((PKG_NCORES / 2)) 10 | fi 11 | fi 12 | 13 | # Write Makevars 14 | sed -e "s|@ncores@|$PKG_NCORES|" \ 15 | src/Makevars.in > src/Makevars 16 | -------------------------------------------------------------------------------- /inst/extdata/dev/01_load_or_install.R: -------------------------------------------------------------------------------- 1 | # run this line if you want to replace all the files provided by the template 2 | # cpp11armadillo::pkg_template() 3 | 4 | if (!requireNamespace("devtools", quietly = TRUE)) { 5 | install.packages("devtools") 6 | } 7 | 8 | development <- TRUE 9 | 10 | devtools::clean_dll() 11 | cpp11::cpp_register() 12 | devtools::document() 13 | 14 | if (isTRUE(development)) { 15 | devtools::load_all() 16 | } else { 17 | devtools::install() 18 | } 19 | -------------------------------------------------------------------------------- /inst/extdata/dev/02_test.R: -------------------------------------------------------------------------------- 1 | # Estimate the model y ~ constant + x 2 | # with y and x gaussian random variables 3 | 4 | set.seed(123) 5 | y <- matrix(rnorm(100), ncol = 1, nrow = 100) 6 | x <- matrix(1, ncol = 1, nrow = 100) 7 | x <- cbind(x, rnorm(100, 0, 1)) 8 | 9 | # Armadillo computation 10 | ols_mat(y, x) 11 | ols_dbl(y, x) 12 | 13 | # Base R computation 14 | solve(t(x) %*% x) %*% t(x) %*% y 15 | lm(y ~ x + 0) 16 | 17 | # Test your own functions now 18 | -------------------------------------------------------------------------------- /inst/extdata/dev/03_readme_and_license.R: -------------------------------------------------------------------------------- 1 | # Readme 2 | 3 | usethis::use_readme_rmd() 4 | 5 | # License 6 | 7 | usethis::use_apache_license() 8 | # usethis::use_mit_license() 9 | # usethis::use_gpl3_license() 10 | # usethis::use_cc0_license() 11 | # usethis::use_ccby_license() 12 | -------------------------------------------------------------------------------- /inst/extdata/dev/data.r: -------------------------------------------------------------------------------- 1 | x <- as.matrix(mtcars[, -1]) 2 | 3 | # cyl gear and carb are categorical variables 4 | str(mtcars) 5 | unique(mtcars$cyl) 6 | unique(mtcars$gear) 7 | unique(mtcars$carb) 8 | 9 | # add new column to x 10 | x <- cbind(x, cyl4 = as.numeric(mtcars$cyl == 4)) 11 | x <- cbind(x, cyl6 = as.numeric(mtcars$cyl == 6)) 12 | x <- cbind(x, cyl8 = as.numeric(mtcars$cyl == 8)) 13 | x <- x[, !(colnames(x) == "cyl")] 14 | 15 | x <- cbind(x, gear3 = as.numeric(mtcars$gear == 3)) 16 | x <- cbind(x, gear4 = as.numeric(mtcars$gear == 4)) 17 | x <- cbind(x, gear5 = as.numeric(mtcars$gear == 5)) 18 | x <- x[, !(colnames(x) == "gear")] 19 | 20 | x <- cbind(x, carb1 = as.numeric(mtcars$carb == 1)) 21 | x <- cbind(x, carb2 = as.numeric(mtcars$carb == 2)) 22 | x <- cbind(x, carb3 = as.numeric(mtcars$carb == 3)) 23 | x <- cbind(x, carb4 = as.numeric(mtcars$carb == 4)) 24 | x <- cbind(x, carb6 = as.numeric(mtcars$carb == 6)) 25 | x <- cbind(x, carb8 = as.numeric(mtcars$carb == 8)) 26 | x <- x[, !(colnames(x) == "carb")] 27 | 28 | y <- matrix(mtcars[, 1]) 29 | colnames(y) <- "mpg" 30 | rownames(y) <- rownames(mtcars) 31 | 32 | dim(x) 33 | dim(y) 34 | 35 | mtcars_mat <- list(x = x, y = y) 36 | 37 | use_data(mtcars_mat, overwrite = TRUE) 38 | -------------------------------------------------------------------------------- /inst/extdata/src/00_main.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace arma; 5 | using namespace cpp11; 6 | -------------------------------------------------------------------------------- /inst/extdata/src/01_ols.cpp: -------------------------------------------------------------------------------- 1 | #include "00_main.h" 2 | 3 | Mat ols_(const doubles_matrix<>& y, const doubles_matrix<>& x) { 4 | Mat Y = as_Mat(y); // Col Y = as_Col(y); also works 5 | Mat X = as_Mat(x); 6 | 7 | Mat XtX = X.t() * X; // X'X 8 | Mat XtX_inv = inv(XtX); // (X'X)^(-1) 9 | Mat beta = XtX_inv * X.t() * Y; // (X'X)^(-1)(X'Y) 10 | 11 | return beta; 12 | } 13 | 14 | [[cpp11::register]] doubles_matrix<> ols_mat(const doubles_matrix<>& y, 15 | const doubles_matrix<>& x) { 16 | Mat beta = ols_(y, x); 17 | return as_doubles_matrix(beta); 18 | } 19 | 20 | [[cpp11::register]] doubles ols_dbl(const doubles_matrix<>& y, 21 | const doubles_matrix<>& x) { 22 | Mat beta = ols_(y, x); 23 | return as_doubles(beta); 24 | } 25 | -------------------------------------------------------------------------------- /inst/extdata/src/02_your_functions.cpp: -------------------------------------------------------------------------------- 1 | #include "00_main.h" 2 | 3 | // Add more functions here 4 | -------------------------------------------------------------------------------- /inst/extdata/src/Makevars.in: -------------------------------------------------------------------------------- 1 | # DARMA_OPENMP_THREADS is a natural number between 1 and the number of cores 2 | PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -DARMA_OPENMP_THREADS=@ncores@ 3 | PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) 4 | 5 | # Debugging 6 | 7 | # uncomment one of the following lines to enable debugging 8 | # PKG_CPPFLAGS = -UDEBUG -g 9 | # PKG_CPPFLAGS = -UDEBUG -g -I vendor/ 10 | 11 | # uncomment to disable compiler optimizations 12 | # PKG_CXXFLAGS = -Wall -O0 -pedantic 13 | -------------------------------------------------------------------------------- /inst/extdata/src/Makevars.win: -------------------------------------------------------------------------------- 1 | # DARMA_OPENMP_THREADS is a natural number between 1 and the number of cores 2 | PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -DARMA_OPENMP_THREADS=1 3 | PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) 4 | 5 | # Debugging 6 | 7 | # uncomment one of the following lines to enable debugging 8 | # PKG_CPPFLAGS = -UDEBUG -g 9 | # PKG_CPPFLAGS = -UDEBUG -g -I vendor/ 10 | 11 | # uncomment to disable compiler optimizations 12 | # PKG_CXXFLAGS = -Wall -O0 -pedantic 13 | -------------------------------------------------------------------------------- /inst/include/armadillo/CubeToMatOp_meat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup CubeToMatOp 19 | //! @{ 20 | 21 | template 22 | inline CubeToMatOp::CubeToMatOp(const T1& in_m) : m(in_m) { 23 | arma_debug_sigprint(); 24 | } 25 | 26 | template 27 | inline CubeToMatOp::CubeToMatOp(const T1& in_m, const uword in_aux_uword) 28 | : m(in_m), aux_uword(in_aux_uword) { 29 | arma_debug_sigprint(); 30 | } 31 | 32 | template 33 | inline CubeToMatOp::~CubeToMatOp() { 34 | arma_debug_sigprint(); 35 | } 36 | 37 | //! @} 38 | -------------------------------------------------------------------------------- /inst/include/armadillo/GlueCube_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup GlueCube 19 | //! @{ 20 | 21 | //! analog of the Glue class, intended for Cube objects 22 | template 23 | class GlueCube : public BaseCube > { 24 | public: 25 | typedef typename T1::elem_type elem_type; 26 | typedef typename get_pod_type::result pod_type; 27 | 28 | inline GlueCube(const BaseCube& in_A, 29 | const BaseCube& in_B); 30 | inline ~GlueCube(); 31 | 32 | const T1& A; //!< first operand; must be derived from BaseCube 33 | const T2& B; //!< second operand; must be derived from BaseCube 34 | }; 35 | 36 | //! @} 37 | -------------------------------------------------------------------------------- /inst/include/armadillo/GlueCube_meat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup GlueCube 19 | //! @{ 20 | 21 | template 22 | inline GlueCube::GlueCube( 23 | const BaseCube& in_A, 24 | const BaseCube& in_B) 25 | : A(in_A.get_ref()), B(in_B.get_ref()) { 26 | arma_debug_sigprint(); 27 | } 28 | 29 | template 30 | inline GlueCube::~GlueCube() { 31 | arma_debug_sigprint(); 32 | } 33 | 34 | //! @} 35 | -------------------------------------------------------------------------------- /inst/include/armadillo/SpToDGlue_meat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup SpToDGlue 19 | //! @{ 20 | 21 | template 22 | inline SpToDGlue::SpToDGlue(const T1& in_A, const T2& in_B) 23 | : A(in_A), B(in_B) { 24 | arma_debug_sigprint(); 25 | } 26 | 27 | template 28 | inline SpToDGlue::~SpToDGlue() { 29 | arma_debug_sigprint(); 30 | } 31 | 32 | //! @} 33 | -------------------------------------------------------------------------------- /inst/include/armadillo/arma_static_check.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup arma_static_check 19 | //! @{ 20 | 21 | #undef arma_static_check 22 | #define arma_static_check(condition, message) static_assert(!(condition), message) 23 | 24 | #undef arma_type_check 25 | #define arma_type_check(condition) \ 26 | static_assert(!(condition), "error: type mismatch or unsupported type") 27 | 28 | //! @} 29 | -------------------------------------------------------------------------------- /inst/include/armadillo/compiler_setup_post.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | #if defined(_MSC_VER) 19 | 20 | #pragma warning(pop) 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /inst/include/armadillo/cond_rel_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup cond_rel 19 | //! @{ 20 | 21 | // 22 | // for preventing pedantic compiler warnings 23 | 24 | template 25 | class cond_rel { 26 | public: 27 | template 28 | arma_inline static bool lt(const eT A, const eT B); 29 | template 30 | arma_inline static bool gt(const eT A, const eT B); 31 | 32 | template 33 | arma_inline static bool leq(const eT A, const eT B); 34 | template 35 | arma_inline static bool geq(const eT A, const eT B); 36 | 37 | template 38 | arma_inline static eT make_neg(const eT val); 39 | }; 40 | 41 | //! @} 42 | -------------------------------------------------------------------------------- /inst/include/armadillo/fn_cross.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup fn_cross 19 | //! @{ 20 | 21 | //! cross product (only valid for 3 dimensional vectors) 22 | template 23 | arma_warn_unused inline typename enable_if2< 24 | is_arma_type::value && is_arma_type::value && 25 | is_same_type::value, 26 | const Glue >::result 27 | cross(const T1& X, const T2& Y) { 28 | arma_debug_sigprint(); 29 | 30 | return Glue(X, Y); 31 | } 32 | 33 | //! @} 34 | -------------------------------------------------------------------------------- /inst/include/armadillo/fn_kmeans.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup fn_kmeans 19 | //! @{ 20 | 21 | template 22 | inline typename enable_if2::value, bool>::result kmeans( 23 | Mat& means, const Base& data, 24 | const uword k, const gmm_seed_mode& seed_mode, const uword n_iter, 25 | const bool print_mode) { 26 | arma_debug_sigprint(); 27 | 28 | typedef typename T1::elem_type eT; 29 | 30 | gmm_priv::gmm_diag model; 31 | 32 | const bool status = 33 | model.kmeans_wrapper(means, data.get_ref(), k, seed_mode, n_iter, print_mode); 34 | 35 | if (status) { 36 | means = model.means; 37 | } else { 38 | means.soft_reset(); 39 | } 40 | 41 | return status; 42 | } 43 | 44 | //! @} 45 | -------------------------------------------------------------------------------- /inst/include/armadillo/fn_nonzeros.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup fn_nonzeros 19 | //! @{ 20 | 21 | template 22 | arma_warn_unused inline const Op nonzeros( 23 | const Base& X) { 24 | arma_debug_sigprint(); 25 | 26 | return Op(X.get_ref()); 27 | } 28 | 29 | template 30 | arma_warn_unused inline const SpToDOp nonzeros( 31 | const SpBase& X) { 32 | arma_debug_sigprint(); 33 | 34 | return SpToDOp(X.get_ref()); 35 | } 36 | 37 | //! @} 38 | -------------------------------------------------------------------------------- /inst/include/armadillo/fn_polyval.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup fn_polyval 19 | //! @{ 20 | 21 | template 22 | arma_warn_unused inline typename enable_if2< 23 | (is_supported_blas_type::value && is_arma_type::value && 24 | is_same_type::value), 25 | const Glue >::result 26 | polyval(const Base& P, const T2& X) { 27 | arma_debug_sigprint(); 28 | 29 | return Glue(P.get_ref(), X); 30 | } 31 | 32 | //! @} 33 | -------------------------------------------------------------------------------- /inst/include/armadillo/fn_repelem.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup fn_repelem 19 | //! @{ 20 | 21 | template 22 | arma_warn_unused arma_inline 23 | typename enable_if2::value, const Op >::result 24 | repelem(const T1& A, const uword r, const uword c) { 25 | arma_debug_sigprint(); 26 | 27 | return Op(A, r, c); 28 | } 29 | 30 | template 31 | arma_warn_unused arma_inline const SpOp repelem( 32 | const SpBase& A, const uword r, const uword c) { 33 | arma_debug_sigprint(); 34 | 35 | return SpOp(A.get_ref(), r, c); 36 | } 37 | 38 | //! @} 39 | -------------------------------------------------------------------------------- /inst/include/armadillo/fn_repmat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup fn_repmat 19 | //! @{ 20 | 21 | template 22 | arma_warn_unused arma_inline 23 | typename enable_if2::value, const Op >::result 24 | repmat(const T1& A, const uword r, const uword c) { 25 | arma_debug_sigprint(); 26 | 27 | return Op(A, r, c); 28 | } 29 | 30 | template 31 | arma_warn_unused arma_inline const SpOp repmat( 32 | const SpBase& A, const uword r, const uword c) { 33 | arma_debug_sigprint(); 34 | 35 | return SpOp(A.get_ref(), r, c); 36 | } 37 | 38 | //! @} 39 | -------------------------------------------------------------------------------- /inst/include/armadillo/fn_spones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup fn_spones 19 | //! @{ 20 | 21 | //! Generate a sparse matrix with the non-zero values in the same locations as in the 22 | //! given sparse matrix X, with the non-zero values set to one 23 | template 24 | arma_warn_unused inline SpMat spones( 25 | const SpBase& X) { 26 | arma_debug_sigprint(); 27 | 28 | typedef typename T1::elem_type eT; 29 | 30 | const unwrap_spmat U(X.get_ref()); 31 | 32 | SpMat out(arma_layout_indicator(), U.M); 33 | 34 | arrayops::inplace_set(access::rwp(out.values), eT(1), out.n_nonzero); 35 | 36 | return out; 37 | } 38 | 39 | //! @} 40 | -------------------------------------------------------------------------------- /inst/include/armadillo/fn_trapz.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup fn_trapz 19 | //! @{ 20 | 21 | template 22 | arma_warn_unused inline const Glue trapz( 23 | const Base& X, const Base& Y, 24 | const uword dim = 0) { 25 | arma_debug_sigprint(); 26 | 27 | return Glue(X.get_ref(), Y.get_ref(), dim); 28 | } 29 | 30 | template 31 | arma_warn_unused inline const Op trapz( 32 | const Base& Y, const uword dim = 0) { 33 | arma_debug_sigprint(); 34 | 35 | return Op(Y.get_ref(), dim, uword(0)); 36 | } 37 | 38 | //! @} 39 | -------------------------------------------------------------------------------- /inst/include/armadillo/fn_unique.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup fn_unique 19 | //! @{ 20 | 21 | template 22 | arma_warn_unused inline 23 | typename enable_if2::value && resolves_to_vector::yes, 24 | const Op >::result 25 | unique(const T1& A) { 26 | arma_debug_sigprint(); 27 | 28 | return Op(A); 29 | } 30 | 31 | template 32 | arma_warn_unused inline 33 | typename enable_if2::value && resolves_to_vector::no, 34 | const Op >::result 35 | unique(const T1& A) { 36 | arma_debug_sigprint(); 37 | 38 | return Op(A); 39 | } 40 | 41 | //! @} 42 | -------------------------------------------------------------------------------- /inst/include/armadillo/glue_cor_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup glue_cor 19 | //! @{ 20 | 21 | class glue_cor { 22 | public: 23 | template 24 | struct traits { 25 | static constexpr bool is_row = false; // T1::is_col; // TODO: check 26 | static constexpr bool is_col = false; // T2::is_col; // TODO: check 27 | static constexpr bool is_xvec = false; 28 | }; 29 | 30 | template 31 | inline static void apply(Mat& out, 32 | const Glue& X); 33 | }; 34 | 35 | //! @} 36 | -------------------------------------------------------------------------------- /inst/include/armadillo/glue_cov_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup glue_cov 19 | //! @{ 20 | 21 | class glue_cov { 22 | public: 23 | template 24 | struct traits { 25 | static constexpr bool is_row = false; // T1::is_col; // TODO: check 26 | static constexpr bool is_col = false; // T2::is_col; // TODO: check 27 | static constexpr bool is_xvec = false; 28 | }; 29 | 30 | template 31 | inline static void apply(Mat& out, 32 | const Glue& X); 33 | }; 34 | 35 | //! @} 36 | -------------------------------------------------------------------------------- /inst/include/armadillo/glue_cross_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup glue_cross 19 | //! @{ 20 | 21 | class glue_cross { 22 | public: 23 | template 24 | struct traits { 25 | static constexpr bool is_row = T1::is_row; 26 | static constexpr bool is_col = T1::is_col; 27 | static constexpr bool is_xvec = true; 28 | }; 29 | 30 | template 31 | inline static void apply(Mat& out, 32 | const Glue& X); 33 | }; 34 | 35 | //! @} 36 | -------------------------------------------------------------------------------- /inst/include/armadillo/glue_polyval_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup glue_polyval 19 | //! @{ 20 | 21 | class glue_polyval { 22 | public: 23 | template 24 | struct traits { 25 | static constexpr bool is_row = T2::is_row; 26 | static constexpr bool is_col = T2::is_col; 27 | static constexpr bool is_xvec = T2::is_xvec; 28 | }; 29 | 30 | template 31 | inline static void apply_noalias(Mat& out, const Mat& P, const Mat& X); 32 | 33 | template 34 | inline static void apply(Mat& out, 35 | const Glue& expr); 36 | }; 37 | 38 | //! @} 39 | -------------------------------------------------------------------------------- /inst/include/armadillo/glue_toeplitz_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup glue_toeplitz 19 | //! @{ 20 | 21 | class glue_toeplitz : public traits_glue_default { 22 | public: 23 | template 24 | inline static void apply(Mat& out, 25 | const Glue& in); 26 | }; 27 | 28 | //! @} 29 | -------------------------------------------------------------------------------- /inst/include/armadillo/mtSpGlue_meat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup mtSpGlue 19 | //! @{ 20 | 21 | template 22 | inline mtSpGlue::mtSpGlue(const T1& in_A, const T2& in_B) 23 | : A(in_A), B(in_B) { 24 | arma_debug_sigprint(); 25 | } 26 | 27 | template 28 | inline mtSpGlue::~mtSpGlue() { 29 | arma_debug_sigprint(); 30 | } 31 | 32 | template 33 | template 34 | arma_inline bool mtSpGlue::is_alias( 35 | const SpMat& X) const { 36 | return (A.is_alias(X) || B.is_alias(X)); 37 | } 38 | 39 | //! @} 40 | -------------------------------------------------------------------------------- /inst/include/armadillo/newarp_DenseGenMatProd_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | namespace newarp { 19 | 20 | //! Define matrix operations on existing matrix objects 21 | template 22 | class DenseGenMatProd { 23 | private: 24 | const Mat& op_mat; 25 | 26 | public: 27 | const uword n_rows; // number of rows of the underlying matrix 28 | const uword n_cols; // number of columns of the underlying matrix 29 | 30 | inline DenseGenMatProd(const Mat& mat_obj); 31 | 32 | inline void perform_op(eT* x_in, eT* y_out) const; 33 | }; 34 | 35 | } // namespace newarp 36 | -------------------------------------------------------------------------------- /inst/include/armadillo/newarp_DenseGenMatProd_meat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | namespace newarp { 19 | 20 | template 21 | inline DenseGenMatProd::DenseGenMatProd(const Mat& mat_obj) 22 | : op_mat(mat_obj), n_rows(mat_obj.n_rows), n_cols(mat_obj.n_cols) { 23 | arma_debug_sigprint(); 24 | } 25 | 26 | // Perform the matrix-vector multiplication operation \f$y=Ax\f$. 27 | // y_out = A * x_in 28 | template 29 | inline void DenseGenMatProd::perform_op(eT* x_in, eT* y_out) const { 30 | arma_debug_sigprint(); 31 | 32 | const Col x(x_in, n_cols, false, true); 33 | Col y(y_out, n_rows, false, true); 34 | 35 | y = op_mat * x; 36 | } 37 | 38 | } // namespace newarp 39 | -------------------------------------------------------------------------------- /inst/include/armadillo/newarp_SparseGenMatProd_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | namespace newarp { 19 | 20 | //! Define matrix operations on existing matrix objects 21 | template 22 | class SparseGenMatProd { 23 | private: 24 | const SpMat& op_mat; 25 | SpMat op_mat_st; 26 | 27 | public: 28 | const uword n_rows; // number of rows of the underlying matrix 29 | const uword n_cols; // number of columns of the underlying matrix 30 | 31 | inline SparseGenMatProd(const SpMat& mat_obj); 32 | 33 | inline void perform_op(eT* x_in, eT* y_out) const; 34 | }; 35 | 36 | } // namespace newarp 37 | -------------------------------------------------------------------------------- /inst/include/armadillo/newarp_SymEigsShiftSolver_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | namespace newarp { 19 | 20 | //! This class implements the eigen solver for real symmetric matrices in the 21 | //! shift-and-invert mode. 22 | template 23 | class SymEigsShiftSolver : public SymEigsSolver { 24 | private: 25 | const eT sigma; 26 | 27 | // Sort the first nev Ritz pairs in ascending algebraic order 28 | // This is used to return the final results 29 | void sort_ritzpair(); 30 | 31 | public: 32 | //! Constructor to create a solver object. 33 | inline SymEigsShiftSolver(const OpType& op_, uword nev_, uword ncv_, const eT sigma_); 34 | }; 35 | 36 | } // namespace newarp 37 | -------------------------------------------------------------------------------- /inst/include/armadillo/newarp_cx_attrib.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | namespace newarp { 19 | 20 | //! Tiny functions to check attributes of complex numbers 21 | struct cx_attrib { 22 | template 23 | arma_inline static bool is_real(const std::complex& v, const T eps) { 24 | return (std::abs(v.imag()) <= eps); 25 | } 26 | 27 | template 28 | arma_inline static bool is_complex(const std::complex& v, const T eps) { 29 | return (std::abs(v.imag()) > eps); 30 | } 31 | 32 | template 33 | arma_inline static bool is_conj(const std::complex& v1, const std::complex& v2, 34 | const T eps) { 35 | return (std::abs(v1 - std::conj(v2)) <= eps); 36 | } 37 | }; 38 | 39 | } // namespace newarp 40 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_chol_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_chol 19 | //! @{ 20 | 21 | class op_chol : public traits_op_default { 22 | public: 23 | template 24 | inline static void apply(Mat& out, const Op& X); 25 | 26 | template 27 | inline static bool apply_direct(Mat& out, 28 | const Base& A_expr, 29 | const uword layout); 30 | }; 31 | 32 | //! @} 33 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_col_as_mat_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_col_as_mat 19 | //! @{ 20 | 21 | class op_col_as_mat : public traits_op_default { 22 | public: 23 | template 24 | inline static void apply(Mat& out, 25 | const CubeToMatOp& expr); 26 | }; 27 | 28 | //! @} 29 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_cond_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_cond 19 | //! @{ 20 | 21 | class op_cond : public traits_op_default { 22 | public: 23 | template 24 | static inline typename T1::pod_type apply(const Base& X); 25 | 26 | template 27 | static inline typename get_pod_type::result apply_diag(const Mat& A); 28 | template 29 | static inline typename get_pod_type::result apply_sym(Mat& A); 30 | template 31 | static inline typename get_pod_type::result apply_gen(Mat& A); 32 | }; 33 | 34 | //! @} 35 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_cor_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_cor 19 | //! @{ 20 | 21 | class op_cor : public traits_op_default { 22 | public: 23 | template 24 | inline static void apply(Mat& out, const Op& in); 25 | template 26 | inline static void apply(Mat& out, 27 | const Op, op_cor>& in); 28 | }; 29 | 30 | //! @} 31 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_cov_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_cov 19 | //! @{ 20 | 21 | class op_cov : public traits_op_default { 22 | public: 23 | template 24 | inline static void apply(Mat& out, const Op& in); 25 | template 26 | inline static void apply(Mat& out, 27 | const Op, op_cov>& in); 28 | }; 29 | 30 | //! @} 31 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_cumprod_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_cumprod 19 | //! @{ 20 | 21 | class op_cumprod : public traits_op_default { 22 | public: 23 | template 24 | inline static void apply_noalias(Mat& out, const Mat& X, const uword dim); 25 | 26 | template 27 | inline static void apply(Mat& out, 28 | const Op& in); 29 | }; 30 | 31 | class op_cumprod_vec : public traits_op_passthru { 32 | public: 33 | template 34 | inline static void apply(Mat& out, 35 | const Op& in); 36 | }; 37 | 38 | //! @} 39 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_cumsum_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_cumsum 19 | //! @{ 20 | 21 | class op_cumsum : public traits_op_default { 22 | public: 23 | template 24 | inline static void apply_noalias(Mat& out, const Mat& X, const uword dim); 25 | 26 | template 27 | inline static void apply(Mat& out, const Op& in); 28 | }; 29 | 30 | class op_cumsum_vec : public traits_op_passthru { 31 | public: 32 | template 33 | inline static void apply(Mat& out, 34 | const Op& in); 35 | }; 36 | 37 | //! @} 38 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_diff_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_diff 19 | //! @{ 20 | 21 | class op_diff : public traits_op_default { 22 | public: 23 | template 24 | inline static void apply_noalias(Mat& out, const Mat& X, const uword k, 25 | const uword dim); 26 | 27 | template 28 | inline static void apply(Mat& out, const Op& in); 29 | }; 30 | 31 | class op_diff_vec : public traits_op_passthru { 32 | public: 33 | template 34 | inline static void apply(Mat& out, 35 | const Op& in); 36 | }; 37 | 38 | //! @} 39 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_hist_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_hist 19 | //! @{ 20 | 21 | class op_hist : public traits_op_passthru { 22 | public: 23 | template 24 | inline static void apply_noalias(Mat& out, const Mat& A, const uword n_bins, 25 | const uword dim); 26 | 27 | template 28 | inline static void apply(Mat& out, const mtOp& X); 29 | }; 30 | 31 | //! @} 32 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_nonzeros_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_nonzeros 19 | //! @{ 20 | 21 | class op_nonzeros : public traits_op_col { 22 | public: 23 | // for dense matrices 24 | 25 | template 26 | static inline void apply_noalias(Mat& out, const Proxy& P); 27 | 28 | template 29 | static inline void apply(Mat& out, 30 | const Op& X); 31 | }; 32 | 33 | //! @} 34 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_normalise_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_normalise 19 | //! @{ 20 | 21 | class op_normalise_vec : public traits_op_passthru { 22 | public: 23 | template 24 | inline static void apply(Mat& out, 25 | const Op& in); 26 | }; 27 | 28 | class op_normalise_mat : public traits_op_default { 29 | public: 30 | template 31 | inline static void apply(Mat& out, 32 | const Op& in); 33 | 34 | template 35 | inline static void apply(Mat& out, const Mat& A, const uword p, 36 | const uword dim); 37 | }; 38 | 39 | //! @} 40 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_prod_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_prod 19 | //! @{ 20 | 21 | class op_prod : public traits_op_xvec { 22 | public: 23 | template 24 | inline static void apply_noalias(Mat& out, const Mat& X, const uword dim); 25 | 26 | template 27 | inline static void apply(Mat& out, const Op& in); 28 | 29 | template 30 | inline static eT prod(const subview& S); 31 | 32 | template 33 | inline static typename T1::elem_type prod(const Base& X); 34 | }; 35 | 36 | //! @} 37 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_range_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_range 19 | //! @{ 20 | 21 | class op_range : public traits_op_xvec { 22 | public: 23 | template 24 | inline static void apply(Mat& out, const Op& in); 25 | 26 | template 27 | inline static void apply_noalias(Mat& out, const Mat& X, const uword dim); 28 | 29 | template 30 | inline static typename T1::elem_type vector_range(const T1& expr); 31 | }; 32 | 33 | //! @} 34 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_rcond_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_rcond 19 | //! @{ 20 | 21 | class op_rcond : public traits_op_default { 22 | public: 23 | template 24 | static inline typename T1::pod_type apply(const Base& X); 25 | }; 26 | 27 | //! @} 28 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_repelem_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_repelem 19 | //! @{ 20 | 21 | class op_repelem : public traits_op_default { 22 | public: 23 | template 24 | inline static void apply_noalias(Mat& out, const obj& X, 25 | const uword copies_per_row, 26 | const uword copies_per_col); 27 | 28 | template 29 | inline static void apply(Mat& out, 30 | const Op& in); 31 | }; 32 | 33 | //! @} 34 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_repmat_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_repmat 19 | //! @{ 20 | 21 | class op_repmat : public traits_op_default { 22 | public: 23 | template 24 | inline static void apply_noalias(Mat& out, const obj& X, 25 | const uword copies_per_row, 26 | const uword copies_per_col); 27 | 28 | template 29 | inline static void apply(Mat& out, const Op& in); 30 | }; 31 | 32 | //! @} 33 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_reverse_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_reverse 19 | //! @{ 20 | 21 | class op_reverse : public traits_op_default { 22 | public: 23 | template 24 | inline static void apply(Mat& out, 25 | const Op& in); 26 | }; 27 | 28 | class op_reverse_vec : public traits_op_passthru { 29 | public: 30 | template 31 | inline static void apply(Mat& out, 32 | const Op& in); 33 | }; 34 | 35 | //! @} 36 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_roots_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_roots 19 | //! @{ 20 | 21 | class op_roots : public traits_op_col { 22 | public: 23 | template 24 | inline static void apply( 25 | Mat >& out, 26 | const mtOp, T1, op_roots>& expr); 27 | 28 | template 29 | inline static bool apply_direct(Mat >& out, 30 | const Base& X); 31 | 32 | template 33 | inline static bool apply_noalias( 34 | Mat::result> >& out, const Mat& X); 35 | }; 36 | 37 | //! @} 38 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_row_as_mat_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_row_as_mat 19 | //! @{ 20 | 21 | class op_row_as_mat : public traits_op_default { 22 | public: 23 | template 24 | inline static void apply(Mat& out, 25 | const CubeToMatOp& expr); 26 | }; 27 | 28 | //! @} 29 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_shift_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_shift 19 | //! @{ 20 | 21 | class op_shift_vec : public traits_op_passthru { 22 | public: 23 | template 24 | inline static void apply(Mat& out, 25 | const Op& in); 26 | }; 27 | 28 | class op_shift : public traits_op_default { 29 | public: 30 | template 31 | inline static void apply_noalias(Mat& out, const Mat& X, const uword len, 32 | const uword neg, const uword dim); 33 | }; 34 | 35 | //! @} 36 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_shuffle_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_shuffle 19 | //! @{ 20 | 21 | class op_shuffle : public traits_op_default { 22 | public: 23 | template 24 | inline static void apply_direct(Mat& out, const Mat& X, const uword dim); 25 | 26 | template 27 | inline static void apply(Mat& out, 28 | const Op& in); 29 | }; 30 | 31 | class op_shuffle_vec : public traits_op_passthru { 32 | public: 33 | template 34 | inline static void apply(Mat& out, 35 | const Op& in); 36 | }; 37 | 38 | //! @} 39 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_sp_as_dense_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_sp_as_dense 19 | //! @{ 20 | 21 | class op_sp_as_dense : public traits_op_passthru { 22 | public: 23 | template 24 | inline static void apply(Mat& out, 25 | const SpToDOp& expr); 26 | }; 27 | 28 | //! @} 29 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_sp_as_dense_meat.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_sp_as_dense 19 | //! @{ 20 | 21 | template 22 | inline void op_sp_as_dense::apply(Mat& out, 23 | const SpToDOp& expr) { 24 | arma_debug_sigprint(); 25 | 26 | out = expr.m; 27 | } 28 | 29 | //! @} 30 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_sp_diagvec_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_sp_diagvec 19 | //! @{ 20 | 21 | class op_sp_diagvec : public traits_op_col { 22 | public: 23 | template 24 | inline static void apply( 25 | Mat& out, 26 | const mtSpReduceOp& in); 27 | }; 28 | 29 | //! @} 30 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_sp_nonzeros_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_sp_nonzeros 19 | //! @{ 20 | 21 | class op_sp_nonzeros : public traits_op_col { 22 | public: 23 | template 24 | static inline void apply(Mat& out, 25 | const SpToDOp& X); 26 | }; 27 | 28 | //! @} 29 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_sp_stddev_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_sp_stddev 19 | //! @{ 20 | 21 | class op_sp_stddev : public traits_op_xvec { 22 | public: 23 | template 24 | inline static void apply( 25 | Mat& out, 26 | const mtSpReduceOp& in); 27 | 28 | template 29 | inline static void apply_slow(Mat& out, const SpProxy& p, 30 | const uword norm_type, const uword dim); 31 | 32 | template 33 | inline static typename T1::pod_type stddev_vec(const T1& X, const uword norm_type = 0); 34 | }; 35 | 36 | //! @} 37 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_sp_sum_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_sp_sum 19 | //! @{ 20 | 21 | class op_sp_sum : public traits_op_xvec { 22 | public: 23 | template 24 | inline static void apply(Mat& out, 25 | const mtSpReduceOp& in); 26 | }; 27 | 28 | //! @} 29 | -------------------------------------------------------------------------------- /inst/include/armadillo/op_toeplitz_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup op_toeplitz 19 | //! @{ 20 | 21 | class op_toeplitz : public traits_op_default { 22 | public: 23 | template 24 | inline static void apply(Mat& out, 25 | const Op& in); 26 | }; 27 | 28 | class op_toeplitz_c : public traits_op_default { 29 | public: 30 | template 31 | inline static void apply(Mat& out, 32 | const Op& in); 33 | }; 34 | 35 | //! @} 36 | -------------------------------------------------------------------------------- /inst/include/armadillo/spglue_kron_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup spglue_kron 19 | //! @{ 20 | 21 | class spglue_kron { 22 | public: 23 | template 24 | struct traits { 25 | static constexpr bool is_row = (T1::is_row && T2::is_row); 26 | static constexpr bool is_col = (T1::is_col && T2::is_col); 27 | static constexpr bool is_xvec = false; 28 | }; 29 | 30 | template 31 | inline static void apply(SpMat& out, 32 | const SpGlue& X); 33 | 34 | template 35 | inline static void apply_noalias(SpMat& out, const SpMat& A, 36 | const SpMat& B); 37 | }; 38 | 39 | //! @} 40 | -------------------------------------------------------------------------------- /inst/include/armadillo/spglue_merge_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup spglue_merge 19 | //! @{ 20 | 21 | class spglue_merge { 22 | public: 23 | template 24 | inline static void subview_merge(SpSubview& sv, const SpMat& B); 25 | 26 | template 27 | inline static void subview_merge(SpSubview& sv, const Mat& B); 28 | 29 | template 30 | inline static void symmat_merge(SpMat& out, const SpMat& A, const SpMat& B); 31 | 32 | template 33 | inline static void diagview_merge(SpMat& out, const SpMat& A, 34 | const SpMat& B); 35 | }; 36 | 37 | //! @} 38 | -------------------------------------------------------------------------------- /inst/include/armadillo/spop_normalise_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup spop_normalise 19 | //! @{ 20 | 21 | class spop_normalise : public traits_op_passthru { 22 | public: 23 | template 24 | inline static void apply(SpMat& out, 25 | const SpOp& expr); 26 | 27 | template 28 | inline static void apply_direct(SpMat& out, const SpMat& X, const uword p); 29 | }; 30 | 31 | //! @} 32 | -------------------------------------------------------------------------------- /inst/include/armadillo/spop_repmat_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup spop_repmat 19 | //! @{ 20 | 21 | class spop_repmat : public traits_op_default { 22 | public: 23 | template 24 | inline static void apply(SpMat& out, 25 | const SpOp& X); 26 | 27 | template 28 | inline static void apply_noalias(SpMat& out, const uword A_n_rows, 29 | const uword A_n_cols, const SpMat& B); 30 | }; 31 | 32 | //! @} 33 | -------------------------------------------------------------------------------- /inst/include/armadillo/spop_reverse_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup spop_reverse 19 | //! @{ 20 | 21 | class spop_reverse : public traits_op_passthru { 22 | public: 23 | template 24 | inline static void apply_spmat(SpMat& out, const SpMat& X, const uword dim); 25 | 26 | template 27 | inline static void apply_proxy(SpMat& out, const T1& X, 28 | const uword dim); 29 | 30 | template 31 | inline static void apply(SpMat& out, 32 | const SpOp& in); 33 | }; 34 | 35 | //! @} 36 | -------------------------------------------------------------------------------- /inst/include/armadillo/spop_shift_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup spop_shift 19 | //! @{ 20 | 21 | class spop_shift : public traits_op_default { 22 | public: 23 | template 24 | inline static void apply_noalias(SpMat& out, const SpMat& X, const uword len, 25 | const uword neg, const uword dim); 26 | }; 27 | 28 | //! @} 29 | -------------------------------------------------------------------------------- /inst/include/armadillo/spop_symmat_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup spop_symmat 19 | //! @{ 20 | 21 | class spop_symmat : public traits_op_default { 22 | public: 23 | template 24 | inline static void apply(SpMat& out, 25 | const SpOp& in); 26 | }; 27 | 28 | class spop_symmat_cx : public traits_op_default { 29 | public: 30 | template 31 | inline static void apply(SpMat& out, 32 | const SpOp& in); 33 | }; 34 | 35 | //! @} 36 | -------------------------------------------------------------------------------- /inst/include/armadillo/wall_clock_bones.hpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | // 3 | // Copyright 2008-2016 Conrad Sanderson (http://conradsanderson.id.au) 4 | // Copyright 2008-2016 National ICT Australia (NICTA) 5 | // 6 | // Licensed under the Apache License, Version 2.0 (the "License"); 7 | // you may not use this file except in compliance with the License. 8 | // You may obtain a copy of the License at 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | // ------------------------------------------------------------------------ 17 | 18 | //! \addtogroup wall_clock 19 | //! @{ 20 | 21 | //! Class for measuring time intervals 22 | class wall_clock { 23 | public: 24 | inline wall_clock(); 25 | inline ~wall_clock(); 26 | 27 | inline void tic(); //!< start the timer 28 | arma_warn_unused inline double 29 | toc(); //!< return the number of seconds since the last call to tic() 30 | 31 | private: 32 | std::chrono::steady_clock::time_point chrono_time1; 33 | 34 | bool valid = false; 35 | }; 36 | 37 | //! @} 38 | -------------------------------------------------------------------------------- /inst/include/update_instructions.md: -------------------------------------------------------------------------------- 1 | After updating Armadillo version: 2 | 3 | 1. `armadillo.hpp` includes a custom `r_messages.hpp` in line 28. 4 | 2. `armadillo/arma_forward.hpp` omits `std::cerr` in line 18. 5 | 3. `armadillo/config.hpp` calls a custom error redirection in line 238. 6 | -------------------------------------------------------------------------------- /inst/rstudio/templates/project/cpp11armadillo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/inst/rstudio/templates/project/cpp11armadillo_small.png -------------------------------------------------------------------------------- /inst/rstudio/templates/project/hello_world.dcf: -------------------------------------------------------------------------------- 1 | Title: R package using armadillo 2 | Binding: start_project 3 | OpenFiles: README 4 | Icon: cpp11armadillo_small.png 5 | -------------------------------------------------------------------------------- /man/armadillo_version.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/version.R 3 | \name{armadillo_version} 4 | \alias{armadillo_version} 5 | \title{Get Armadillo version} 6 | \usage{ 7 | armadillo_version() 8 | } 9 | \value{ 10 | A string with the Armadillo version name and number 11 | } 12 | \description{ 13 | Provides the Armadillo C++ library version name and number included in the 14 | package. 15 | } 16 | \examples{ 17 | armadillo_version() 18 | } 19 | -------------------------------------------------------------------------------- /man/check_cpp11.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/cpp11armadillo-package.R 3 | \name{check_cpp11} 4 | \alias{check_cpp11} 5 | \title{Check that cpp11 can be used} 6 | \usage{ 7 | check_cpp11() 8 | } 9 | \value{ 10 | integer value 11 | } 12 | \description{ 13 | Check that cpp11 can be used 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/cpp11armadillo-package.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/cpp11armadillo-package.R 3 | \docType{package} 4 | \name{cpp11armadillo-package} 5 | \alias{cpp11armadillo} 6 | \alias{cpp11armadillo-package} 7 | \title{cpp11armadillo: An 'Armadillo' Interface} 8 | \description{ 9 | Provides function declarations and inline function definitions that facilitate communication between R and the 'Armadillo' 'C++' library for linear algebra and scientific computing. This implementation is detailed in Vargas Sepulveda and Schneider Malamud (2024) \doi{10.1016/j.softx.2025.102087}. 10 | } 11 | \seealso{ 12 | Useful links: 13 | \itemize{ 14 | \item \url{https://pacha.dev/cpp11armadillo/} 15 | \item \url{https://github.com/pachadotdev/cpp11armadillo} 16 | \item Report bugs at \url{https://github.com/pachadotdev/cpp11armadillo/issues} 17 | } 18 | 19 | } 20 | \author{ 21 | \strong{Maintainer}: Mauricio Vargas Sepulveda \email{m.sepulveda@mail.utoronto.ca} (\href{https://orcid.org/0000-0003-1017-7574}{ORCID}) 22 | 23 | Authors: 24 | \itemize{ 25 | \item Conrad Sanderson (Armadillo library (C++)) 26 | } 27 | 28 | Other contributors: 29 | \itemize{ 30 | \item Jonathan Schneider Malamud [contributor] 31 | } 32 | 33 | } 34 | \keyword{internal} 35 | -------------------------------------------------------------------------------- /man/cpp_vendor.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/vendor.R 3 | \name{cpp_vendor} 4 | \alias{cpp_vendor} 5 | \title{Vendor the cpp11 and cpp11armadillo dependency} 6 | \usage{ 7 | cpp_vendor(dir = NULL, subdir = "/inst/include") 8 | } 9 | \arguments{ 10 | \item{dir}{The directory to vendor the code into.} 11 | 12 | \item{subdir}{The subdirectory to vendor the code into.} 13 | } 14 | \value{ 15 | The file path to the vendored code (invisibly). 16 | } 17 | \description{ 18 | Vendoring is the act of making your own copy of the 3rd party packages your 19 | project is using. It is often used in the go language community. 20 | } 21 | \details{ 22 | This function vendors cpp11 and cpp11armadillo into your package by copying 23 | the cpp11 and cpp11armadillo headers into the `inst/include` folder and 24 | adding 'cpp11 version: XYZ' and 'cpp11armadillo version: XYZ' to the top of 25 | the files, where XYZ is the version of cpp11 and cpp11armadillo currently 26 | installed on your machine. 27 | 28 | Vendoring places the responsibility of updating the code on 29 | you. Bugfixes and new features in cpp11 and cpp11armadillo will not be 30 | available for your code until you run `cpp_vendor()` again. 31 | } 32 | \examples{ 33 | # create a new directory 34 | dir <- tempdir() 35 | dir.create(dir) 36 | 37 | # vendor the cpp11 headers into the directory 38 | cpp_vendor(dir) 39 | } 40 | -------------------------------------------------------------------------------- /man/pkg_template.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/template.R 3 | \name{pkg_template} 4 | \alias{pkg_template} 5 | \title{Start a new project with the cpp11armadillo package template} 6 | \usage{ 7 | pkg_template(path = NULL, pkgname = NULL) 8 | } 9 | \arguments{ 10 | \item{path}{Path to the new project} 11 | 12 | \item{pkgname}{Name of the new package} 13 | } 14 | \value{ 15 | The file path to the copied template (invisibly). 16 | } 17 | \description{ 18 | Start a new project with the cpp11armadillo package template 19 | } 20 | \examples{ 21 | # create a new directory 22 | dir <- tempdir() 23 | dir.create(dir) 24 | 25 | # copy the package template into the directory 26 | pkg_template(dir, "mynewpkg") 27 | } 28 | -------------------------------------------------------------------------------- /softwarex-article/.gitignore: -------------------------------------------------------------------------------- 1 | *.zip 2 | _extensions 3 | .quarto 4 | 5 | /.quarto/ 6 | -------------------------------------------------------------------------------- /softwarex-article/README.txt: -------------------------------------------------------------------------------- 1 | # How to build the manuscript 2 | 3 | 1. Put the extracted data and qmd file in the same directory. 4 | 2. Install the "PLOS ONE" extension with `quarto add quarto-journals/plos` 5 | 3. Render the QMD file with `quarto render cpp11armadillo.qmd --to plos-pdf`, 6 | this will create a PDF and a TEX file besides a directory for the plots. 7 | -------------------------------------------------------------------------------- /softwarex-article/benchcpp11armadillo/.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^\.Renviron$ 4 | ^docs$ 5 | ^vignettes/images$ 6 | ^\.github$ 7 | ^\.vscode$ 8 | ^dev$ 9 | ^LICENSE\.md$ 10 | ^README$ 11 | ^README\.Rmd$ 12 | -------------------------------------------------------------------------------- /softwarex-article/benchcpp11armadillo/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: benchcpp11armadillo 2 | Type: Package 3 | Title: ADD TITLE 4 | Version: 0.1 5 | Authors@R: c( 6 | person( 7 | given = "YOUR", 8 | family = "NAME", 9 | role = c("aut", "cre"), 10 | email = "YOUR@EMAIL.COM", 11 | comment = c(ORCID = "0000-0001-0002-0003")) 12 | ) 13 | Suggests: 14 | knitr, 15 | rmarkdown 16 | Depends: R(>= 3.5.0) 17 | Description: ADD DESCRIPTION. TWO OR MORE LINES 18 | License: ADD LICENSE 19 | BugReports: https://github.com/USERNAME/PKGNAME/issues 20 | URL: https://WEBSITE.COM 21 | RoxygenNote: 7.3.2 22 | Encoding: UTF-8 23 | NeedsCompilation: yes 24 | VignetteBuilder: knitr 25 | LinkingTo: cpp11, cpp11armadillo 26 | -------------------------------------------------------------------------------- /softwarex-article/benchcpp11armadillo/NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(bench_eig_cpp11armadillo) 4 | export(bench_eig_r) 5 | export(bench_multi_cpp11armadillo) 6 | export(bench_multi_r) 7 | useDynLib(benchcpp11armadillo, .registration = TRUE) 8 | -------------------------------------------------------------------------------- /softwarex-article/benchcpp11armadillo/R/benchcpp11armadillo-package.R: -------------------------------------------------------------------------------- 1 | #' @useDynLib benchcpp11armadillo, .registration = TRUE 2 | #' @keywords internal 3 | "_PACKAGE" 4 | 5 | #' @export 6 | bench_eig_r <- function(m) { 7 | sort(eigen(m)$values) 8 | } 9 | 10 | #' @export 11 | bench_eig_cpp11armadillo <- function(m) { 12 | bench_eig_cpp11armadillo_(m) 13 | } 14 | 15 | #' @export 16 | bench_multi_r <- function(p,q,r) { 17 | as.numeric(t(p) %*% solve(diag(q)) %*% r) 18 | } 19 | 20 | #' @export 21 | bench_multi_cpp11armadillo <- function(p,q,r) { 22 | bench_multi_cpp11armadillo_(p,q,r) 23 | } 24 | -------------------------------------------------------------------------------- /softwarex-article/benchcpp11armadillo/R/cpp11.R: -------------------------------------------------------------------------------- 1 | # Generated by cpp11: do not edit by hand 2 | 3 | bench_eig_cpp11armadillo_ <- function(m) { 4 | .Call(`_benchcpp11armadillo_bench_eig_cpp11armadillo_`, m) 5 | } 6 | 7 | bench_multi_cpp11armadillo_ <- function(p, q, r) { 8 | .Call(`_benchcpp11armadillo_bench_multi_cpp11armadillo_`, p, q, r) 9 | } 10 | -------------------------------------------------------------------------------- /softwarex-article/benchcpp11armadillo/R/solverpp11armadillo-package.R: -------------------------------------------------------------------------------- 1 | #' @useDynLib benchcpp11armadillo, .registration = TRUE 2 | #' @keywords internal 3 | "_PACKAGE" 4 | 5 | #' @export 6 | bench_eig_r <- function(m) { 7 | eigen(m)$values 8 | } 9 | 10 | #' @export 11 | bench_eig_cpp11armadillo <- function(m) { 12 | bench_eig_cpp11armadillo_(m) 13 | } 14 | 15 | #' @export 16 | bench_multi_r <- function(p,q,r) { 17 | as.numeric(t(p) %*% solve(diag(q)) %*% r) 18 | } 19 | 20 | #' @export 21 | bench_multi_cpp11armadillo <- function(p,q,r) { 22 | bench_multi_cpp11armadillo_(p,q,r) 23 | } 24 | -------------------------------------------------------------------------------- /softwarex-article/benchcpp11armadillo/README: -------------------------------------------------------------------------------- 1 | How to use cpp11armadillo? 2 | 3 | 1. Start a new project with RStudio. 4 | 2. Open `dev/01_load_or_install.R` and run it. 5 | 3. Open `src/01_ols.cpp`, inspect the OLS functions. 6 | 4. Create your own functions in `02_your_functions.cpp`. 7 | 5. Run `devtools::load_all()` in `dev/01_load_or_install.R` to test your 8 | functions. 9 | 6. Run `dev/03_readme_and_license.R` to add a README and license. 10 | 7. Run `devtools::install()` in `dev/01_load_or_install.R` to install the 11 | package locally when you are ready. 12 | -------------------------------------------------------------------------------- /softwarex-article/benchcpp11armadillo/dev/01_load_or_install.R: -------------------------------------------------------------------------------- 1 | # run this line if you want to replace all the files provided by the template 2 | # cpp11armadillo::pkg_template() 3 | 4 | development <- TRUE 5 | 6 | devtools::clean_dll() 7 | cpp11::cpp_register() 8 | devtools::document() 9 | 10 | if (isTRUE(development)) { 11 | devtools::load_all() 12 | } else { 13 | devtools::install() 14 | } 15 | -------------------------------------------------------------------------------- /softwarex-article/benchcpp11armadillo/dev/02_test.R: -------------------------------------------------------------------------------- 1 | # Estimate the model y ~ constant + x 2 | # with y and x gaussian random variables 3 | 4 | set.seed(123) 5 | y <- matrix(rnorm(100), ncol = 1, nrow = 100) 6 | x <- matrix(1, ncol = 1, nrow = 100) 7 | x <- cbind(x, rnorm(100, 0, 1)) 8 | 9 | # Armadillo computation 10 | ols_mat(y, x) 11 | ols_dbl(y, x) 12 | 13 | # Base R computation 14 | solve(t(x) %*% x) %*% t(x) %*% y 15 | lm(y ~ x + 0) 16 | 17 | # Test your own functions now 18 | -------------------------------------------------------------------------------- /softwarex-article/benchcpp11armadillo/dev/03_readme_and_license.R: -------------------------------------------------------------------------------- 1 | # Readme 2 | 3 | usethis::use_readme_rmd() 4 | 5 | # License 6 | 7 | usethis::use_apache_license() 8 | # usethis::use_mit_license() 9 | # usethis::use_gpl3_license() 10 | # usethis::use_cc0_license() 11 | # usethis::use_ccby_license() 12 | -------------------------------------------------------------------------------- /softwarex-article/benchcpp11armadillo/dev/data.r: -------------------------------------------------------------------------------- 1 | x <- as.matrix(mtcars[, -1]) 2 | 3 | # cyl gear and carb are categorical variables 4 | str(mtcars) 5 | unique(mtcars$cyl) 6 | unique(mtcars$gear) 7 | unique(mtcars$carb) 8 | 9 | # add new column to x 10 | x <- cbind(x, cyl4 = as.numeric(mtcars$cyl == 4)) 11 | x <- cbind(x, cyl6 = as.numeric(mtcars$cyl == 6)) 12 | x <- cbind(x, cyl8 = as.numeric(mtcars$cyl == 8)) 13 | x <- x[, !(colnames(x) == "cyl")] 14 | 15 | x <- cbind(x, gear3 = as.numeric(mtcars$gear == 3)) 16 | x <- cbind(x, gear4 = as.numeric(mtcars$gear == 4)) 17 | x <- cbind(x, gear5 = as.numeric(mtcars$gear == 5)) 18 | x <- x[, !(colnames(x) == "gear")] 19 | 20 | x <- cbind(x, carb1 = as.numeric(mtcars$carb == 1)) 21 | x <- cbind(x, carb2 = as.numeric(mtcars$carb == 2)) 22 | x <- cbind(x, carb3 = as.numeric(mtcars$carb == 3)) 23 | x <- cbind(x, carb4 = as.numeric(mtcars$carb == 4)) 24 | x <- cbind(x, carb6 = as.numeric(mtcars$carb == 6)) 25 | x <- cbind(x, carb8 = as.numeric(mtcars$carb == 8)) 26 | x <- x[, !(colnames(x) == "carb")] 27 | 28 | y <- matrix(mtcars[, 1]) 29 | colnames(y) <- "mpg" 30 | rownames(y) <- rownames(mtcars) 31 | 32 | dim(x) 33 | dim(y) 34 | 35 | mtcars_mat <- list(x = x, y = y) 36 | 37 | use_data(mtcars_mat, overwrite = TRUE) 38 | -------------------------------------------------------------------------------- /softwarex-article/benchcpp11armadillo/man/benchcpp11armadillo-package.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/benchcpp11armadillo-package.R 3 | \docType{package} 4 | \name{benchcpp11armadillo-package} 5 | \alias{benchcpp11armadillo} 6 | \alias{benchcpp11armadillo-package} 7 | \title{benchcpp11armadillo: ADD TITLE} 8 | \description{ 9 | ADD DESCRIPTION. TWO OR MORE LINES 10 | } 11 | \seealso{ 12 | Useful links: 13 | \itemize{ 14 | \item \url{https://WEBSITE.COM} 15 | \item Report bugs at \url{https://github.com/USERNAME/PKGNAME/issues} 16 | } 17 | 18 | } 19 | \author{ 20 | \strong{Maintainer}: YOUR NAME \email{YOUR@EMAIL.COM} (\href{https://orcid.org/0000-0001-0002-0003}{ORCID}) 21 | 22 | } 23 | \keyword{internal} 24 | -------------------------------------------------------------------------------- /softwarex-article/benchcpp11armadillo/src/01_bench.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | using namespace cpp11; 4 | using namespace arma; 5 | 6 | [[cpp11::register]] doubles bench_eig_cpp11armadillo_(const doubles_matrix<>& m) { 7 | mat M = as_Mat(m); 8 | colvec Y = eig_sym(M); 9 | return as_doubles(Y); 10 | } 11 | 12 | [[cpp11::register]] double bench_multi_cpp11armadillo_(const doubles& p, const doubles& q, 13 | const doubles& r) { 14 | colvec P = as_Col(p); 15 | colvec Q = as_Col(q); 16 | colvec R = as_Col(r); 17 | return as_scalar(trans(P) * inv(diagmat(Q)) * R); 18 | } 19 | -------------------------------------------------------------------------------- /softwarex-article/benchcpp11armadillo/src/Makevars: -------------------------------------------------------------------------------- 1 | PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -DARMA_OPENMP_THREADS=40 2 | PKG_LIBS = -L$(MKLROOT)/lib/intel64_lin -lmkl_rt -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core -lpthread -lm -ldl 3 | -------------------------------------------------------------------------------- /softwarex-article/benchcpp11armadillo/src/Makevars.win: -------------------------------------------------------------------------------- 1 | # DARMA_OPENMP_THREADS is a natural number between 1 and the number of cores 2 | PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -DARMA_OPENMP_THREADS=1 3 | PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) 4 | 5 | # Debugging 6 | 7 | # uncomment one of the following lines to enable debugging 8 | # PKG_CPPFLAGS = -UDEBUG -g 9 | # PKG_CPPFLAGS = -UDEBUG -g -I vendor/ 10 | 11 | # uncomment to disable compiler optimizations 12 | # PKG_CXXFLAGS = -Wall -O0 -pedantic 13 | -------------------------------------------------------------------------------- /softwarex-article/benchcpp11armadillo/src/cpp11.cpp: -------------------------------------------------------------------------------- 1 | // Generated by cpp11: do not edit by hand 2 | // clang-format off 3 | 4 | 5 | #include "cpp11/declarations.hpp" 6 | #include 7 | 8 | // 01_bench.cpp 9 | doubles bench_eig_cpp11armadillo_(const doubles_matrix<>& m); 10 | extern "C" SEXP _benchcpp11armadillo_bench_eig_cpp11armadillo_(SEXP m) { 11 | BEGIN_CPP11 12 | return cpp11::as_sexp(bench_eig_cpp11armadillo_(cpp11::as_cpp&>>(m))); 13 | END_CPP11 14 | } 15 | // 01_bench.cpp 16 | double bench_multi_cpp11armadillo_(const doubles& p, const doubles& q, const doubles& r); 17 | extern "C" SEXP _benchcpp11armadillo_bench_multi_cpp11armadillo_(SEXP p, SEXP q, SEXP r) { 18 | BEGIN_CPP11 19 | return cpp11::as_sexp(bench_multi_cpp11armadillo_(cpp11::as_cpp>(p), cpp11::as_cpp>(q), cpp11::as_cpp>(r))); 20 | END_CPP11 21 | } 22 | 23 | extern "C" { 24 | static const R_CallMethodDef CallEntries[] = { 25 | {"_benchcpp11armadillo_bench_eig_cpp11armadillo_", (DL_FUNC) &_benchcpp11armadillo_bench_eig_cpp11armadillo_, 1}, 26 | {"_benchcpp11armadillo_bench_multi_cpp11armadillo_", (DL_FUNC) &_benchcpp11armadillo_bench_multi_cpp11armadillo_, 3}, 27 | {NULL, NULL, 0} 28 | }; 29 | } 30 | 31 | extern "C" attribute_visible void R_init_benchcpp11armadillo(DllInfo* dll){ 32 | R_registerRoutines(dll, NULL, CallEntries, NULL, NULL); 33 | R_useDynamicSymbols(dll, FALSE); 34 | R_forceSymbols(dll, TRUE); 35 | } 36 | -------------------------------------------------------------------------------- /softwarex-article/benchrcpparmadillo/.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | ^\.Renviron$ 4 | ^docs$ 5 | ^vignettes/images$ 6 | ^\.github$ 7 | ^\.vscode$ 8 | ^dev$ 9 | ^LICENSE\.md$ 10 | ^README$ 11 | ^README\.Rmd$ 12 | -------------------------------------------------------------------------------- /softwarex-article/benchrcpparmadillo/DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: benchrcpparmadillo 2 | Type: Package 3 | Title: ADD TITLE 4 | Version: 0.1 5 | Authors@R: c( 6 | person( 7 | given = "YOUR", 8 | family = "NAME", 9 | role = c("aut", "cre"), 10 | email = "YOUR@EMAIL.COM", 11 | comment = c(ORCID = "0000-0001-0002-0003")) 12 | ) 13 | Suggests: 14 | knitr, 15 | rmarkdown 16 | Depends: R(>= 3.5.0) 17 | Description: ADD DESCRIPTION. TWO OR MORE LINES 18 | License: ADD LICENSE 19 | BugReports: https://github.com/USERNAME/PKGNAME/issues 20 | URL: https://WEBSITE.COM 21 | RoxygenNote: 7.3.2 22 | Encoding: UTF-8 23 | NeedsCompilation: yes 24 | VignetteBuilder: knitr 25 | LinkingTo: Rcpp, RcppArmadillo 26 | -------------------------------------------------------------------------------- /softwarex-article/benchrcpparmadillo/NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | export(bench_eig_rcpparmadillo) 4 | export(bench_multi_rcpparmadillo) 5 | useDynLib(benchrcpparmadillo, .registration = TRUE) 6 | -------------------------------------------------------------------------------- /softwarex-article/benchrcpparmadillo/R/RcppExports.R: -------------------------------------------------------------------------------- 1 | # Generated by using Rcpp::compileAttributes() -> do not edit by hand 2 | # Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393 3 | 4 | bench_eig_rcpparmadillo_ <- function(m) { 5 | .Call(`_benchrcpparmadillo_bench_eig_rcpparmadillo_`, m) 6 | } 7 | 8 | bench_multi_rcpparmadillo_ <- function(p, q, r) { 9 | .Call(`_benchrcpparmadillo_bench_multi_rcpparmadillo_`, p, q, r) 10 | } 11 | 12 | -------------------------------------------------------------------------------- /softwarex-article/benchrcpparmadillo/R/benchrcpparmadillo-package.R: -------------------------------------------------------------------------------- 1 | #' @useDynLib benchrcpparmadillo, .registration = TRUE 2 | #' @keywords internal 3 | "_PACKAGE" 4 | 5 | #' @export 6 | bench_eig_rcpparmadillo <- function(m) { 7 | as.numeric(bench_eig_rcpparmadillo_(m)) 8 | } 9 | 10 | #' @export 11 | bench_multi_rcpparmadillo <- function(p,q,r) { 12 | bench_multi_rcpparmadillo_(p,q,r) 13 | } 14 | -------------------------------------------------------------------------------- /softwarex-article/benchrcpparmadillo/R/solvercpparmadillo-package.R: -------------------------------------------------------------------------------- 1 | #' @useDynLib benchrcpparmadillo, .registration = TRUE 2 | #' @keywords internal 3 | "_PACKAGE" 4 | 5 | #' @export 6 | bench_eig_rcpparmadillo <- function(m) { 7 | bench_eig_rcpparmadillo_(m) 8 | } 9 | 10 | #' @export 11 | bench_multi_rcpparmadillo <- function(p,q,r) { 12 | bench_multi_rcpparmadillo_(p,q,r) 13 | } 14 | -------------------------------------------------------------------------------- /softwarex-article/benchrcpparmadillo/man/benchrcpparmadillo-package.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/benchrcpparmadillo-package.R 3 | \docType{package} 4 | \name{benchrcpparmadillo-package} 5 | \alias{benchrcpparmadillo} 6 | \alias{benchrcpparmadillo-package} 7 | \title{benchrcpparmadillo: ADD TITLE} 8 | \description{ 9 | ADD DESCRIPTION. TWO OR MORE LINES 10 | } 11 | \seealso{ 12 | Useful links: 13 | \itemize{ 14 | \item \url{https://WEBSITE.COM} 15 | \item Report bugs at \url{https://github.com/USERNAME/PKGNAME/issues} 16 | } 17 | 18 | } 19 | \author{ 20 | \strong{Maintainer}: YOUR NAME \email{YOUR@EMAIL.COM} (\href{https://orcid.org/0000-0001-0002-0003}{ORCID}) 21 | 22 | } 23 | \keyword{internal} 24 | -------------------------------------------------------------------------------- /softwarex-article/benchrcpparmadillo/src/01_bench.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | using namespace Rcpp; 3 | using namespace arma; 4 | 5 | // [[Rcpp::export]] 6 | NumericVector bench_eig_rcpparmadillo_(const NumericMatrix& m) { 7 | mat M = as(m); 8 | colvec Y = eig_sym(M); 9 | return wrap(Y); 10 | } 11 | 12 | // [[Rcpp::export]] 13 | double bench_multi_rcpparmadillo_(const NumericVector& p, const NumericVector& q, 14 | const NumericVector& r) { 15 | colvec P = as(p); 16 | colvec Q = as(q); 17 | colvec R = as(r); 18 | return as_scalar(trans(P) * inv(diagmat(Q)) * R); 19 | } 20 | -------------------------------------------------------------------------------- /softwarex-article/benchrcpparmadillo/src/Makevars: -------------------------------------------------------------------------------- 1 | PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -DARMA_OPENMP_THREADS=40 2 | PKG_LIBS = -L$(MKLROOT)/lib/intel64_lin -lmkl_rt -lmkl_intel_lp64 -lmkl_gnu_thread -lmkl_core -lpthread -lm -ldl 3 | 4 | -------------------------------------------------------------------------------- /softwarex-article/benchrcpparmadillo/src/Makevars.win: -------------------------------------------------------------------------------- 1 | # DARMA_OPENMP_THREADS is a natural number between 1 and the number of cores 2 | PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -DARMA_OPENMP_THREADS=1 3 | PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) 4 | 5 | # Debugging 6 | 7 | # uncomment one of the following lines to enable debugging 8 | # PKG_CPPFLAGS = -UDEBUG -g 9 | # PKG_CPPFLAGS = -UDEBUG -g -I vendor/ 10 | 11 | # uncomment to disable compiler optimizations 12 | # PKG_CXXFLAGS = -Wall -O0 -pedantic 13 | -------------------------------------------------------------------------------- /softwarex-article/changes.odt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/softwarex-article/changes.odt -------------------------------------------------------------------------------- /softwarex-article/data/00-run-benchmark-eigenvalues-py.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH --job-name=pybenchmarkeigenvalues 3 | #SBATCH --output=/scratch/s/shirimb/msep/cpp11armadillopaper/paper/data/pybenchmark.txt 4 | #SBATCH --nodes=1 5 | #SBATCH --ntasks=40 6 | #SBATCH --time=12:00:00 7 | #SBATCH --account=def-shirimb 8 | 9 | # Load necessary modules 10 | module load gcc/8.3.0 11 | # module load python/3.9.8 12 | module load intelpython3 13 | 14 | export MKLROOT=/gpfs/fs1/scinet/intel/2019u4/compilers_and_libraries_2019.4.243/linux/mkl 15 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MKLROOT/lib/intel64_lin 16 | export OMP_NUM_THREADS=40 17 | export MKL_NUM_THREADS=40 18 | 19 | # Run the Python script 20 | python benchmark-eigenvalues.py 21 | -------------------------------------------------------------------------------- /softwarex-article/data/00-run-benchmark-multi-py.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH --job-name=pybenchmarkmulti 3 | #SBATCH --output=/scratch/s/shirimb/msep/cpp11armadillopaper/paper/data/pybenchmark.txt 4 | #SBATCH --nodes=1 5 | #SBATCH --ntasks=40 6 | #SBATCH --time=12:00:00 7 | #SBATCH --account=def-shirimb 8 | 9 | # Load necessary modules 10 | module load gcc/8.3.0 11 | # module load python/3.9.8 12 | module load intelpython3 13 | 14 | export MKLROOT=/gpfs/fs1/scinet/intel/2019u4/compilers_and_libraries_2019.4.243/linux/mkl 15 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MKLROOT/lib/intel64_lin 16 | export OMP_NUM_THREADS=40 17 | export MKL_NUM_THREADS=40 18 | 19 | # Run the Python script 20 | python benchmark-multi.py 21 | -------------------------------------------------------------------------------- /softwarex-article/data/00-run-benchmark-py.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH --job-name=cpp11armadillobenchmark 3 | #SBATCH --output=/scratch/s/shirimb/msep/cpp11armadillopaper/paper/data/cpp11armadillobenchmark-py.txt 4 | #SBATCH --nodes=1 5 | #SBATCH --ntasks=40 6 | #SBATCH --time=12:00:00 7 | #SBATCH --account=def-shirimb 8 | 9 | # Load necessary modules 10 | module load gcc/8.3.0 11 | # module load python/3.9.8 12 | module load intelpython3 13 | 14 | export MKLROOT=/gpfs/fs1/scinet/intel/2019u4/compilers_and_libraries_2019.4.243/linux/mkl 15 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MKLROOT/lib/intel64_lin 16 | export OMP_NUM_THREADS=40 17 | export MKL_NUM_THREADS=40 18 | 19 | # Run the Python script 20 | python benchmark.py 21 | -------------------------------------------------------------------------------- /softwarex-article/data/00-run-benchmark.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #SBATCH --job-name=cpp11armadillobenchmark 3 | #SBATCH --output=/scratch/s/shirimb/msep/cpp11armadillopaper/paper/data/cpp11armadillobenchmark.txt 4 | #SBATCH --nodes=1 5 | #SBATCH --ntasks=40 6 | #SBATCH --time=12:00:00 7 | #SBATCH --account=def-shirimb 8 | 9 | # Load necessary modules 10 | module load gcc/8.3.0 11 | module load r/4.2.2-batteries-included 12 | # module load fftw 13 | 14 | export MKLROOT=/gpfs/fs1/scinet/intel/2019u4/compilers_and_libraries_2019.4.243/linux/mkl 15 | export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MKLROOT/lib/intel64_lin 16 | export R_LIBS_USER=/scratch/s/shirimb/msep/cpp11armadillopaper/Rlib 17 | export OMP_NUM_THREADS=40 18 | export MKL_NUM_THREADS=40 19 | 20 | export R_LIBS_USER=/scratch/s/shirimb/msep/cpp11armadillopaper/Rlib 21 | 22 | # install.packages("devtools") 23 | # devtools::install("/scratch/s/shirimb/msep/cpp11armadillopaper/paper/benchcpp11armadillo/") 24 | # devtools::install("/scratch/s/shirimb/msep/cpp11armadillopaper/paper/benchrcpparmadillo/") 25 | 26 | # Run the R script 27 | Rscript benchmarks.r 28 | -------------------------------------------------------------------------------- /softwarex-article/data/README.txt: -------------------------------------------------------------------------------- 1 | run this: 2 | 3 | sbatch 00-run-benchmark.sh 4 | sbatch 00-run-benchmark-py.sh 5 | 6 | cancel with: 7 | 8 | squeue -u msep 9 | scancel -i 012345 10 | -------------------------------------------------------------------------------- /softwarex-article/data/benchmark-eig.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/softwarex-article/data/benchmark-eig.rds -------------------------------------------------------------------------------- /softwarex-article/data/benchmark-eigenvalues.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import timeit 3 | 4 | n = 10000 5 | 6 | # Eigenvalues 7 | 8 | np.random.seed(123) 9 | M = np.random.uniform(size=(n, n)) 10 | M = (M + M.T) / 2 11 | 12 | def bench_eigenvalues_py(M): 13 | return np.linalg.eigvals(M) 14 | 15 | def benchmark(): 16 | return bench_eigenvalues_py(M) 17 | 18 | execution_times = timeit.repeat("benchmark()", globals=globals(), repeat=100, number=1) 19 | 20 | min_time = np.min(execution_times) 21 | p25_time = np.percentile(execution_times, 25) 22 | median_time = np.median(execution_times) 23 | p75_time = np.percentile(execution_times, 75) 24 | max_time = np.max(execution_times) 25 | 26 | results = ( 27 | f"Min execution time: {min_time:.6f} seconds\n" 28 | f"25th percentile (p25) execution time: {p25_time:.6f} seconds\n" 29 | f"Median execution time: {median_time:.6f} seconds\n" 30 | f"75th percentile (p75) execution time: {p75_time:.6f} seconds\n" 31 | f"Max execution time: {max_time:.6f} seconds\n" 32 | ) 33 | 34 | with open("/scratch/s/shirimb/msep/cpp11armadillopaper/paper/data/benchmark-speed-eigenvalues-py.txt", "w") as file: 35 | file.write(results) 36 | 37 | del M 38 | -------------------------------------------------------------------------------- /softwarex-article/data/benchmark-multi.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import timeit 3 | 4 | n = 10000 5 | 6 | # Multi-operation 7 | 8 | np.random.seed(123) 9 | p = np.random.uniform(size=n) 10 | q = np.random.uniform(size=n) 11 | r = np.random.uniform(size=n) 12 | 13 | def bench_multi_py(p, q, r): 14 | return float(np.dot(np.dot(p.T, np.linalg.inv(np.diag(q))), r)) 15 | 16 | def benchmark(): 17 | return bench_multi_py(p, q, r) 18 | 19 | execution_times = timeit.repeat("benchmark()", globals=globals(), repeat=100, number=1) 20 | 21 | min_time = np.min(execution_times) 22 | p25_time = np.percentile(execution_times, 25) 23 | median_time = np.median(execution_times) 24 | p75_time = np.percentile(execution_times, 75) 25 | max_time = np.max(execution_times) 26 | 27 | results = ( 28 | f"Min execution time: {min_time:.6f} seconds\n" 29 | f"25th percentile (p25) execution time: {p25_time:.6f} seconds\n" 30 | f"Median execution time: {median_time:.6f} seconds\n" 31 | f"75th percentile (p75) execution time: {p75_time:.6f} seconds\n" 32 | f"Max execution time: {max_time:.6f} seconds\n" 33 | ) 34 | 35 | with open("/scratch/s/shirimb/msep/cpp11armadillopaper/paper/data/benchmark-speed-multi-py.txt", "w") as file: 36 | file.write(results) 37 | 38 | del p, q, r 39 | -------------------------------------------------------------------------------- /softwarex-article/data/benchmark-multi.rds: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pachadotdev/cpp11armadillo/f30950ec8ba4470c9b6f55357f7e2343304b0474/softwarex-article/data/benchmark-multi.rds -------------------------------------------------------------------------------- /softwarex-article/data/benchmark-speed-eigenvalues-py.txt: -------------------------------------------------------------------------------- 1 | Min execution time: 101.287768 seconds 2 | 25th percentile (p25) execution time: 107.181389 seconds 3 | Median execution time: 109.553534 seconds 4 | 75th percentile (p75) execution time: 119.057930 seconds 5 | Max execution time: 124.512550 seconds 6 | -------------------------------------------------------------------------------- /softwarex-article/data/benchmark-speed-multi-py.txt: -------------------------------------------------------------------------------- 1 | Min execution time: 2.369523 seconds 2 | 25th percentile (p25) execution time: 2.531388 seconds 3 | Median execution time: 2.603311 seconds 4 | 75th percentile (p75) execution time: 2.673085 seconds 5 | Max execution time: 3.417670 seconds 6 | -------------------------------------------------------------------------------- /softwarex-article/data/stackoverflow.csv: -------------------------------------------------------------------------------- 1 | Year,r_questions,total_questions,r_percentage 2 | "2008","8","166811","0.004795846796" 3 | "2009","520","976325","0.053260953063" 4 | "2010","2260","1962747","0.115144743566" 5 | "2011","5820","3439995","0.169186292421" 6 | "2012","12135","4732187","0.256435343742" 7 | "2013","22109","5969538","0.370363669684" 8 | "2014","30693","6347191","0.483568243022" 9 | "2015","40538","6549238","0.618972772099" 10 | "2016","44251","6540729","0.67654538202" 11 | "2017","50876","6286840","0.809245980492" 12 | "2018","51936","5557899","0.934453828685" 13 | "2019","49957","5108444","0.977929874537" 14 | "2020","59895","5639795","1.062006686413" 15 | "2021","51239","4654008","1.100965017679" 16 | "2022","46519","4088457","1.137813116293" 17 | "2023","28385","2605793","1.089303716757" 18 | "2024","12032","1407923","0.854592190055" -------------------------------------------------------------------------------- /softwarex-article/data/stackoverflow.sql: -------------------------------------------------------------------------------- 1 | SELECT 2 | YEAR(Posts.CreationDate) AS Year, 3 | COUNT(CASE WHEN Tags.TagName = 'r' THEN 1 END) AS r_questions, 4 | COUNT(*) AS total_questions, 5 | (COUNT(CASE WHEN Tags.TagName = 'r' THEN 1 END) * 100.0 / COUNT(*)) AS r_percentage 6 | FROM Posts 7 | JOIN PostTags ON Posts.Id = PostTags.PostId 8 | JOIN Tags ON PostTags.TagId = Tags.Id 9 | WHERE Posts.CreationDate BETWEEN DATEADD(YEAR, -20, GETDATE()) AND GETDATE() 10 | AND Posts.PostTypeId = 1 11 | GROUP BY YEAR(Posts.CreationDate) 12 | ORDER BY Year; 13 | -------------------------------------------------------------------------------- /softwarex-article/move_pdf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cp "$1" "/home/pacha/github/cpp11armadillo/inst/paper/cpp11armadillo.pdf" -------------------------------------------------------------------------------- /softwarex-article/response-to-reviewers-new.txt: -------------------------------------------------------------------------------- 1 | Dear Editor and Reviewers, 2 | 3 | I have addressed the following presentation changes: 4 | 5 | - you have your name listed twice on the title page. 6 | Why not list your affiliation on a single line? 7 | "Munk School of Global Affairs and Public Policy and Department of Electrical and Computer Engineering, University of Toronto, Toronto, Ontario, Canada" 8 | 9 | - put the citations in numerical order (e.g [1], [2], ..) as specified by our journal guidelines 10 | 11 | - the text beginning with "CHANGE .." on page 6 - is this correct? 12 | 13 | - there are things that need to be capitalized in the references 14 | (e.g, C++ 15 | 16 | - Burns ref ( r or R)? is there a better reference or link - it seems incomplete 17 | 18 | - 'R" Core - the trailing quote is reversed and also in the title 19 | 20 | - long dash with "2019" - something is missing and capitalize C++ 21 | 22 | - Vaugn - "c++" and "r's c" ? 23 | 24 | Each of these is highlighted as a Git diff in the PDF with the changes. 25 | 26 | -------------------------------------------------------------------------------- /softwarex-article/softwarex.csl: -------------------------------------------------------------------------------- 1 | 2 | 15 | -------------------------------------------------------------------------------- /tests/testthat.R: -------------------------------------------------------------------------------- 1 | # This file is part of the standard setup for testthat. 2 | # It is recommended that you do not modify it. 3 | # 4 | # Where should you do additional test configuration? 5 | # Learn more about the roles of various files in: 6 | # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview 7 | # * https://testthat.r-lib.org/articles/special-files.html 8 | 9 | library(testthat) 10 | library(cpp11armadillo) 11 | 12 | test_check("cpp11armadillo") 13 | -------------------------------------------------------------------------------- /tests/testthat/helper.R: -------------------------------------------------------------------------------- 1 | local_package <- function() { 2 | dir <- tempfile() 3 | if (!dir.exists(dir)) { 4 | dir.create(dir) 5 | } 6 | 7 | withr::defer(unlink(dir, recursive = TRUE), parent.frame()) 8 | 9 | writeLines("Package: testPkg", file.path(dir, "DESCRIPTION")) 10 | writeLines("useDynLib(testPkg, .registration = TRUE)", file.path(dir, "NAMESPACE")) 11 | desc::desc(dir) 12 | } 13 | 14 | pkg_path <- function(pkg) { 15 | dirname(pkg$.__enclos_env__$private$path) 16 | } 17 | -------------------------------------------------------------------------------- /tests/testthat/test-template.R: -------------------------------------------------------------------------------- 1 | test_that("pkg-template", { 2 | dir <- tempdir() 3 | if (!dir.exists(dir)) { 4 | dir.create(dir) 5 | } 6 | expect_silent(pkg_template(dir, "testname")) 7 | }) 8 | -------------------------------------------------------------------------------- /tests/testthat/test-vendor.R: -------------------------------------------------------------------------------- 1 | describe("cpp_vendor", { 2 | it("errors if cpp11armadillo is not installed", { 3 | pkg <- local_package() 4 | mockery::stub(cpp_vendor, "system.file", "") 5 | expect_error( 6 | cpp_vendor(pkg_path(pkg)), 7 | "cpp11 is not installed" 8 | ) 9 | }) 10 | 11 | it("errors if cpp11 is already vendored", { 12 | pkg <- local_package() 13 | cpp_vendor(pkg_path(pkg)) 14 | 15 | expect_error( 16 | cpp_vendor(pkg_path(pkg)), 17 | "already exists" 18 | ) 19 | }) 20 | 21 | it("vendors cpp11", { 22 | pkg <- local_package() 23 | p <- pkg_path(pkg) 24 | 25 | cpp_vendor(pkg_path(pkg)) 26 | 27 | expect_true(dir.exists(file.path(p, "inst", "include", "cpp11"))) 28 | expect_true(file.exists(file.path(p, "inst", "include", "cpp11.hpp"))) 29 | expect_true(file.exists(file.path(p, "inst", "include", "cpp11", "declarations.hpp"))) 30 | }) 31 | }) 32 | -------------------------------------------------------------------------------- /tests/testthat/test-version.R: -------------------------------------------------------------------------------- 1 | test_that("version name+number", { 2 | expect_equal(armadillo_version(), "Stochastic Parrot 14.2.2") 3 | }) 4 | -------------------------------------------------------------------------------- /vignettes/.gitignore: -------------------------------------------------------------------------------- 1 | *.html 2 | *.R 3 | --------------------------------------------------------------------------------