Repository navigation
Conversation
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.
On master, with custom bases:
The constructor clones
baseswithout looking at the values, andget()decomposes the index withwhile (index > 0) { ...; index /= base[i]; }. A base of 1 never reduces the index, so every point after the first spins forever. A base of 0 divides by zero on the second point instead of failing at construction, and a negative base gives coordinates outside the documented [0, 1] interval. No base below 2 is meaningful for a Halton sequence, so the constructor now rejects it withNumberIsTooSmallException, after the existing argument checks.The dimension check in the same constructor reported
PRIMES.lengthas the upper bound, although the javadoc documents[1, len]with len the length ofbases. It now reportsbases.length.HaltonSequenceGeneratorTestgainstestConstructorInvalidBaseand an upper-bound assertion intestConstructor2; both fail on master and pass with the patch.mvn clean install apache-rat:check checkstyle:check spotbugs:check javadoc:javadoc -pl commons-math-legacy -amis green on JDK 21 (3265 tests in legacy; the only reruns are the randomised SimplexOptimizerTest cases).