Skip to content

Commit 4f9ea17

Browse files
Merge branch 'develop' into ieee/acos
Signed-off-by: Karan Anand <[email protected]>
2 parents fb7c47a + 70e237f commit 4f9ea17

File tree

233 files changed

+24476
-400
lines changed

Some content is hidden

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

233 files changed

+24476
-400
lines changed

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ Mohammad Bin Aftab <[email protected]>
9595
Mohammad Kaif <[email protected]>
9696
Momtchil Momtchev <[email protected]>
9797
Muhammad Haris <[email protected]>
98+
Muhammad Taaha Tariq <[email protected]>
9899
Muhmmad Saad <[email protected]>
99100
Naresh Jagadeesan <[email protected]>
100101
Naveen Kumar <[email protected]>

lib/node_modules/@stdlib/blas/base/ssyr2/lib/ndarray.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function ssyr2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, str
7070
throw new RangeError( format( 'invalid argument. Fifth argument must be non-zero. Value: `%d`.', strideX ) );
7171
}
7272
if ( strideY === 0 ) {
73-
throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideX ) );
73+
throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideY ) );
7474
}
7575
if ( N === 0 || alpha === 0.0 ) {
7676
return A;

lib/node_modules/@stdlib/blas/base/ssyr2/lib/ssyr2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function ssyr2( order, uplo, N, alpha, x, strideX, y, strideY, A, LDA ) {
7979
throw new RangeError( format( 'invalid argument. Sixth argument must be non-zero. Value: `%d`.', strideX ) );
8080
}
8181
if ( strideY === 0 ) {
82-
throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideX ) );
82+
throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideY ) );
8383
}
8484
if ( LDA < max( 1, N ) ) {
8585
throw new RangeError( format( 'invalid argument. Tenth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) );
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"order": "column-major",
3+
"uplo": "lower",
4+
"N": 3,
5+
"alpha": 2.0,
6+
"x": [ 0.0, 0.0, 0.0 ],
7+
"strideX": 1,
8+
"offsetX": 0,
9+
"y": [ 1.0, 2.0, 3.0 ],
10+
"strideY": 1,
11+
"offsetY": 0,
12+
"A": [ 1.0, 1.0, 1.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0 ],
13+
"lda": 3,
14+
"strideA1": 1,
15+
"strideA2": 3,
16+
"offsetA": 0,
17+
"A_out": [ 1.0, 1.0, 1.0, 0.0, 2.0, 2.0, 0.0, 0.0, 3.0 ]
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"order": "row-major",
3+
"uplo": "lower",
4+
"N": 3,
5+
"alpha": 2.0,
6+
"x": [ 0.0, 0.0, 0.0 ],
7+
"strideX": 1,
8+
"offsetX": 0,
9+
"y": [ 1.0, 2.0, 3.0 ],
10+
"strideY": 1,
11+
"offsetY": 0,
12+
"A": [ 1.0, 0.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 3.0 ],
13+
"lda": 3,
14+
"strideA1": 3,
15+
"strideA2": 1,
16+
"offsetA": 0,
17+
"A_out": [ 1.0, 0.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 3.0 ]
18+
}

lib/node_modules/@stdlib/blas/base/ssyr2/test/test.ndarray.js

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ var ssyr2 = require( './../lib/ndarray.js' );
3131

3232
var ru = require( './fixtures/row_major_u.json' );
3333
var rl = require( './fixtures/row_major_l.json' );
34+
var rx0 = require( './fixtures/row_major_x0.json' );
3435
var rxpyp = require( './fixtures/row_major_xpyp.json' );
3536
var rxnyp = require( './fixtures/row_major_xnyp.json' );
3637
var rxpyn = require( './fixtures/row_major_xpyn.json' );
@@ -44,6 +45,7 @@ var rcap = require( './fixtures/row_major_complex_access_pattern.json' );
4445

4546
var cu = require( './fixtures/column_major_u.json' );
4647
var cl = require( './fixtures/column_major_l.json' );
48+
var cx0 = require( './fixtures/column_major_x0.json' );
4749
var cxpyp = require( './fixtures/column_major_xpyp.json' );
4850
var cxnyp = require( './fixtures/column_major_xnyp.json' );
4951
var cxpyn = require( './fixtures/column_major_xpyn.json' );
@@ -161,7 +163,7 @@ tape( 'the function throws an error if provided an invalid eighth argument', fun
161163

162164
function badValue( value ) {
163165
return function badValue() {
164-
ssyr2( data.uplo, data.N, data.alpha, new Float32Array( data.x ), value, data.offsetX, new Float32Array( data.y ), data.strideY, data.offsetY, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA );
166+
ssyr2( data.uplo, data.N, data.alpha, new Float32Array( data.x ), data.strideX, data.offsetX, new Float32Array( data.y ), value, data.offsetY, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA );
165167
};
166168
}
167169
});
@@ -258,6 +260,52 @@ tape( 'the function performs the symmetric rank 2 operation `A = α*x*y^T + α*y
258260
t.end();
259261
});
260262

