R/get_ode_model_size.R

Defines functions get_ode_model_size

Documented in get_ode_model_size

#' Get the number of states in the ODE from the code
#' code C++ code for model
#' @param code C++ code
#' @export
#' @return Number of states in the ODE model
get_ode_model_size <- function(code) {
  m <- gregexpr("\\[([0-9]*)\\]", code)
  m1 <- unlist(regmatches(code, m))
  tmp <- 0
  return(length(unique(m1)))
}
InsightRX/PKPDsim documentation built on April 25, 2024, 2:10 a.m.