feat: add C implementation for stats/base/dists/f/pdf#10136
feat: add C implementation for stats/base/dists/f/pdf#10136nirmaljb wants to merge 2 commits intostdlib-js:developfrom
stats/base/dists/f/pdf#10136Conversation
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: passed
- task: lint_package_json
status: passed
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: passed
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: passed
- task: lint_javascript_benchmarks
status: passed
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: missing_dependencies
- task: lint_c_examples
status: missing_dependencies
- task: lint_c_benchmarks
status: missing_dependencies
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
Coverage Report
The above coverage report was generated for the changes in this PR. |
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown
status: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: na
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
| t.end(); | ||
| }); | ||
|
|
||
| tape( 'the function evaluates the pdf for `x` given large `d1` and `d2` (tested against the Boost C++ library', opts, function test( t ) { |
There was a problem hiding this comment.
Missing closing ) in the description string.
| tape( 'the function evaluates the pdf for `x` given large `d1` and `d2` (tested against the Boost C++ library', opts, function test( t ) { | |
| tape( 'the function evaluates the pdf for `x` given large `d1` and `d2` (tested against the Boost C++ library)', opts, function test( t ) { |
| * @returns evaluated PDF | ||
| * | ||
| * @example | ||
| * double y = pdf( 2.0, 0.5, 1.0 ); |
There was a problem hiding this comment.
The @example must use the full C name stdlib_base_dists_f_pdf, not the short alias. See stats/base/dists/beta/pdf/src/main.c:36.
| * double y = pdf( 2.0, 0.5, 1.0 ); | |
| * double y = stdlib_base_dists_f_pdf( 2.0, 0.5, 1.0 ); |
| * @param x - function parameter | ||
| * @param y - probability equal to `1-x` | ||
| * @param normalized - boolean indicating whether to evaluate the power terms of the regularized or non-regularized incomplete beta function | ||
| * @returns power terms |
There was a problem hiding this comment.
C sources use @param name description (no dash, aligned) and @return (no trailing s). Same issue at lines 231–234 and 250–253.
|
|
||
| b.tic(); | ||
| for ( i = 0; i < b.iterations; i++ ) { | ||
| y = pdf( x[ i % len ], d1[ i % len ], d2[ i % len ]); |
There was a problem hiding this comment.
Missing space before the closing ).
| y = pdf( x[ i % len ], d1[ i % len ], d2[ i % len ]); | |
| y = pdf( x[ i % len ], d1[ i % len ], d2[ i % len ] ); |
| double d1; | ||
| double d2; | ||
| double y; | ||
| int32_t i; |
There was a problem hiding this comment.
Use int i for the loop counter and drop the #include <stdint.h> at line 22. Every other example under stats/base/dists follows this pattern.
| double d1; | ||
| double d2; | ||
| double y; | ||
| int32_t i; |
There was a problem hiding this comment.
Same as example.c: use int i for the loop counter and remove the <stdint.h> include at line 214.
|
|
||
|
|
There was a problem hiding this comment.
Drop the double blank line between the description and the code block; should be a single blank line.
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes. report:
Resolves #3599
Description
This pull request:
Related Issues
This pull request has the following related issues:
@stdlib/stats/base/dists/f/pdf#3599Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
@stdlib-js/reviewers