Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelVias committed Sep 5, 2024
1 parent e527454 commit c888db2
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 55 deletions.
Binary file modified .DS_Store
Binary file not shown.
Binary file added .github/.DS_Store
Binary file not shown.
21 changes: 16 additions & 5 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ name: R-CMD-check
jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -44,14 +42,27 @@ jobs:
extra-packages: any::rcmdcheck
needs: check

- name: Regenerate Rcpp exports
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libarmadillo-dev
- name: Install RcppArmadillo
run: |
install.packages("RcppArmadillo")
shell: Rscript {0}

- name: Check C++ compilation
run: |
Rscript -e "Rcpp::compileAttributes()"
Rscript -e "devtools::document()"
Rcpp::compileAttributes()
devtools::document()
shell: Rscript {0}

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
args: 'c("--no-build-vignettes", "--no-manual")'

- name: Show testthat output
if: always()
Expand Down
9 changes: 5 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ Maintainer: Rafael Daníel Vias <[email protected]>
Description: Fits a discharge rating curve based on the power-law and the generalized power-law from data on paired stage and discharge measurements in a given river using a Bayesian hierarchical model as described in Hrafnkelsson et al. (2020) <arXiv:2010.04769>.
Depends: R (>= 3.5.0)
License: MIT + file LICENSE
LazyData: true
RoxygenNote: 7.3.2
Imports:
ggplot2,
grid,
gridExtra,
Rcpp,
Rcpp (>= 0.11.0),
rlang,
scales
Suggests:
Expand All @@ -30,5 +29,7 @@ URL: https://sor16.github.io/bdrc
BugReports: https://github.com/sor16/bdrc/issues
Encoding: UTF-8
LinkingTo:
Rcpp,
RcppArmadillo
Rcpp (>= 0.11.0),
RcppArmadillo (>= 0.2.35)
LazyData: yes
ByteCompile: TRUE
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export(plm)
export(plm0)
export(spread_draws)
export(tournament)
importFrom(Rcpp,sourceCpp)
exportPattern("^[[:alpha:]]+")
importFrom(ggplot2,"%+replace%")
importFrom(ggplot2,aes)
importFrom(ggplot2,autoplot)
Expand Down
1 change: 0 additions & 1 deletion R/bdrc-package.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
## usethis namespace: start
#' @importFrom Rcpp sourceCpp
#' @useDynLib bdrc, .registration = TRUE
## usethis namespace: end
NULL
5 changes: 2 additions & 3 deletions src/Makevars
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
CXX_STD = CXX11
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) $(SHLIB_OPENMP_CXXFLAGS)
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -DR_NO_REMAP
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
4 changes: 1 addition & 3 deletions src/Makevars.win
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
CXX_STD = CXX11
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) -DR_NO_REMAP
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
USE_CXX14 = yes
3 changes: 2 additions & 1 deletion src/cppFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
#define CPP_FUNCTIONS_H

#define _USE_MATH_DEFINES
#include <cmath>

#include <RcppArmadillo.h>
#include <cmath>

// Help function declarations
arma::mat matMult(const arma::mat& A, const arma::mat& B);
Expand Down
8 changes: 1 addition & 7 deletions src/gplm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@

#include "cppFunctions.h"

// [[Rcpp::depends(RcppArmadillo)]]
#include <RcppArmadillo.h>

#define _USE_MATH_DEFINES
#include <cmath>

using namespace Rcpp;
using namespace arma;




Expand Down
8 changes: 1 addition & 7 deletions src/gplm0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@

#include "cppFunctions.h"

// [[Rcpp::depends(RcppArmadillo)]]
#include <RcppArmadillo.h>

#define _USE_MATH_DEFINES
#include <cmath>

using namespace Rcpp;
using namespace arma;




Expand Down
12 changes: 3 additions & 9 deletions src/help_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@

#include "cppFunctions.h"

// [[Rcpp::depends(RcppArmadillo)]]
#include <RcppArmadillo.h>

#define _USE_MATH_DEFINES
#include <cmath>

using namespace Rcpp;
using namespace arma;



// [[Rcpp::export]]
Expand Down Expand Up @@ -59,9 +53,9 @@ arma::vec compute_w(const arma::mat& L, const arma::vec& y, const arma::mat& X,
// [[Rcpp::export]]
DataFrame get_MCMC_summary_cpp(const arma::mat& X, const Nullable<NumericVector>& h ) {
int n = X.n_rows;
mat summary_dat(n, 3);
arma::mat summary_dat(n, 3);
for(int i = 0; i < n; ++i) {
rowvec row = X.row(i);
arma::rowvec row = X.row(i);
row = sort(row);
int size = row.n_elem;
summary_dat(i, 0) = row(std::floor(0.025 * (size - 1)));
Expand Down
8 changes: 1 addition & 7 deletions src/plm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@

#include "cppFunctions.h"

// [[Rcpp::depends(RcppArmadillo)]]
#include <RcppArmadillo.h>

#define _USE_MATH_DEFINES
#include <cmath>

using namespace Rcpp;
using namespace arma;




Expand Down
8 changes: 1 addition & 7 deletions src/plm0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,8 @@

#include "cppFunctions.h"

// [[Rcpp::depends(RcppArmadillo)]]
#include <RcppArmadillo.h>

#define _USE_MATH_DEFINES
#include <cmath>

using namespace Rcpp;
using namespace arma;




Expand Down

0 comments on commit c888db2

Please sign in to comment.