Skip to content

Commit

Permalink
fix #181
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherkenny committed Feb 1, 2024
1 parent dfd0509 commit 0b6fa4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# 4.3.0
* 4.2.0 introduced a regression in `redist_shortburst()` where the returned `redist_plans` object would store the wrong score for the '<init>' input. This is now fixed. This issue only impacted the returned object and the correct score was used during the shortburst process. (#180)
* 4.2.0 introduced some regressions in `redist_shortburst()`. The following issues are fixed:
* the returned `redist_plans` object would store the wrong score for the '<init>' input. This issue only impacted the returned object and the correct score was used during the shortburst process. (#180)
* the function would return immediately if `stop_at` was specified and `minimize = FALSE`. (#181)
* Improves SMC performance by preallocating memory for spanning trees.

# 4.2.0
Expand Down
3 changes: 2 additions & 1 deletion R/redist_shortburst.R
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ redist_shortburst <- function(map, score_fn = NULL, stop_at = NULL,
out_mat[, idx] <- cur_best[, out_idx]
scores[idx, ] <- cur_best_scores[, out_idx] * rescale

if (any(colSums(cur_best_scores >= stop_at) == dim_score)) {
if ((maximize && any(colSums(cur_best_scores >= stop_at) == dim_score)) ||
(!maximize && any(colSums(cur_best_scores <= stop_at) == dim_score))) {
converged = TRUE
break
}
Expand Down

0 comments on commit 0b6fa4d

Please sign in to comment.