Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the warning message in R Mac's cran test #285

Merged
merged 4 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/R-CMD-check-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
config:
- {os: ubuntu-latest, r: 'devel'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-18.04, r: 'devel'}
- {os: ubuntu-18.04, r: 'release'}
- {os: ubuntu-20.04, r: 'devel'}
- {os: ubuntu-20.04, r: 'release'}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
Expand Down
6 changes: 2 additions & 4 deletions R-proj/src/sample_points.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ Rcpp::NumericMatrix sample_points(Rcpp::Nullable<Rcpp::Reference> P,
random_walks walk;
ode_solvers solver; // Used only for logconcave sampling

NT eta;
NT eta = 1;
std::list<Point> randPoints;
std::pair<Point, NT> InnerBall;
Point mode(dim);
Expand Down Expand Up @@ -410,7 +410,7 @@ Rcpp::NumericMatrix sample_points(Rcpp::Nullable<Rcpp::Reference> P,
Rcpp::Function negative_logprob = Rcpp::as<Rcpp::List>(distribution)["negative_logprob"];
Rcpp::Function negative_logprob_gradient = Rcpp::as<Rcpp::List>(distribution)["negative_logprob_gradient"];

NT L_, m, eta;
NT L_, m;

if (Rcpp::as<Rcpp::List>(distribution).containsElementNamed("L_")) {
L_ = Rcpp::as<NT>(Rcpp::as<Rcpp::List>(distribution)["L_"]);
Expand Down Expand Up @@ -459,8 +459,6 @@ Rcpp::NumericMatrix sample_points(Rcpp::Nullable<Rcpp::Reference> P,

functor_defined = false;

NT eta;

if (Rcpp::as<Rcpp::List>(random_walk).containsElementNamed("step_size")) {
eta = NT(Rcpp::as<NT>(Rcpp::as<Rcpp::List>(random_walk)["step_size"]));
if (eta <= NT(0)) {
Expand Down
2 changes: 2 additions & 0 deletions cran_gen/genCRANpkg.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ dir_lp = paste0(path,"/lpSolveAPI/inst/include")
h_files = dir(dir_lp, "*.h", ignore.case = TRUE, all.files = TRUE)
lp_dist = paste0(path,"/external/LPsolve_src/include")
file.copy(file.path(dir_lp, h_files), lp_dist, recursive=TRUE, overwrite=TRUE)
# replace the lpsolve header file that issues a warning in mac's cran test
file.copy(paste0(path,"/external/cmake-files/lpsolve_modified_header_files/lp_rlp.h"), lp_dist, recursive=TRUE, overwrite=TRUE)
dir_lp = paste0(path,"/lpSolve/src")
h_files = dir(dir_lp, "*.h", ignore.case = TRUE, all.files = TRUE)
lp_dist = paste0(path,"/external/LPsolve_src/run_headers")
Expand Down
Loading
Loading