263+
tape( 'the function performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` (row-major, zero-vector)', function test( t ) {
264+
var expected;
265+
var data;
266+
var out;
267+
var a;
268+
var x;
269+
var y;
270+
271+
data = rx0;
272+
273+
a = new Float32Array( data.A );
274+
x = new Float32Array( data.x );
275+
y = new Float32Array( data.y );
276+
277+
expected = new Float32Array( data.A_out );
278+
279+
out = ssyr2( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA );
280+
t.strictEqual( out, a, 'returns expected value' );
281+
t.deepEqual( out, expected, 'returns expected value' );
282+
283+
t.end();
284+
});
285+
286+
tape( 'the function performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` (column-major, zero-vector)', function test( t ) {
287+
var expected;
288+
var data;
289+
var out;
290+
var a;
291+
var x;
292+
var y;
293+
294+
data = cx0;
295+
296+
a = new Float32Array( data.A );
297+
x = new Float32Array( data.x );
298+
y = new Float32Array( data.y );
299+
300+
expected = new Float32Array( data.A_out );
301+
302+
out = ssyr2( data.uplo, data.N, data.alpha, x, data.strideX, data.offsetX, y, data.strideY, data.offsetY, a, data.strideA1, data.strideA2, data.offsetA );
303+
t.strictEqual( out, a, 'returns expected value' );
304+
t.deepEqual( out, expected, 'returns expected value' );
305+
306+
t.end();
307+
});
308+
261309
tape( 'the function returns a reference to the input matrix `A`', function test( t ) {
262310
var data;
263311
var out;

lib/node_modules/@stdlib/blas/base/ssyr2/test/test.ssyr2.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ var ssyr2 = require( './../lib/ssyr2.js' );
3131

3232
var ru = require( './fixtures/row_major_u.json' );
3333
var rl = require( './fixtures/row_major_l.json' );
34+
var rx0 = require( './fixtures/row_major_x0.json' );
3435
var rxpyp = require( './fixtures/row_major_xpyp.json' );
3536
var rxnyp = require( './fixtures/row_major_xnyp.json' );
3637
var rxpyn = require( './fixtures/row_major_xpyn.json' );
3738
var rxnyn = require( './fixtures/row_major_xnyn.json' );
3839

3940
var cu = require( './fixtures/column_major_u.json' );
4041
var cl = require( './fixtures/column_major_l.json' );
42+
var cx0 = require( './fixtures/column_major_x0.json' );
4143
var cxpyp = require( './fixtures/column_major_xpyp.json' );
4244
var cxnyp = require( './fixtures/column_major_xnyp.json' );
4345
var cxpyn = require( './fixtures/column_major_xpyn.json' );
@@ -300,6 +302,52 @@ tape( 'the function performs the symmetric rank 2 operation `A = α*x*y^T + α*y
300302
t.end();
301303
});
302304

305+
tape( 'the function performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` (row-major, zero-vector)', function test( t ) {
306+
var expected;
307+
var data;
308+
var out;
309+
var a;
310+
var x;
311+
var y;
312+
313+
data = rx0;
314+
315+
a = new Float32Array( data.A );
316+
x = new Float32Array( data.x );
317+
y = new Float32Array( data.y );
318+
319+
expected = new Float32Array( data.A_out );
320+
321+
out = ssyr2( data.order, data.uplo, data.N, data.alpha, x, data.strideX, y, data.strideY, a, data.lda );
322+
t.strictEqual( out, a, 'returns expected value' );
323+
t.deepEqual( out, expected, 'returns expected value' );
324+
325+
t.end();
326+
});
327+
328+
tape( 'the function performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` (column-major, zero-vector)', function test( t ) {
329+
var expected;
330+
var data;
331+
var out;
332+
var a;
333+
var x;
334+
var y;
335+
336+
data = cx0;
337+
338+
a = new Float32Array( data.A );
339+
x = new Float32Array( data.x );
340+
y = new Float32Array( data.y );
341+
342+
expected = new Float32Array( data.A_out );
343+
344+
out = ssyr2( data.order, data.uplo, data.N, data.alpha, x, data.strideX, y, data.strideY, a, data.lda );
345+
t.strictEqual( out, a, 'returns expected value' );
346+
t.deepEqual( out, expected, 'returns expected value' );
347+
348+
t.end();
349+
});
350+
303351
tape( 'the function returns a reference to the input matrix `A`', function test( t ) {
304352
var data;
305353
var out;

lib/node_modules/@stdlib/math/base/napi/ternary/README.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,69 @@ The function accepts the following arguments:
512512
void stdlib_math_base_napi_fif_f( napi_env env, napi_callback_info info, float (*fcn)( float, int32_t, float ) );
513513
```
514514

515+
#### STDLIB_MATH_BASE_NAPI_MODULE_FII_F( fcn )
516+
517+
Macro for registering a Node-API module exporting an interface for invoking a ternary function accepting a single-precision floating-point number and two signed 32-bit integers and returning a single-precision floating-point number.
518+
519+
```c
520+
#include <stdint.h>
521+
522+
static float fcn( const float x, const int32_t y, const int32_t z ) {
523+
// ...
524+
}
525+
526+
// ...
527+
528+
// Register a Node-API module:
529+
STDLIB_MATH_BASE_NAPI_MODULE_FII_F( fcn );
530+
```
531+
532+
The macro expects the following arguments:
533+
534+
- **fcn**: `float (*fcn)( float, int32_t, int32_t )` ternary function.
535+
536+
When used, this macro should be used **instead of** `NAPI_MODULE`. The macro includes `NAPI_MODULE`, thus ensuring Node-API module registration.
537+
538+
#### stdlib_math_base_napi_fii_f( env, info, fcn )
539+
540+
Invokes a ternary function accepting a single-precision floating-point number and two signed 32-bit integers and returning a single-precision floating-point number.
541+
542+
```c
543+
#include <node_api.h>
544+
#include <stdint.h>
545+
546+
// ...
547+
548+
static float fcn( const float x, const int32_t y, const int32_t z ) {
549+
// ...
550+
}
551+
552+
// ...
553+
554+
/**
555+
* Receives JavaScript callback invocation data.
556+
*
557+
* @param env environment under which the function is invoked
558+
* @param info callback data
559+
* @return Node-API value
560+
*/
561+
napi_value addon( napi_env env, napi_callback_info info ) {
562+
return stdlib_math_base_napi_fii_f( env, info, fcn );
563+
}
564+
565+
// ...
566+
```
567+
568+
The function accepts the following arguments:
569+
570+
- **env**: `[in] napi_env` environment under which the function is invoked.
571+
- **info**: `[in] napi_callback_info` callback data.
572+
- **fcn**: `[in] float (*fcn)( float, int32_t, int32_t )` ternary function.
573+
574+
```c
575+
void stdlib_math_base_napi_fii_f( napi_env env, napi_callback_info info, float (*fcn)( float, int32_t, int32_t ) );
576+
```
577+
515578
#### STDLIB_MATH_BASE_NAPI_MODULE_IID_D( fcn )
516579
517580
Macro for registering a Node-API module exporting an interface for invoking a ternary function accepting two signed 32-bit integers and a double-precision floating-point number and returning a double-precision floating-point number.

lib/node_modules/@stdlib/math/base/napi/ternary/include/stdlib/math/base/napi/ternary.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "stdlib/math/base/napi/ternary/dii_d.h"
2727
#include "stdlib/math/base/napi/ternary/fff_f.h"
2828
#include "stdlib/math/base/napi/ternary/fif_f.h"
29+
#include "stdlib/math/base/napi/ternary/fii_f.h"
2930
#include "stdlib/math/base/napi/ternary/iid_d.h"
3031
#include "stdlib/math/base/napi/ternary/iii_d.h"
3132
#include "stdlib/math/base/napi/ternary/zzz_z.h"
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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+
#ifndef STDLIB_MATH_BASE_NAPI_TERNARY_FII_F_H
20+
#define STDLIB_MATH_BASE_NAPI_TERNARY_FII_F_H
21+
22+
#include <node_api.h>
23+
#include <assert.h>
24+
#include <stdint.h>
25+
26+
/**
27+
* Macro for registering a Node-API module exporting an interface invoking a ternary function accepting a single-precision floating-point number and two signed 32-bit integers and returning a single-precision floating-point number.
28+
*
29+
* @param fcn ternary function
30+
*
31+
* @example
32+
* #include <stdint.h>
33+
*
34+
* static float fcn( const float x, const int32_t y, const int32_t z ) {
35+
* // ...
36+
* }
37+
*
38+
* // ...
39+
*
40+
* // Register a Node-API module:
41+
* STDLIB_MATH_BASE_NAPI_MODULE_FII_F( fcn );
42+
*/
43+
#define STDLIB_MATH_BASE_NAPI_MODULE_FII_F( fcn ) \
44+
static napi_value stdlib_math_base_napi_fii_f_wrapper( \
45+
napi_env env, \
46+
napi_callback_info info \
47+
) { \
48+
return stdlib_math_base_napi_fii_f( env, info, fcn ); \
49+
}; \
50+
static napi_value stdlib_math_base_napi_fii_f_init( \
51+
napi_env env, \
52+
napi_value exports \
53+
) { \
54+
napi_value f; \
55+
napi_status status = napi_create_function( \
56+
env, \
57+
"exports", \
58+
NAPI_AUTO_LENGTH, \
59+
stdlib_math_base_napi_fii_f_wrapper, \
60+
NULL, \
61+
&f \
62+
); \
63+
assert( status == napi_ok ); \
64+
return f; \
65+
}; \
66+
NAPI_MODULE( NODE_GYP_MODULE_NAME, stdlib_math_base_napi_fii_f_init )
67+
68+
/*
69+
* If C++, prevent name mangling so that the compiler emits a ternary file having undecorated names, thus mirroring the behavior of a C compiler.
70+
*/
71+
#ifdef __cplusplus
72+
extern "C" {
73+
#endif
74+
75+
/**
76+
* Invokes a ternary function accepting a single-precision floating-point number and two signed 32-bit integers and returning a single-precision floating-point number.
77+
*/
78+
napi_value stdlib_math_base_napi_fii_f( napi_env env, napi_callback_info info, float (*fcn)( float, int32_t, int32_t ) );
79+
80+
#ifdef __cplusplus
81+
}
82+
#endif
83+
84+
#endif // !STDLIB_MATH_BASE_NAPI_TERNARY_FII_F_H

0 commit comments

Comments
 (0)