diff --git a/CHANGELOG.md b/CHANGELOG.md index e026c8221..f2b02b5bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@
-## Unreleased (2024-08-11) +## Unreleased (2024-08-12)
@@ -1909,12 +1909,25 @@ This release closes the following issue: ##### Features +- [`0ae49fb`](https://github.com/stdlib-js/stdlib/commit/0ae49fba6e79599a4b8b1be464a7570a3c7f6d83) - fix function name and update docs [(#2777)](https://github.com/stdlib-js/stdlib/pull/2777) - [`18bd1b5`](https://github.com/stdlib-js/stdlib/commit/18bd1b5ace1a7dbd9d26bb66c1a1f0aa91573416) - add C implementation for `math/base/special/besselj1`
+
+ +##### BREAKING CHANGES + +- [`0ae49fb`](https://github.com/stdlib-js/stdlib/commit/0ae49fba6e79599a4b8b1be464a7570a3c7f6d83): update C API name + + - This commit changes the name of the C API from `stdlib_base_j1` to `stdlib_base_besselj1`. This ensures that the C function name more closely matches the global namespace name and helps protect against future naming collisions. To migrate, users should update their call signatures accordingly. + +
+ + +
@@ -5829,6 +5842,10 @@ This release closes the following issue: ### BREAKING CHANGES +- [`0ae49fb`](https://github.com/stdlib-js/stdlib/commit/0ae49fba6e79599a4b8b1be464a7570a3c7f6d83): update C API name + + - This commit changes the name of the C API from `stdlib_base_j1` to `stdlib_base_besselj1`. This ensures that the C function name more closely matches the global namespace name and helps protect against future naming collisions. To migrate, users should update their call signatures accordingly. + - [`fce4265`](https://github.com/stdlib-js/stdlib/commit/fce42651903b96cc6a0f26e84afc812fa4ea94b3): The third argument 'b' in the JavaScript implementation of `truncsd` is now mandatory. To migrate, explicitly supply the old default value of `10` as the third argument. - [`5df976a`](https://github.com/stdlib-js/stdlib/commit/5df976abacaaf3082890fa852e40edfdf1b79f4b): base parameter is no longer optional @@ -5934,6 +5951,7 @@ A total of 24 people contributed to this release. Thank you to the following con
+- [`0ae49fb`](https://github.com/stdlib-js/stdlib/commit/0ae49fba6e79599a4b8b1be464a7570a3c7f6d83) - **feat:** fix function name and update docs [(#2777)](https://github.com/stdlib-js/stdlib/pull/2777) _(by Gunj Joshi)_ - [`779b35c`](https://github.com/stdlib-js/stdlib/commit/779b35ca267629b2dadd9947ad2ba106b8095004) - **feat:** add C implementation for `math/base/special/besselj0` _(by Gunj Joshi, Philipp Burckhardt)_ - [`252286d`](https://github.com/stdlib-js/stdlib/commit/252286d5d3357112ff718f0e3dc5ae758836efd3) - **bench:** remove irrelevant benchmark, update `boost` link in `math/base/special/gamma-delta-ratio` _(by Gunj Joshi)_ - [`01126b1`](https://github.com/stdlib-js/stdlib/commit/01126b1a0519c87778b802efd352d3117028bb88) - **style:** compare `n` with `integer`, not a `double` in `math/base/special/binomcoefln` [(#2775)](https://github.com/stdlib-js/stdlib/pull/2775 ) _(by Gunj Joshi)_ diff --git a/base/special/besselj1/README.md b/base/special/besselj1/README.md index f111d1457..6567b758d 100644 --- a/base/special/besselj1/README.md +++ b/base/special/besselj1/README.md @@ -122,18 +122,18 @@ for ( i = 0; i < 100; i++ ) { ### Usage ```c -#include "stdlib/math/base/special/j1.h" +#include "stdlib/math/base/special/besselj1.h" ``` -#### stdlib_base_j1( x ) +#### stdlib_base_besselj1( x ) Computes the [Bessel function of the first kind][bessel-first-kind] of order one at `x`. ```c -double out = stdlib_base_j1( 0.0 ); +double out = stdlib_base_besselj1( 0.0 ); // returns 0.0 -out = stdlib_base_j1( 1.0 ); +out = stdlib_base_besselj1( 1.0 ); // returns ~0.440 ``` @@ -142,7 +142,7 @@ The function accepts the following arguments: - **x**: `[in] double` input value. ```c -double stdlib_base_j1( const double x ); +double stdlib_base_besselj1( const double x ); ``` @@ -164,7 +164,7 @@ double stdlib_base_j1( const double x ); ### Examples ```c -#include "stdlib/math/base/special/j1.h" +#include "stdlib/math/base/special/besselj1.h" #include int main( void ) { @@ -173,8 +173,8 @@ int main( void ) { int i; for ( i = 0; i < 7; i++ ) { - v = stdlib_base_j1( x[ i ] ); - printf( "j1(%lf) = %lf\n", x[ i ], v ); + v = stdlib_base_besselj1( x[ i ] ); + printf( "besselj1(%lf) = %lf\n", x[ i ], v ); } } ``` diff --git a/base/special/besselj1/benchmark/c/native/benchmark.c b/base/special/besselj1/benchmark/c/native/benchmark.c index 71ab511ec..32dbd0f89 100644 --- a/base/special/besselj1/benchmark/c/native/benchmark.c +++ b/base/special/besselj1/benchmark/c/native/benchmark.c @@ -16,7 +16,7 @@ * limitations under the License. */ -#include "stdlib/math/base/special/j1.h" +#include "stdlib/math/base/special/besselj1.h" #include #include #include @@ -99,7 +99,7 @@ static double benchmark( void ) { t = tic(); for ( i = 0; i < ITERATIONS; i++ ) { x = ( 100000.0 * rand_double() ) - 0.0; - y = stdlib_base_j1( x ); + y = stdlib_base_besselj1( x ); if ( y != y ) { printf( "should not return NaN\n" ); break; diff --git a/base/special/besselj1/examples/c/example.c b/base/special/besselj1/examples/c/example.c index a395a8bf2..63368d032 100644 --- a/base/special/besselj1/examples/c/example.c +++ b/base/special/besselj1/examples/c/example.c @@ -16,7 +16,7 @@ * limitations under the License. */ -#include "stdlib/math/base/special/j1.h" +#include "stdlib/math/base/special/besselj1.h" #include int main( void ) { @@ -25,7 +25,7 @@ int main( void ) { int i; for ( i = 0; i < 7; i++ ) { - v = stdlib_base_j1( x[ i ] ); - printf( "j1(%lf) = %lf\n", x[ i ], v ); + v = stdlib_base_besselj1( x[ i ] ); + printf( "besselj1(%lf) = %lf\n", x[ i ], v ); } } diff --git a/base/special/besselj1/include/stdlib/math/base/special/j1.h b/base/special/besselj1/include/stdlib/math/base/special/besselj1.h similarity index 83% rename from base/special/besselj1/include/stdlib/math/base/special/j1.h rename to base/special/besselj1/include/stdlib/math/base/special/besselj1.h index 2cf7e053c..5f7c5cf27 100644 --- a/base/special/besselj1/include/stdlib/math/base/special/j1.h +++ b/base/special/besselj1/include/stdlib/math/base/special/besselj1.h @@ -16,8 +16,8 @@ * limitations under the License. */ -#ifndef STDLIB_MATH_BASE_SPECIAL_J1_H -#define STDLIB_MATH_BASE_SPECIAL_J1_H +#ifndef STDLIB_MATH_BASE_SPECIAL_BESSELJ1_H +#define STDLIB_MATH_BASE_SPECIAL_BESSELJ1_H /* * If C++, prevent name mangling so that the compiler emits a binary file having undecorated names, thus mirroring the behavior of a C compiler. @@ -29,10 +29,10 @@ extern "C" { /** * Computes the Bessel function of the first kind of order one. */ -double stdlib_base_j1( const double x ); +double stdlib_base_besselj1( const double x ); #ifdef __cplusplus } #endif -#endif // !STDLIB_MATH_BASE_SPECIAL_J1_H +#endif // !STDLIB_MATH_BASE_SPECIAL_BESSELJ1_H diff --git a/base/special/besselj1/lib/main.js b/base/special/besselj1/lib/main.js index 78b5fa158..2650e74c3 100644 --- a/base/special/besselj1/lib/main.js +++ b/base/special/besselj1/lib/main.js @@ -18,7 +18,7 @@ * * ## Notice * -* The original C++ code and copyright notice are from the [Boost library]{@link https://github.com/boostorg/math/blob/develop/include/boost/math/special_functions/detail/bessel_j1.hpp}. The implementation has been modified for JavaScript. +* The original C++ code and copyright notice are from the [Boost library]{@link https://www.boost.org/doc/libs/1_85_0/boost/math/special_functions/detail/bessel_j1.hpp}. The implementation has been modified for JavaScript. * * ```text * Copyright Xiaogang Zhang, 2006. diff --git a/base/special/besselj1/src/addon.c b/base/special/besselj1/src/addon.c index 7e1cba9bc..450f63034 100644 --- a/base/special/besselj1/src/addon.c +++ b/base/special/besselj1/src/addon.c @@ -16,8 +16,8 @@ * limitations under the License. */ -#include "stdlib/math/base/special/j1.h" +#include "stdlib/math/base/special/besselj1.h" #include "stdlib/math/base/napi/unary.h" // cppcheck-suppress shadowFunction -STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_j1 ) +STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_besselj1 ) diff --git a/base/special/besselj1/src/main.c b/base/special/besselj1/src/main.c index d08389021..d58893677 100644 --- a/base/special/besselj1/src/main.c +++ b/base/special/besselj1/src/main.c @@ -18,7 +18,7 @@ * * ## Notice * -* The original C++ code and copyright notice are from the [Boost library]{@link https://github.com/boostorg/math/blob/develop/include/boost/math/special_functions/detail/bessel_j1.hpp}. The implementation has been modified for use in stdlib. +* The original C++ code and copyright notice are from the [Boost library]{@link https://www.boost.org/doc/libs/1_85_0/boost/math/special_functions/detail/bessel_j1.hpp}. The implementation has been modified for use in stdlib. * * ```text * Copyright Xiaogang Zhang, 2006. @@ -29,7 +29,7 @@ * ``` */ -#include "stdlib/math/base/special/j1.h" +#include "stdlib/math/base/special/besselj1.h" #include "stdlib/math/base/special/sqrt.h" #include "stdlib/math/base/special/abs.h" #include "stdlib/math/base/special/sincos.h" @@ -222,10 +222,10 @@ static double rational_psqs( const double x ) { * @return evaluated Bessel function * * @example -* double out = stdlib_base_j1( 1.0 ); +* double out = stdlib_base_besselj1( 1.0 ); * // returns ~0.440 */ -double stdlib_base_j1( const double x ) { +double stdlib_base_besselj1( const double x ) { double value; double rc; double rs;