feat: add C implementation for stats/base/dists/erlang/pdf#10554
feat: add C implementation for stats/base/dists/erlang/pdf#10554rautelaKamal wants to merge 1 commit intostdlib-js:developfrom
stats/base/dists/erlang/pdf#10554Conversation
Coverage Report
The above coverage report was generated for the changes in this PR. |
a9a7359 to
37e1576
Compare
|
@rautelaKamal |
There was a problem hiding this comment.
This file needs to mirror test/test.pdf.js. Currently missing:
- fixture-based tests against
./fixtures/julia/large_rate.json,large_shape.json,both_large.json - tests for
+infinity/-infinityforx - tests for the degenerate distribution when
k == 0 - missing imports (
abs,PINF,NINF,EPS) - missing
// FIXTURES //section
See test/test.pdf.js in this same package and @stdlib/stats/base/dists/erlang/mgf/test/test.native.js for the expected structure.
| "dependencies": { | ||
| "@stdlib/math/base/assert/is-nonnegative-integer": "^0.2.2", | ||
| "@stdlib/stats/base/dists/gamma/pdf": "^0.2.2" | ||
| }, |
There was a problem hiding this comment.
Don't manually populate dependencies. These are auto-generated. Should be:
| "dependencies": { | |
| "@stdlib/math/base/assert/is-nonnegative-integer": "^0.2.2", | |
| "@stdlib/stats/base/dists/gamma/pdf": "^0.2.2" | |
| }, | |
| "dependencies": {}, |
There was a problem hiding this comment.
Missing benchmark/c/ directory (benchmark.c and Makefile) and examples/c/ directory (example.c and Makefile). These are required when adding a C implementation. See, e.g., @stdlib/stats/base/dists/erlang/mgf for reference.
There was a problem hiding this comment.
The README.md needs a C APIs section documenting the C interface (usage, examples, function signature). See @stdlib/stats/base/dists/erlang/mgf/README.md for the expected structure.
There was a problem hiding this comment.
Thank you for the detailed feedback. I've addressed all the review comments: mirrored the fixture/infinity/degenerate k=0 tests into test.native.js, added benchmark/c/ and examples/c/ directories with Makefiles, and added the C APIs section to the README
stats/base/dists/erlang/pdf
318b207 to
69a1a9a
Compare
0a4edf9 to
c7e4246
Compare
Ref #3575.
Description
This pull request:
@stdlib/stats/base/dists/erlang/pdf, fulfilling the open RFC [RFC]: Add C implementation for@stdlib/stats/base/dists/erlang/pdf#3575.kis a non-negative integer usingstdlib_base_is_nonnegative_integer(k).stdlib_base_dists_gamma_pdfC function, since the Erlang distribution is mathematically a special case of the Gamma distribution.Related Issues
This pull request has the following related issues:
@stdlib/stats/base/dists/erlang/pdf#3575Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
I utilized an AI coding assistant to help scaffold the C implementations, N-API bindings, makefiles, and native benchmarks. The logic was reviewed and verified manually to ensure mathematical correctness and alignment with standard project practices.
@stdlib-js/reviewers