Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions packages/nimble/R/BUGS_modelDef.R
Original file line number Diff line number Diff line change
Expand Up @@ -1540,6 +1540,13 @@ makeVertexNamesFromIndexArray2 <- function(indArr, minInd = 1, varName) {
## In the second, elements give the column index, e.g. [1 2 3; 1 2 3; 1 2 3]
## etc.
arrayWithIndices <- vector('list', length = nDim)
if(is.null(dims))
stop("Something is inconsistent in the use of `", varName, "` in the model.\n",
"Check for conflicting declarations.\n",
"If your model has macros or if-then-else blocks\n",
"you can inspect the processed model code by calling\n",
"`nimbleOptions(stop_after_processing_model_code = TRUE)`\n",
"before calling nimbleModel.\n", call. = FALSE)
arrayWithIndices[[1]] <- array( rep(1:dims[1], prod(dims[-1])), dims)
## We could reduce memory footprint by doing all steps on each dimension before building arrayWithIndices for new dimension
if(nDim > 1) {
Expand Down Expand Up @@ -2484,8 +2491,8 @@ modelDefClass$methods(genExpandedNodeAndParentNames3 = function(debug = FALSE) {
stop(paste0("Something is inconsistent in the model.\n",
"Check for conflicting declarations.\n",
"If your model has macros or if-then-else blocks\n",
"you can inspect the processed model code by doing\n",
"nimbleOptions(stop_after_processing_model_code = TRUE)\n",
"you can inspect the processed model code by calling\n",
"`nimbleOptions(stop_after_processing_model_code = TRUE)`\n",
"before calling nimbleModel.\n"
),
call. = FALSE)
Expand Down
Loading