Repository navigation
cap probabilities with a scalar in kernel_wPB_fast - #1
Open
kevinushey wants to merge 1 commit into
Open
kevinushey wants to merge 1 commit into
kevinushey wants to merge 1 commit into
Conversation
This was referenced Oct 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
The next Rcpp release (see RcppCore/Rcpp#1513) checks that the operands of a sugar expression, and a vector assigned into a matrix row, column or
Rangesubset, have matching lengths. Previously a longer operand was silently truncated to the length of the left-hand side or target. With that check, FDX fails its CRAN checks with:In
kernel_wPB_fast(),probshasnumWeights[i]elements (which is less thannumTestsfori > 0), but it is capped withpmin(probs, NumericVector(numTests, 1.0)), a vector of lengthnumTests. Old Rcpp read only the firstnumWeights[i]ones, so results were correct.Change
Cap with the scalar form
pmin(probs, 1.0), which does the same thing for any length.Testing
R CMD checkon the patched package passes against both the current Rcpp branch and released Rcpp 1.1.2.