Skip to content

Commit 4aa14a9

Browse files
committed
fix Makevars for abort .so warning from devtools::check()
1 parent bea911d commit 4aa14a9

File tree

5 files changed

+10
-18
lines changed

5 files changed

+10
-18
lines changed

R/plots.r

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ show_multivariate_hawkes <- function(obj, type = c("fitted", "data", "both")){
113113
lam = unlist(lam.p),
114114
stream = rep(names(table(stream)), each = length(p)))
115115

116-
line <- ggplot2::ggplot(dat, ggplot2::aes(x = x, y = lam, col = stream, group = stream)) +
116+
line <- ggplot2::ggplot(dat, ggplot2::aes(x = .data$x, y = .data$lam, col = .data$stream, group = .data$stream)) +
117117
ggplot2::geom_line() +
118118
ggplot2::xlab("") +
119119
ggplot2::ylab(expression(lambda(t))) + ggplot2::theme_minimal()

src/Makevars

+3-12
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
CXX_STD = CXX17
2-
3-
PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS)
4-
PKG_CPPFLAGS = -I../inst/include -I../inst/include/boost
5-
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)
6-
7-
ifeq ($(OS),Windows_NT)
8-
PKG_LIBS += -lgfortran
9-
endif
10-
11-
# Add additional compiler flags here
12-
PKG_CXXFLAGS += -DTMB_SAFEBOUNDS -DTMB_EIGEN_DISABLE_WARNINGS
1+
PKG_CPPFLAGS = -DTMBAD_FRAMEWORK
2+
PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS)
3+
PKG_CXXFLAGS=$(SHLIB_OPENMP_CXXFLAGS)

src/spatial_hawkes.h

-2
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,6 @@ Type spatial_hawkes(objective_function<Type>* obj) {
175175
vector<Type> A(times.size());
176176
A.setZero();
177177
if (simple == 0) {
178-
// std::cout << "[SIMULATE] SIMPLE == 0" << std::endl;
179178
for (int j = 1; j < times.size(); ++j)
180179
for (int i = 0; i < j; ++i){
181180
Q2 = Qbase * (times[j] - times[i]);
@@ -222,7 +221,6 @@ Type spatial_hawkes(objective_function<Type>* obj) {
222221
// Only for constant background without covariates
223222
// This simulation process follows Algorithm 4 in Section 3.3 of Reinhart (2018).
224223
DATA_IMATRIX(tv);
225-
// std::cout << "[SIMULATE] tv dimensions: " << tv.rows() << " x " << tv.cols() << std::endl;
226224
/*
227225
Need the triangulation to check whether points generated are in the area of interest.
228226

src/spde_hawkes.h

-3
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,6 @@ Type spde_hawkes(objective_function<Type>* obj) {
261261
loci = rpoisplane_sp(xyloc, tv, x, w);
262262
locs.row(0) = loci;
263263
// Step 10 for the first time.
264-
// std::cout<<times[i]<<" "<<locs(i, 0)<<" "<<locs(i, 1)<<" "<<gammac<<std::endl;
265264
i++;
266265
// Repeat from Step 3
267266
while (i < times.size()){
@@ -293,7 +292,6 @@ Type spde_hawkes(objective_function<Type>* obj) {
293292
if (pointinSP_sp(loci, xyloc, tv)){
294293
// Step 10
295294
locs.row(i) = loci;
296-
// std::cout<<times[i]<<" "<<locs(i, 0)<<" "<<locs(i, 1)<<" "<<gammac<<std::endl;
297295
i++;
298296
}
299297
break;
@@ -305,7 +303,6 @@ Type spde_hawkes(objective_function<Type>* obj) {
305303
loci = rpoisplane_sp(xyloc, tv, x, w);
306304
locs.row(i) = loci;
307305
// Step 10.
308-
// std::cout<<times[i]<<" "<<locs(i, 0)<<" "<<locs(i, 1)<<" "<<gammac<<std::endl;
309306
i++;
310307
}
311308
gammac = D + sum(lambdaXsasep);

src/stelfi.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,9 @@ Type objective_function<Type>::operator() ()
5252
}
5353

5454

55+
// RegisteringDynamic Symbols
56+
57+
void R_init_stelfi(DllInfo* info) {
58+
R_registerRoutines(info, NULL, NULL, NULL, NULL);
59+
R_useDynamicSymbols(info, TRUE);
60+
}

0 commit comments

Comments
 (0)