Skip to content

Commit

Permalink
remove live call to tmb and update namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
mkapur-noaa committed Dec 12, 2024
1 parent 756b119 commit fcd0dba
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ export(confint_Deriv)
export(get_Breaks)
export(refit_Growth)
import(mgcv)
useDynLib(growthbreaks)
4 changes: 2 additions & 2 deletions R/refit_Growth.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ refit_Growth <- function(dat = simulated_data, breakpoints, selex = FALSE, showP
# Now estimate everything
map <- NULL

TMB::compile(here::here("TMB","sptlVB_Sel_Sigma.cpp"))
dyn.load(TMB::dynlib(here::here("TMB","sptlVB_Sel_Sigma")))
# TMB::compile(here::here("TMB","sptlVB_Sel_Sigma.cpp"))
# dyn.load(TMB::dynlib(here::here("TMB","sptlVB_Sel_Sigma")))
model <- TMB::MakeADFun(data, parameters, DLL="sptlVB_Sel_Sigma",silent=T,map=map)
fit <- nlminb(
model$par,
Expand Down
1 change: 1 addition & 0 deletions TMB/sptlVB_Sel_Sigma.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#define TMB_LIB_INIT R_init_growthbreaks
// https://kaskr.github.io/adcomp/register_atomic_8cpp-example.html#a3
// Similar to example 'adaptive_integration' using CppAD Romberg integration. REGISTER_ATOMIC is used to reduce tape size.
#include <TMB.hpp>
Expand Down
Binary file modified TMB/sptlVB_Sel_Sigma.dll
Binary file not shown.
Binary file modified TMB/sptlVB_Sel_Sigma.o
Binary file not shown.

0 comments on commit fcd0dba

Please sign in to comment.