feat: add C implementation for math/base/special/betainc#4037
feat: add C implementation for math/base/special/betainc#4037Neerajpathak07 wants to merge 1 commit intostdlib-js:developfrom
math/base/special/betainc#4037Conversation
|
This PR will need the C implementation for |
|
Hey @Neerajpathak07, was reviewing this since it depends on kernel-betainc which I've been following closely. Found a few things in src/main.c that might block compilation: Line 52 uses double out = [ 0.0, 0.0 ] which is JS syntax - in C this would need to be separate variable declarations like double out; double deriv; Lines 53-54 redeclare regularized and upper, which are already function parameters - compiler will error there. Line 55 calls stdlib_base_kernelBetainc but the actual C function in #10279 is stdlib_base_kernel_betainc (snake_case), and it expects pointer arguments (&out, &deriv) rather than array and stride. The header include on line 27 should be kernel_betainc.h instead of kernelbetainc.h. Also minor - the @returns JSDoc says "natural logarithm of beta function" but the function returns the incomplete beta value, worth updating to avoid confusion. Hope this helps move things forward! |
|
Hey @Neerajpathak07, was reviewing this since it depends on kernel-betainc which I have been following closely. Found a few things in src/main.c that might block compilation: Line 52 uses double out = [ 0.0, 0.0 ] which is JS syntax, in C this would need to be separate variable declarations like double out; double deriv; Lines 53-54 redeclare regularized and upper, which are already function parameters, compiler will error there. Line 55 calls stdlib_base_kernelBetainc but the actual C function in #10279 is stdlib_base_kernel_betainc (snake_case), and it expects pointer arguments (&out, &deriv) rather than array and stride. The header include on line 27 should be kernel_betainc.h instead of kernelbetainc.h. Also minor, the @returns JSDoc says "natural logarithm of beta function" but the function returns the incomplete beta value, worth updating to avoid confusion. Hope this helps move things forward! |
3 similar comments
|
Hey @Neerajpathak07, was reviewing this since it depends on kernel-betainc which I have been following closely. Found a few things in src/main.c that might block compilation: Line 52 uses double out = [ 0.0, 0.0 ] which is JS syntax, in C this would need to be separate variable declarations like double out; double deriv; Lines 53-54 redeclare regularized and upper, which are already function parameters, compiler will error there. Line 55 calls stdlib_base_kernelBetainc but the actual C function in #10279 is stdlib_base_kernel_betainc (snake_case), and it expects pointer arguments (&out, &deriv) rather than array and stride. The header include on line 27 should be kernel_betainc.h instead of kernelbetainc.h. Also minor, the @returns JSDoc says "natural logarithm of beta function" but the function returns the incomplete beta value, worth updating to avoid confusion. Hope this helps move things forward! |
|
Hey @Neerajpathak07, was reviewing this since it depends on kernel-betainc which I have been following closely. Found a few things in src/main.c that might block compilation: Line 52 uses double out = [ 0.0, 0.0 ] which is JS syntax, in C this would need to be separate variable declarations like double out; double deriv; Lines 53-54 redeclare regularized and upper, which are already function parameters, compiler will error there. Line 55 calls stdlib_base_kernelBetainc but the actual C function in #10279 is stdlib_base_kernel_betainc (snake_case), and it expects pointer arguments (&out, &deriv) rather than array and stride. The header include on line 27 should be kernel_betainc.h instead of kernelbetainc.h. Also minor, the @returns JSDoc says "natural logarithm of beta function" but the function returns the incomplete beta value, worth updating to avoid confusion. Hope this helps move things forward! |
|
Hey @Neerajpathak07, was reviewing this since it depends on kernel-betainc which I have been following closely. Found a few things in src/main.c that might block compilation: Line 52 uses double out = [ 0.0, 0.0 ] which is JS syntax, in C this would need to be separate variable declarations like double out; double deriv; Lines 53-54 redeclare regularized and upper, which are already function parameters, compiler will error there. Line 55 calls stdlib_base_kernelBetainc but the actual C function in #10279 is stdlib_base_kernel_betainc (snake_case), and it expects pointer arguments (&out, &deriv) rather than array and stride. The header include on line 27 should be kernel_betainc.h instead of kernelbetainc.h. Also minor, the @returns JSDoc says "natural logarithm of beta function" but the function returns the incomplete beta value, worth updating to avoid confusion. Hope this helps move things forward! |
|
An automated check found a potentially unrelated issue/PR reference in this PR:
Why this matters: GitHub automatically closes issues referenced with closing keywords (Resolves, Closes, Fixes) when the PR is merged. If What to do:
This assessment was generated by an AI model and is informational only.
|

Progresses #649
Resolves #3423
Description
This pull request:
math/base/special/betaincRelated Issues
This pull request:
progresses [RFC]: Add C implementations to base special math functions (tracking issue) #649
resolves [RFC]: Add C implementation for
@stdlib/stats/base/dists/beta/cdf#3423Questions
No.
Other
No.
Checklist
@stdlib-js/reviewers