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
get_ode_model_size <- function(code) {
  m <- gregexpr("\\[([0-9]*)\\]", code)
  m1 <- unlist(regmatches(code, m))
  tmp <- 0
  return(length(unique(m1)))
}
ronkeizer/PKPDsim documentation built on May 27, 2019, 1:50 p.m.