Skip to content

Fix quantile boundaries and stale Rcpp exports - #29

Open
xjsun1221 wants to merge 2 commits into
RfastOfficial:masterfrom
xjsun1221:fix-quantile-and-exports
Open

Fix quantile boundaries and stale Rcpp exports#29
xjsun1221 wants to merge 2 commits into
RfastOfficial:masterfrom
xjsun1221:fix-quantile-and-exports

Conversation

@xjsun1221

Copy link
Copy Markdown

Problem

This PR addresses two correctness and maintenance issues:

  1. The sparse-probability path in Quantile() selects the wrong order
    statistic for interpolation. Both algorithm paths can also read one past
    the vector when probs contains 1.
  2. The package uses hand-written native wrappers and init.c registration,
    while 22 functions still carry Rcpp::export attributes. Running
    compileAttributes() creates alternate wrappers, including a generated
    benchmark(exprs, env, tim, indices) function that conflicts with the
    public benchmark(..., times, envir, order) API.

Change

  • Select the correct lower order statistic and guard exact/end-point
    quantiles in both algorithm paths.
  • Remove a redundant partial selection before the dense path's full sort.
  • Add regression coverage for unsorted probabilities, interpolation, and the
    0 and 1 boundaries.
  • Remove stale Rcpp export attributes while preserving the existing wrappers,
    native registration, and public R API.

Validation

  • Windows 11 x64
  • R 4.5.0
  • Rtools45 / GCC 14.2.0
  • Rcpp::compileAttributes() completes without generating wrapper files.
  • A clean source build, installation, and namespace load complete successfully.
  • Quantile regression tests match stats::quantile(type = 7) in both the
    sparse- and dense-probability paths, including both endpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant