statrs-dev / statrs

Statistical computation library for Rust
https://docs.rs/statrs/latest/statrs/
MIT License
599 stars 84 forks source link

refactor: rewrite Dirichlet::ln_pdf #298

Closed FreezyLemon closed 2 months ago

FreezyLemon commented 2 months ago

The new code should be easier to read and avoids looping through x twice.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.03%. Comparing base (a514992) to head (1a6840a). Report is 4 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #298 +/- ## ========================================== - Coverage 94.03% 94.03% -0.01% ========================================== Files 53 53 Lines 12055 12047 -8 ========================================== - Hits 11336 11328 -8 Misses 719 719 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

YeungOnion commented 2 months ago

Initially, I thought it made sense to fail before computing any gamma functions, but the failure is panicking, so this seems suitable. Will merge.