Skip to content

Commit

Permalink
Added iter limit to prevent infinite loop (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
wleoncio committed Aug 9, 2023
1 parent b034158 commit 3ab0a73
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions R/indMix.R
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,13 @@ indMix <- function(c, npops, counts = NULL, sumcounts = NULL, max_iter = 100L, d
)
}

iter <- 1L
while (ready != 1) {
iter <- iter + 1L
if (iter > max_iter) {
warning("max_iter reached. Stopping.")
break
}
# FIXME: loop caught in here
muutoksia <- 0

Expand Down

0 comments on commit 3ab0a73

Please sign in to comment.