Skip to content

Commit

Permalink
feat(ParameterVector): Allows for time-varying p
Browse files Browse the repository at this point in the history
* ParameterVector is established
* Logging
* model output with json
* C++ 17
* rebased to dev

Edits by @msupernaw
  • Loading branch information
kellijohnson-NOAA committed Sep 26, 2024
1 parent d8d284a commit 24fb9df
Show file tree
Hide file tree
Showing 37 changed files with 2,754 additions and 464 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ project(FIMS
) # CXX is the language name

# GoogleTest requires at least C++11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

include(FetchContent)

Expand Down
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
export(AgeComp)
export(BevertonHoltRecruitment)
export(CreateTMBModel)
export(SetFIMSFunctions)
export(Finalize)
export(DoubleLogisticSelectivity)
export(EWAAgrowth)
export(FIMSFrame)
Expand All @@ -16,7 +18,9 @@ export(Population)
export(TMBDlnormDistribution)
export(TMBDmultinomDistribution)
export(TMBDnormDistribution)
export(ToJSON)
export(clear)
export(get_log)
export(clear_logs)
export(get_fixed)
export(get_random)
Expand Down
12 changes: 6 additions & 6 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ Rcpp::loadModule(module = "fims", what = TRUE)
library.dynam.unload("FIMS", libpath)
}

setMethod("[<-", signature(x = "Rcpp_ParameterVector", i = "numeric"),
function(x, i) {
(x$at(i))
return(x)
})

setMethod("[<-", signature(x = "Rcpp_ParameterVector"), function(x, i, j, value) {
x$set(i - 1, value) # R uses 1-based indexing, C++ uses 0-based indexing
x # Return the modified object
})

setMethod("[", signature(x = "Rcpp_ParameterVector", i = "numeric"),
function(x, i) {
return(x$at(i))
return(x$get(i-1))
})

# setMethod("lapply", signature(X = "Rcpp_ParameterVector", FUN = "sum"),
Expand Down
Loading

0 comments on commit 24fb9df

Please sign in to comment.