Skip to content

Commit 0ae49fb

Browse files
authored
feat!: fix function name and update docs
BREAKING CHANGE: 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. PR-URL: #2777 Ref: 18bd1b5#r145258015 Ref: 18bd1b5#r145258035 Reviewed-by: Athan Reines <[email protected]>
1 parent 09afa7c commit 0ae49fb

File tree

7 files changed

+24
-24
lines changed

7 files changed

+24
-24
lines changed

lib/node_modules/@stdlib/math/base/special/besselj1/README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,18 @@ for ( i = 0; i < 100; i++ ) {
122122
### Usage
123123

124124
```c
125-
#include "stdlib/math/base/special/j1.h"
125+
#include "stdlib/math/base/special/besselj1.h"
126126
```
127127

128-
#### stdlib_base_j1( x )
128+
#### stdlib_base_besselj1( x )
129129

130130
Computes the [Bessel function of the first kind][bessel-first-kind] of order one at `x`.
131131

132132
```c
133-
double out = stdlib_base_j1( 0.0 );
133+
double out = stdlib_base_besselj1( 0.0 );
134134
// returns 0.0
135135

136-
out = stdlib_base_j1( 1.0 );
136+
out = stdlib_base_besselj1( 1.0 );
137137
// returns ~0.440
138138
```
139139

@@ -142,7 +142,7 @@ The function accepts the following arguments:
142142
- **x**: `[in] double` input value.
143143

144144
```c
145-
double stdlib_base_j1( const double x );
145+
double stdlib_base_besselj1( const double x );
146146
```
147147
148148
</section>
@@ -164,7 +164,7 @@ double stdlib_base_j1( const double x );
164164
### Examples
165165
166166
```c
167-
#include "stdlib/math/base/special/j1.h"
167+
#include "stdlib/math/base/special/besselj1.h"
168168
#include <stdio.h>
169169
170170
int main( void ) {
@@ -173,8 +173,8 @@ int main( void ) {
173173
int i;
174174
175175
for ( i = 0; i < 7; i++ ) {
176-
v = stdlib_base_j1( x[ i ] );
177-
printf( "j1(%lf) = %lf\n", x[ i ], v );
176+
v = stdlib_base_besselj1( x[ i ] );
177+
printf( "besselj1(%lf) = %lf\n", x[ i ], v );
178178
}
179179
}
180180
```

lib/node_modules/@stdlib/math/base/special/besselj1/benchmark/c/native/benchmark.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* limitations under the License.
1717
*/
1818

19-
#include "stdlib/math/base/special/j1.h"
19+
#include "stdlib/math/base/special/besselj1.h"
2020
#include <stdlib.h>
2121
#include <stdio.h>
2222
#include <math.h>
@@ -99,7 +99,7 @@ static double benchmark( void ) {
9999
t = tic();
100100
for ( i = 0; i < ITERATIONS; i++ ) {
101101
x = ( 100000.0 * rand_double() ) - 0.0;
102-
y = stdlib_base_j1( x );
102+
y = stdlib_base_besselj1( x );
103103
if ( y != y ) {
104104
printf( "should not return NaN\n" );
105105
break;

lib/node_modules/@stdlib/math/base/special/besselj1/examples/c/example.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* limitations under the License.
1717
*/
1818

19-
#include "stdlib/math/base/special/j1.h"
19+
#include "stdlib/math/base/special/besselj1.h"
2020
#include <stdio.h>
2121

2222
int main( void ) {
@@ -25,7 +25,7 @@ int main( void ) {
2525
int i;
2626

2727
for ( i = 0; i < 7; i++ ) {
28-
v = stdlib_base_j1( x[ i ] );
29-
printf( "j1(%lf) = %lf\n", x[ i ], v );
28+
v = stdlib_base_besselj1( x[ i ] );
29+
printf( "besselj1(%lf) = %lf\n", x[ i ], v );
3030
}
3131
}

lib/node_modules/@stdlib/math/base/special/besselj1/include/stdlib/math/base/special/j1.h lib/node_modules/@stdlib/math/base/special/besselj1/include/stdlib/math/base/special/besselj1.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* limitations under the License.
1717
*/
1818

19-
#ifndef STDLIB_MATH_BASE_SPECIAL_J1_H
20-
#define STDLIB_MATH_BASE_SPECIAL_J1_H
19+
#ifndef STDLIB_MATH_BASE_SPECIAL_BESSELJ1_H
20+
#define STDLIB_MATH_BASE_SPECIAL_BESSELJ1_H
2121

2222
/*
2323
* 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" {
2929
/**
3030
* Computes the Bessel function of the first kind of order one.
3131
*/
32-
double stdlib_base_j1( const double x );
32+
double stdlib_base_besselj1( const double x );
3333

3434
#ifdef __cplusplus
3535
}
3636
#endif
3737

38-
#endif // !STDLIB_MATH_BASE_SPECIAL_J1_H
38+
#endif // !STDLIB_MATH_BASE_SPECIAL_BESSELJ1_H

lib/node_modules/@stdlib/math/base/special/besselj1/lib/main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
* ## Notice
2020
*
21-
* 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.
21+
* 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.
2222
*
2323
* ```text
2424
* Copyright Xiaogang Zhang, 2006.

lib/node_modules/@stdlib/math/base/special/besselj1/src/addon.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
* limitations under the License.
1717
*/
1818

19-
#include "stdlib/math/base/special/j1.h"
19+
#include "stdlib/math/base/special/besselj1.h"
2020
#include "stdlib/math/base/napi/unary.h"
2121

2222
// cppcheck-suppress shadowFunction
23-
STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_j1 )
23+
STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_besselj1 )

lib/node_modules/@stdlib/math/base/special/besselj1/src/main.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*
1919
* ## Notice
2020
*
21-
* 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.
21+
* 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.
2222
*
2323
* ```text
2424
* Copyright Xiaogang Zhang, 2006.
@@ -29,7 +29,7 @@
2929
* ```
3030
*/
3131

32-
#include "stdlib/math/base/special/j1.h"
32+
#include "stdlib/math/base/special/besselj1.h"
3333
#include "stdlib/math/base/special/sqrt.h"
3434
#include "stdlib/math/base/special/abs.h"
3535
#include "stdlib/math/base/special/sincos.h"
@@ -222,10 +222,10 @@ static double rational_psqs( const double x ) {
222222
* @return evaluated Bessel function
223223
*
224224
* @example
225-
* double out = stdlib_base_j1( 1.0 );
225+
* double out = stdlib_base_besselj1( 1.0 );
226226
* // returns ~0.440
227227
*/
228-
double stdlib_base_j1( const double x ) {
228+
double stdlib_base_besselj1( const double x ) {
229229
double value;
230230
double rc;
231231
double rs;

0 commit comments

Comments
 (0)