Skip to content

Commit c263025

Browse files
committed
Merge branch 'develop' into feat/gammainc
2 parents a225e46 + a02e418 commit c263025

File tree

279 files changed

+18553
-101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

279 files changed

+18553
-101
lines changed

lib/node_modules/@stdlib/blas/base/diagonal-type-str2enum/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var str2enum = require( '@stdlib/blas/base/diagonal-type-str2enum' );
4242

4343
#### str2enum( diagonal )
4444

45-
Returns the enumeration constant associated with a BLAS diagonal-type.
45+
Returns the enumeration constant associated with a BLAS diagonal type.
4646

4747
```javascript
4848
var v = str2enum( 'unit' );

lib/node_modules/@stdlib/blas/base/dtrsv/docs/types/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ interface Routine {
6060
* @param N - number of elements along each dimension in the matrix `A`
6161
* @param A - input matrix
6262
* @param strideA1 - stride of the first dimension of `A`
63-
* @param strideA2 - stride of the first dimension of `A`
63+
* @param strideA2 - stride of the second dimension of `A`
6464
* @param offsetA - starting index for `A`
6565
* @param x - input vector
6666
* @param strideX - `x` stride length

lib/node_modules/@stdlib/dstructs/struct/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,16 @@ TODO: document constructor API
102102

103103
- The struct schema supports default values. In C, uninitialized members are zero-filled.
104104
- The struct schema supports "casting modes", which govern member assignment operations and support placing (or relaxing) strict requirements on what types of values may be assigned to struct members. In C, members have no such limitations, with the C compiler performing implicit casting (e.g., a signed integer will be implicitly cast to an unsigned integer when a member has an unsigned integer data type).
105-
- Only fixed-width types are supported (e.g., `int8`, `float64`, etc). In C, members can have types which may vary across platforms (e.g., `int`).
105+
- Only fixed-width types are supported (e.g., `int8`, `float64`, etc). In C, members can have types which may vary across platforms (e.g., `int`, `enum`, `long double`, etc).
106106
- Member types must be serializable to an ArrayBuffer (e.g., no functions, general objects, etc). In C, members have no such limitations (e.g., a member can be a function pointer).
107107
- Union types must all have the same byte length. In C, members of union types can have different byte lengths.
108108
- struct instances can have "hidden" (i.e., non-enumerable) fields. In C, all members are part of a `struct`'s public API.
109109
- struct instances can have read-only fields. In C, one can use a `const` qualifier to prevent assignment after initialization; however, one can circumvent this restriction using pointer tricks.
110110
- Member types can have an associated description, which is useful when wanting to inspect struct instances in interactive contexts, such as REPLs.
111111
- struct instances support string and JSON serialization.
112112

113+
- A primary use case for emulating C `struct` behavior is to facilitate interoperation between JavaScript and C. For example, by creating a JavaScript struct instance which has the same alignment and layout as a C `struct`, one can pass a pointer to a struct instance's underlying byte buffer from JavaScript to C and then simply perform a cast to interpret as an equivalent C `struct`. This enables zero-copy interchange when, e.g., calling into Node.js native native add-ons and can greatly reduce overhead when working with heterogeneous composite data types.
114+
113115
</section>
114116

115117
<!-- /.notes -->

lib/node_modules/@stdlib/lapack/base/dgttrf/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,10 @@ var IPIV0 = new Int32Array( [ 0, 0, 0, 0 ] );
180180

181181
// Create offset views...
182182
var DL = new Float64Array( DL0.buffer, DL0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
183-
var D = new Float64Array( D0.buffer, D0.BYTES_PER_ELEMENT*1 );
184-
var DU = new Float64Array( DU0.buffer, DU0.BYTES_PER_ELEMENT*1 );
185-
var DU2 = new Float64Array( DU20.buffer, DU20.BYTES_PER_ELEMENT*1 );
186-
var IPIV = new Int32Array( IPIV0.buffer, IPIV0.BYTES_PER_ELEMENT*1 );
183+
var D = new Float64Array( D0.buffer, D0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
184+
var DU = new Float64Array( DU0.buffer, DU0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
185+
var DU2 = new Float64Array( DU20.buffer, DU20.BYTES_PER_ELEMENT*1 ); // start at 2nd element
186+
var IPIV = new Int32Array( IPIV0.buffer, IPIV0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
187187

188188
dgttrf( 3, DL, D, DU, DU2, IPIV );
189189
// DL0 => <Float64Array>[ 0.0, 0.3, ~0.22 ]

lib/node_modules/@stdlib/lapack/base/dgttrf/lib/base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ function dgttrf( N, DL, strideDL, offsetDL, D, strideD, offsetD, DU, strideDU, o
127127

128128
j = idu + strideDU;
129129
DU2[ idu2 ] = DU[ j ];
130-
DU[ j ] = -fact*DU[ j ];
130+
DU[ j ] *= -fact;
131131

132132
IPIV[ ip ] = i + 1;
133133
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "stdlib/math/base/special/cos.h"
2121

2222
/**
23-
* Evaluates the cosecant of a number.
23+
* Evaluates the secant of a number.
2424
*
2525
* @param x input value (in radians)
2626
* @return secant
Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2025 The Stdlib Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
# Secant
22+
23+
> Evaluate the [secant][trigonometric-functions] of a single-precision floating-point number (in radians).
24+
25+
<section class="intro">
26+
27+
</section>
28+
29+
<section class="usage">
30+
31+
## Usage
32+
33+
```javascript
34+
var secf = require( '@stdlib/math/base/special/secf' );
35+
```
36+
37+
## secf( x )
38+
39+
Evaluates the [secant][trigonometric-functions] of a single-precision floating-point number (in radians).
40+
41+
```javascript
42+
var v = secf( 0.0 );
43+
// returns 1.0
44+
45+
v = secf( 3.1415927410125732 );
46+
// returns -1.0
47+
48+
v = secf( -3.1415927410125732/3.0 );
49+
// returns ~2.0
50+
51+
v = secf( 3.1415927410125732/3.0 );
52+
// returns ~2.0
53+
54+
v = secf( NaN );
55+
// returns NaN
56+
```
57+
58+
</section>
59+
60+
<!-- /.usage -->
61+
62+
<section class="examples">
63+
64+
## Examples
65+
66+
<!-- eslint no-undef: "error" -->
67+
68+
```javascript
69+
var uniform = require( '@stdlib/random/array/uniform' );
70+
var logEachMap = require( '@stdlib/console/log-each-map' );
71+
var TWO_PI = require( '@stdlib/constants/float32/two-pi' );
72+
var secf = require( '@stdlib/math/base/special/secf' );
73+
74+
var opts = {
75+
'dtype': 'float32'
76+
};
77+
var x = uniform( 100, 0.0, TWO_PI, opts );
78+
79+
logEachMap( 'secf(%0.4f) = %0.4f', x, secf );
80+
```
81+
82+
</section>
83+
84+
<!-- /.examples -->
85+
86+
<!-- C interface documentation. -->
87+
88+
* * *
89+
90+
<section class="c">
91+
92+
## C APIs
93+
94+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
95+
96+
<section class="intro">
97+
98+
</section>
99+
100+
<!-- /.intro -->
101+
102+
<!-- C usage documentation. -->
103+
104+
<section class="usage">
105+
106+
### Usage
107+
108+
```c
109+
#include "stdlib/math/base/special/secf.h"
110+
```
111+
112+
#### stdlib_base_secf( x )
113+
114+
Evaluates the [secant][trigonometric-functions] of a single-precision floating-point number (in radians).
115+
116+
```c
117+
float out = stdlib_base_secf( 0.0f );
118+
// returns 1.0f
119+
120+
out = stdlib_base_cos( 3.1415927410125732f );
121+
// returns -1.0f
122+
```
123+
124+
The function accepts the following arguments:
125+
126+
- **x**: `[in] float` input value.
127+
128+
```c
129+
float stdlib_base_secf( const float x );
130+
```
131+
132+
</section>
133+
134+
<!-- /.usage -->
135+
136+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
137+
138+
<section class="notes">
139+
140+
</section>
141+
142+
<!-- /.notes -->
143+
144+
<!-- C API usage examples. -->
145+
146+
<section class="examples">
147+
148+
### Examples
149+
150+
```c
151+
#include "stdlib/math/base/special/secf.h"
152+
#include <stdio.h>
153+
154+
int main( void ) {
155+
const float x[] = { 0.523f, 0.785f, 1.047f, 3.14f };
156+
157+
float y;
158+
int i;
159+
for ( i = 0; i < 4; i++ ) {
160+
y = stdlib_base_secf( x[ i ] );
161+
printf( "secf(%f) = %f\n", x[ i ], y );
162+
}
163+
}
164+
```
165+
166+
</section>
167+
168+
<!-- /.examples -->
169+
170+
</section>
171+
172+
<!-- /.c -->
173+
174+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
175+
176+
<section class="related">
177+
178+
</section>
179+
180+
<!-- /.related -->
181+
182+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
183+
184+
<section class="links">
185+
186+
[trigonometric-functions]: https://en.wikipedia.org/wiki/Trigonometric_functions
187+
188+
<!-- <related-links> -->
189+
190+
<!-- </related-links> -->
191+
192+
</section>
193+
194+
<!-- /.links -->
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var bench = require( '@stdlib/bench' );
24+
var uniform = require( '@stdlib/random/array/uniform' );
25+
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
26+
var pkg = require( './../package.json' ).name;
27+
var secf = require( './../lib' );
28+
29+
30+
// MAIN //
31+
32+
bench( pkg, function benchmark( b ) {
33+
var x;
34+
var y;
35+
var i;
36+
37+
x = uniform( 100, -10.0, 10.0, {
38+
'dtype': 'float32'
39+
});
40+
41+
b.tic();
42+
for ( i = 0; i < b.iterations; i++ ) {
43+
y = secf( x[ i%x.length ] );
44+
if ( isnanf( y ) ) {
45+
b.fail( 'should not return NaN' );
46+
}
47+
}
48+
b.toc();
49+
if ( isnanf( y ) ) {
50+
b.fail( 'should not return NaN' );
51+
}
52+
b.pass( 'benchmark finished' );
53+
b.end();
54+
});
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var resolve = require( 'path' ).resolve;
24+
var bench = require( '@stdlib/bench' );
25+
var uniform = require( '@stdlib/random/array/uniform' );
26+
var isnanf = require( '@stdlib/math/base/assert/is-nanf' );
27+
var tryRequire = require( '@stdlib/utils/try-require' );
28+
var pkg = require( './../package.json' ).name;
29+
30+
31+
// VARIABLES //
32+
33+
var secf = tryRequire( resolve( __dirname, './../lib/native.js' ) );
34+
var opts = {
35+
'skip': ( secf instanceof Error )
36+
};
37+
38+
39+
// MAIN //
40+
41+
bench( pkg+'::native', opts, function benchmark( b ) {
42+
var x;
43+
var y;
44+
var i;
45+
46+
x = uniform( 100, -10.0, 10.0, {
47+
'dtype': 'float32'
48+
});
49+
50+
b.tic();
51+
for ( i = 0; i < b.iterations; i++ ) {
52+
y = secf( x[ i%x.length ] );
53+
if ( isnanf( y ) ) {
54+
b.fail( 'should not return NaN' );
55+
}
56+
}
57+
b.toc();
58+
if ( isnanf( y ) ) {
59+
b.fail( 'should not return NaN' );
60+
}
61+
b.pass( 'benchmark finished' );
62+
b.end();
63+
});

0 commit comments

Comments
 (0)