https://github.com/pachadotdev/cpp11blaze
VERY EARLY DEVELOPMENT!!! The idea is to pass matrices/vectors from R to C++, write pure C++/Blaze code for the computation, and then export the result back to R with the proper data structures.
https://github.com/pachadotdev/cpp11blaze
blaze cpp cpp11 hacktoberfest linear-algebra rstats
Last synced: 12 months ago
JSON representation
VERY EARLY DEVELOPMENT!!! The idea is to pass matrices/vectors from R to C++, write pure C++/Blaze code for the computation, and then export the result back to R with the proper data structures.
- Host: GitHub
- URL: https://github.com/pachadotdev/cpp11blaze
- Owner: pachadotdev
- License: apache-2.0
- Created: 2024-09-04T02:07:17.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-10T03:39:24.000Z (over 1 year ago)
- Last Synced: 2025-04-05T08:13:38.610Z (about 1 year ago)
- Topics: blaze, cpp, cpp11, hacktoberfest, linear-algebra, rstats
- Language: C++
- Homepage:
- Size: 7.44 MB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE.md
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Support: .github/SUPPORT.md
Awesome Lists containing this project
README
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# cpp11blaze 
[](https://github.com/pachadotdev/cpp11blaze/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/pachadotdev/cpp11blaze)
[](https://buymeacoffee.com/pacha)
[](https://CRAN.R-project.org/package=cpp11blaze)
VERY EARLY STAGE PACKAGE!!!
The goal of cpp11blaze is to provide a novel approach to use the [Blaze
C++ library](https://bitbucket.org/blaze-lib/blaze/src/master/) by using the
header-only cpp11 R package and to simplify things for the end-user.
The idea is to pass matrices/vectors from R to C++, write pure C++/Blaze
code for the computation, and then export the result back to R with the proper
data structures.
This follows from the same goals as cpp11:
* Enforcing copy-on-write semantics.
* Improving the safety of using the R API from C++ code.
* Using UTF-8 strings everywhere.
* Applying newer C++11 features.
* Having a more straightforward, simpler implementation.
* Faster compilation time with lower memory requirements.
* Growing vectors more efficiently.
If this software is useful to you, please consider donating on
[Buy Me A Coffee](https://buymeacoffee.com/pacha). All donations will
be used to continue improving `cpp11blaze`.
## Installation
You can install the development version of cpp11blaze from GitHub:
``` r
remotes::install_github("pachadotdev/cpp11blaze")
```
## Examples
I have provided a package template for RStudio that also works with VS Code.
The idea of this package is to be naive and simple (like me).
From RStudio/VSCode create a new project and run:
```r
cpp11blaze::pkg_template()
```
Then follow the instructions from the README.
The vignettes contains detailed examples that I use to test `cpp11blaze`,
these include Ordinary Least Squares.
# Linear Algebra Libraries
Blaze supports OpenBLAS, Intel MKL, and the Accelerate framework (Mac). You
can install OpenBLAS on Debian-based systems with:
```sh
sudo apt-get install libopenblas-dev
```
You can also use other commands for your specific operating system.
To verify that R is using OpenBLAS, you can run `sessionInfo()` after restarting
R to check the BLAS/LAPACK libraries in use:
```r
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so; LAPACK version 3.10.0
```