parijat1222q opened a new pull request, #353: URL: https://github.com/apache/commons-math/pull/353
## Summary Fixes [MATH-1696](https://issues.apache.org/jira/browse/MATH-1696). `EnumeratedRealDistribution` allows unsorted values and duplicate masses, but its quantile method currently accumulates probabilities in input order. For values `[7, 3, -1, 3]` with equal weights, `inverseCumulativeProbability(0)` returns `7` instead of `-1`, and `inverseCumulativeProbability(1)` returns `3` instead of `7`. Sort the copied PMF only inside `inverseCumulativeProbability`. Stored input order and seeded sampling remain unchanged. No constructor, public API or sampling change. Three regression tests cover both constructors, duplicate masses, zero-weight outliers, support endpoints, and unchanged seeded sampling after a quantile query. The two unsorted-input tests fail against unchanged production code. Also reproduced on the published 3.3 jar. ## Validation Linux, JDK 17: - Fixed target class: 15 tests pass. - Complete split local test validation: 3,826 cases, zero final failures/errors, 33 existing skips. The repository's configured retry policy was unchanged; 48 cases were reported as flakes and passed on configured retries. - All module verification phases completed, with zero Checkstyle violations. Existing warning-only PMD and coverage diagnostics remain; no claim of 100% coverage. - Javadoc generation passes with UTF-8 locale. - `git diff --check` passes. The initial uninterrupted `mvn clean verify` exceeded the execution time limit. Tests and verification were completed in separate module/phase runs. The default legacy test execution completed, then the separate configured `flaky-tests` execution was rerun to completion using `mvn -f commons-math-legacy/pom.xml surefire:test@flaky-tests`. This is split validation, not a claim that one uninterrupted default build completed. No test, assertion, retry setting or check configuration was changed. AI disclosure: This PR description and the fix/tests were generated with AI assistance (Instinct) and checked with the validation above. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
