Skip to content

Commit

Permalink
Merge pull request #154 from rsetienne/develop
Browse files Browse the repository at this point in the history
DAISIE 4.3.2
  • Loading branch information
rsetienne authored Feb 25, 2023
2 parents 7d62c63 + b5e0c3e commit 2d1c832
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:

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

if: "contains(github.event.head_commit.message, '[run ci]') || (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')"
if: "contains(github.event.head_commit.message, '[run ci]') || (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') || github.event.pull_request"

strategy:
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ name: test-coverage
jobs:
test-coverage:
runs-on: ubuntu-latest
if: "contains(github.event.head_commit.message, '[run ci]') || (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop')"
if: "contains(github.event.head_commit.message, '[run ci]') || (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/develop') || github.event.pull_request"

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
Package: DAISIE
Type: Package
Title: Dynamical Assembly of Islands by Speciation, Immigration and Extinction
Version: 4.3.1
Date: 2023-02-10
Version: 4.3.2
Date: 2023-02-24
Depends: R (>= 4.1.0)
biocViews:
SystemRequirements: C++17
Imports:
deSolve,
graphics,
Expand Down Expand Up @@ -112,6 +111,7 @@ Description: Simulates and computes the (maximum) likelihood of a dynamical
extinction. See e.g. Valente et al. 2015. Ecology Letters 18: 844-852,
<DOI:10.1111/ele.12461>.
NeedsCompilation: yes
SystemRequirements: C++14
Encoding: UTF-8
VignetteBuilder: knitr
URL: https://github.com/rsetienne/DAISIE
Expand Down
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export(create_pars)
export(create_trait_pars)
export(create_trait_pars_2K)
export(daisie_odeint_cs)
export(daisie_odeint_iw)
import(Rcpp)
importFrom(doParallel,registerDoParallel)
importFrom(foreach,"%dopar%")
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# DAISIE 4.3.2

* Apply CRAN suggested fixes to clang16 issues with deprecated C++ functions included the Boost library, which are used in some of the stepper functions.
* Add config.h in a macro, checking for, and setting, `_HAS_AUTO_PTR_ETC` and `BOOST_NO_AUTO_PTR`.
* Change SystemRequirements in DESCRIPTION from C++17 to C++14.
This same fix was applied in package `'DDD'` version 5.2.1.

# DAISIE 4.3.1

* Fix issue that prevented 'covr' from running correctly.
Expand Down
3 changes: 0 additions & 3 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ NULL
#' @name daisie_odeint_cs
NULL

#' @export daisie_odeint_iw
NULL

#' Driver for the boost::odeint solver
#'
#' @name daisie_odeint_iw
Expand Down
4 changes: 2 additions & 2 deletions src/DAISIE_CS.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// [[Rcpp::plugins(cpp17)]]
// [[Rcpp::plugins(cpp14)]]
// [[Rcpp::depends(BH)]]


//' @export daisie_odeint_cs


#include "config.h"
#include "DAISIE_odeint.h"

using namespace daisie_odeint::jacobian_policy;
Expand Down
5 changes: 2 additions & 3 deletions src/DAISIE_IW.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//' @export daisie_odeint_iw

// [[Rcpp::plugins(cpp17)]]
// [[Rcpp::plugins(cpp14)]]
// [[Rcpp::plugins(openmp)]]
// [[Rcpp::depends(RcppEigen)]]

#include "config.h"
#include "DAISIE_odeint.h"
#define EIGEN_USE_THREADS
#include <RcppEigen.h>
Expand Down
9 changes: 6 additions & 3 deletions src/DAISIE_odeint.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
// [[Rcpp::plugins(cpp14)]]

#pragma once
#ifndef DAISIE_ODEINT_H_INCLUDED
#define DAISIE_ODEINT_H_INCLUDED


#include "config.h"
#include "ublas_types.h"
#include <boost/numeric/odeint.hpp>
#include <algorithm>
#include <stdexcept>
#include <memory>


using namespace Rcpp;
Expand Down Expand Up @@ -44,7 +47,7 @@ namespace daisie_odeint {

extern double abm_factor;


template <typename Stepper, typename Rhs>
inline void do_integrate(double atol, double rtol, Rhs rhs, state_type& y, double t0, double t1)
{
Expand Down Expand Up @@ -72,7 +75,7 @@ namespace daisie_odeint {

namespace jacobian_policy {

// Evaluator of the Jacobian for linear, time independent systems
// Evaluator of the Jacobian for linear, time independent systems
// dxdt = Ax => Jacobian = t(A)
template <typename RHS>
struct const_from_linear_rhs
Expand Down
1 change: 1 addition & 0 deletions src/DAISIE_types.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#pragma once
#include "config.h"
#include "odeint_types.h"
3 changes: 3 additions & 0 deletions src/R_init_DAISIE.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// [[Rcpp::plugins(cpp14)]]

#include"config.h"
#include <R.h>
#include <Rinternals.h>
#include <stdlib.h> // for NULL
Expand Down
22 changes: 22 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#ifndef ODEINT_CONFIG_H_INCLUDED
#define ODEINT_CONFIG_H_INCLUDED

// [[Rcpp::plugins(cpp14)]]

// Special case to make use of some steppers that would include
// boost/functional.hpp
#if __cplusplus >= 201703L
#ifdef _HAS_AUTO_PTR_ETC
#undef _HAS_AUTO_PTR_ETC
#endif
#define _HAS_AUTO_PTR_ETC 0
#endif

// Special case to make use of some steppers that would include
// boost/get_pointer.hpp
#ifdef BOOST_NO_AUTO_PTR
#undef BOOST_NO_AUTO_PTR
#endif
#define BOOST_NO_AUTO_PTR

#endif
3 changes: 3 additions & 0 deletions src/ublas_types.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
// [[Rcpp::plugins(cpp14)]]

#pragma once
#ifndef UBLAS_TYPES_H_INCLUDED
#define UBLAS_TYPES_H_INCLUDED

#include "config.h"
#include <RcppCommon.h>
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/matrix.hpp>
Expand Down

0 comments on commit 2d1c832

Please sign in to comment.