Skip to content

Commit d639e17

Browse files
committed
Auto-generated commit
1 parent 6b21171 commit d639e17

File tree

10 files changed

+364
-2
lines changed

10 files changed

+364
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-04-09)
7+
## Unreleased (2025-04-14)
88

99
<section class="packages">
1010

@@ -6628,6 +6628,8 @@ A total of 18 people contributed to this release. Thank you to the following con
66286628

66296629
<details>
66306630

6631+
- [`b01614a`](https://github.com/stdlib-js/stdlib/commit/b01614a0b9870bdd463ce8bc20a89c1765128db2) - **test:** completes code coverage in `blas/base/dnrm2` [(#6531)](https://github.com/stdlib-js/stdlib/pull/6531) _(by Shabareesh Shetty, Athan Reines)_
6632+
- [`58a8f55`](https://github.com/stdlib-js/stdlib/commit/58a8f55ac6713976035ec7834012ae74455aa603) - **test:** increase code coverage in `blas/base/dsyr2` [(#6546)](https://github.com/stdlib-js/stdlib/pull/6546) _(by Shabareesh Shetty, Athan Reines, stdlib-bot)_
66316633
- [`c9e3ff1`](https://github.com/stdlib-js/stdlib/commit/c9e3ff14ed5480358d1b0a97c7eafccd8234a1e9) - **test:** increase code coverage in `blas/base/zaxpy` [(#6568)](https://github.com/stdlib-js/stdlib/pull/6568) _(by Shabareesh Shetty)_
66326634
- [`9541650`](https://github.com/stdlib-js/stdlib/commit/9541650ee9c66a36c8e03a81036c5389383de9a3) - **test:** increase code coverage in `blas/base/ssyr2` [(#6544)](https://github.com/stdlib-js/stdlib/pull/6544) _(by Shabareesh Shetty, Athan Reines)_
66336635
- [`fc1d8d5`](https://github.com/stdlib-js/stdlib/commit/fc1d8d5ed542eec3ded1b128850909ebb5f8bc51) - **fix:** condition checks in `blas/base/ssyr2` [(#6543)](https://github.com/stdlib-js/stdlib/pull/6543) _(by Shabareesh Shetty)_

CONTRIBUTORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ Krishnendu Das <[email protected]>
8787
Kshitij-Dale <[email protected]>
8888
Lovelin Dhoni J B <[email protected]>
8989
90+
Mahfuza Humayra Mohona <[email protected]>
9091
Manik Sharma <[email protected]>
9192
Manvith M <[email protected]>
9293
Marcus Fantham <[email protected]>
@@ -119,6 +120,7 @@ Prashant Kumar Yadav <[email protected]>
119120
PrathamBhamare <[email protected]>
120121
Pratik Singh <[email protected]>
121122
Pratyush Kumar Chouhan <[email protected]>
123+
Pravesh Kunwar <[email protected]>
122124
Priyansh Prajapati <[email protected]>
123125
Priyanshu Agarwal <[email protected]>
124126
Pulkit Gupta <[email protected]>

base/dnrm2/test/test.dnrm2.js

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,40 @@
2323
var tape = require( 'tape' );
2424
var sqrt = require( '@stdlib/math/base/special/sqrt' );
2525
var Float64Array = require( '@stdlib/array/float64' );
26+
var EPS = require( '@stdlib/constants/float64/eps' );
27+
var abs = require( '@stdlib/math/base/special/abs' );
2628
var dnrm2 = require( './../lib/dnrm2.js' );
2729

2830

31+
// FUNCTIONS //
32+
33+
/**
34+
* Tests for element-wise approximate equality.
35+
*
36+
* @private
37+
* @param {Object} t - test object
38+
* @param {Collection} actual - actual values
39+
* @param {Collection} expected - expected values
40+
* @param {number} rtol - relative tolerance
41+
*/
42+
function isApprox( t, actual, expected, rtol ) {
43+
var delta;
44+
var tol;
45+
var i;
46+
47+
t.strictEqual( actual.length, expected.length, 'returns expected value' );
48+
for ( i = 0; i < expected.length; i++ ) {
49+
if ( actual[ i ] === expected[ i ] ) {
50+
t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' );
51+
} else {
52+
delta = abs( actual[ i ] - expected[ i ] );
53+
tol = rtol * EPS * abs( expected[ i ] );
54+
t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' );
55+
}
56+
}
57+
}
58+
59+
2960
// TESTS //
3061

3162
tape( 'main export is a function', function test( t ) {
@@ -53,6 +84,33 @@ tape( 'the function calculates the L2-norm of a vector', function test( t ) {
5384
z = dnrm2( x.length, x, 1 );
5485
t.strictEqual( z, 4.0, 'returns expected value' );
5586

87+
x = new Float64Array( [ 1.0e150, 1.0e150, 1.0e150, 1.0e150 ] );
88+
89+
z = dnrm2( x.length, x, 1 );
90+
t.strictEqual( z, 2.0e+150, 'returns expected value' );
91+
92+
x = new Float64Array( [ 1.0e-155, 1.0e-155, 1.0e-155, 1.0e-155 ] );
93+
94+
z = dnrm2( x.length, x, 1 );
95+
t.strictEqual( z, 2.0e-155, 'returns expected value' );
96+
97+
x = new Float64Array( [ 1.0e150, 1.0e50, 1.0e150, 1.0e50 ] );
98+
99+
x = new Float64Array( [ 1.0e150, 1.0e50, 1.0e150, 1.0e50 ] );
100+
101+
z = dnrm2( x.length, x, 1, 0 );
102+
isApprox( t, z, 1.4142135623730951e150, 1.0 );
103+
104+
x = new Float64Array( [ 1.0e-155, 1.0e50, 1.0e-155, 1.0e50 ] );
105+
106+
z = dnrm2( x.length, x, 1, 0 );
107+
isApprox( t, z, 1.4142135623730951e50, 1.0 );
108+
109+
x = new Float64Array( [ 1.4e-154, 1.5e-154, 1.4e-154, 0.0 ] );
110+
111+
z = dnrm2( x.length, x, 1, 0 );
112+
isApprox( t, z, 2.4839480006885204e-154, 1.0 );
113+
56114
t.end();
57115
});
58116

base/dnrm2/test/test.dnrm2.native.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ var resolve = require( 'path' ).resolve;
2424
var tape = require( 'tape' );
2525
var sqrt = require( '@stdlib/math/base/special/sqrt' );
2626
var Float64Array = require( '@stdlib/array/float64' );
27+
var EPS = require( '@stdlib/constants/float64/eps' );
28+
var abs = require( '@stdlib/math/base/special/abs' );
2729
var tryRequire = require( '@stdlib/utils/try-require' );
2830

2931

@@ -35,6 +37,35 @@ var opts = {
3537
};
3638

3739

40+
// FUNCTIONS //
41+
42+
/**
43+
* Tests for element-wise approximate equality.
44+
*
45+
* @private
46+
* @param {Object} t - test object
47+
* @param {Collection} actual - actual values
48+
* @param {Collection} expected - expected values
49+
* @param {number} rtol - relative tolerance
50+
*/
51+
function isApprox( t, actual, expected, rtol ) {
52+
var delta;
53+
var tol;
54+
var i;
55+
56+
t.strictEqual( actual.length, expected.length, 'returns expected value' );
57+
for ( i = 0; i < expected.length; i++ ) {
58+
if ( actual[ i ] === expected[ i ] ) {
59+
t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' );
60+
} else {
61+
delta = abs( actual[ i ] - expected[ i ] );
62+
tol = rtol * EPS * abs( expected[ i ] );
63+
t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' );
64+
}
65+
}
66+
}
67+
68+
3869
// TESTS //
3970

4071
tape( 'main export is a function', opts, function test( t ) {
@@ -62,6 +93,31 @@ tape( 'the function calculates the L2-norm of a vector', opts, function test( t
6293
z = dnrm2( x.length, x, 1 );
6394
t.strictEqual( z, 4.0, 'returns expected value' );
6495

96+
x = new Float64Array( [ 1.0e150, 1.0e150, 1.0e150, 1.0e150 ] );
97+
98+
z = dnrm2( x.length, x, 1 );
99+
t.strictEqual( z, 2.0e+150, 'returns expected value' );
100+
101+
x = new Float64Array( [ 1.0e-155, 1.0e-155, 1.0e-155, 1.0e-155 ] );
102+
103+
z = dnrm2( x.length, x, 1 );
104+
t.strictEqual( z, 2.0e-155, 'returns expected value' );
105+
106+
x = new Float64Array( [ 1.0e150, 1.0e50, 1.0e150, 1.0e50 ] );
107+
108+
z = dnrm2( x.length, x, 1, 0 );
109+
isApprox( t, z, 1.4142135623730951e150, 1.0 );
110+
111+
x = new Float64Array( [ 1.0e-155, 1.0e50, 1.0e-155, 1.0e50 ] );
112+
113+
z = dnrm2( x.length, x, 1, 0 );
114+
isApprox( t, z, 1.4142135623730951e50, 1.0 );
115+
116+
x = new Float64Array( [ 1.4e-154, 1.5e-154, 1.4e-154, 0.0 ] );
117+
118+
z = dnrm2( x.length, x, 1, 0 );
119+
isApprox( t, z, 2.4839480006885204e-154, 1.0 );
120+
65121
t.end();
66122
});
67123

base/dnrm2/test/test.ndarray.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,40 @@
2323
var tape = require( 'tape' );
2424
var sqrt = require( '@stdlib/math/base/special/sqrt' );
2525
var Float64Array = require( '@stdlib/array/float64' );
26+
var EPS = require( '@stdlib/constants/float64/eps' );
27+
var abs = require( '@stdlib/math/base/special/abs' );
2628
var dnrm2 = require( './../lib/ndarray.js' );
2729

2830

31+
// FUNCTIONS //
32+
33+
/**
34+
* Tests for element-wise approximate equality.
35+
*
36+
* @private
37+
* @param {Object} t - test object
38+
* @param {Collection} actual - actual values
39+
* @param {Collection} expected - expected values
40+
* @param {number} rtol - relative tolerance
41+
*/
42+
function isApprox( t, actual, expected, rtol ) {
43+
var delta;
44+
var tol;
45+
var i;
46+
47+
t.strictEqual( actual.length, expected.length, 'returns expected value' );
48+
for ( i = 0; i < expected.length; i++ ) {
49+
if ( actual[ i ] === expected[ i ] ) {
50+
t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' );
51+
} else {
52+
delta = abs( actual[ i ] - expected[ i ] );
53+
tol = rtol * EPS * abs( expected[ i ] );
54+
t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' );
55+
}
56+
}
57+
}
58+
59+
2960
// TESTS //
3061

3162
tape( 'main export is a function', function test( t ) {
@@ -53,6 +84,31 @@ tape( 'the function calculates the L2-norm of a vector', function test( t ) {
5384
z = dnrm2( x.length, x, 1, 0 );
5485
t.strictEqual( z, 4.0, 'returns expected value' );
5586

87+
x = new Float64Array( [ 1.0e150, 1.0e150, 1.0e150, 1.0e150 ] );
88+
89+
z = dnrm2( x.length, x, 1, 0 );
90+
t.strictEqual( z, 2.0e+150, 'returns expected value' );
91+
92+
x = new Float64Array( [ 1.0e-155, 1.0e-155, 1.0e-155, 1.0e-155 ] );
93+
94+
z = dnrm2( x.length, x, 1, 0 );
95+
t.strictEqual( z, 2.0e-155, 'returns expected value' );
96+
97+
x = new Float64Array( [ 1.0e150, 1.0e50, 1.0e150, 1.0e50 ] );
98+
99+
z = dnrm2( x.length, x, 1, 0 );
100+
isApprox( t, z, 1.4142135623730951e150, 1.0 );
101+
102+
x = new Float64Array( [ 1.0e-155, 1.0e50, 1.0e-155, 1.0e50 ] );
103+
104+
z = dnrm2( x.length, x, 1, 0 );
105+
isApprox( t, z, 1.4142135623730951e50, 1.0 );
106+
107+
x = new Float64Array( [ 1.4e-154, 1.5e-154, 1.4e-154, 0.0 ] );
108+
109+
z = dnrm2( x.length, x, 1, 0 );
110+
isApprox( t, z, 2.4839480006885204e-154, 1.0 );
111+
56112
t.end();
57113
});
58114

base/dnrm2/test/test.ndarray.native.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ var resolve = require( 'path' ).resolve;
2424
var tape = require( 'tape' );
2525
var sqrt = require( '@stdlib/math/base/special/sqrt' );
2626
var Float64Array = require( '@stdlib/array/float64' );
27+
var EPS = require( '@stdlib/constants/float64/eps' );
28+
var abs = require( '@stdlib/math/base/special/abs' );
2729
var tryRequire = require( '@stdlib/utils/try-require' );
2830

2931

@@ -35,6 +37,35 @@ var opts = {
3537
};
3638

3739

40+
// FUNCTIONS //
41+
42+
/**
43+
* Tests for element-wise approximate equality.
44+
*
45+
* @private
46+
* @param {Object} t - test object
47+
* @param {Collection} actual - actual values
48+
* @param {Collection} expected - expected values
49+
* @param {number} rtol - relative tolerance
50+
*/
51+
function isApprox( t, actual, expected, rtol ) {
52+
var delta;
53+
var tol;
54+
var i;
55+
56+
t.strictEqual( actual.length, expected.length, 'returns expected value' );
57+
for ( i = 0; i < expected.length; i++ ) {
58+
if ( actual[ i ] === expected[ i ] ) {
59+
t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' );
60+
} else {
61+
delta = abs( actual[ i ] - expected[ i ] );
62+
tol = rtol * EPS * abs( expected[ i ] );
63+
t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' );
64+
}
65+
}
66+
}
67+
68+
3869
// TESTS //
3970

4071
tape( 'main export is a function', opts, function test( t ) {
@@ -62,6 +93,31 @@ tape( 'the function calculates the L2-norm of a vector', opts, function test( t
6293
z = dnrm2( x.length, x, 1, 0 );
6394
t.strictEqual( z, 4.0, 'returns expected value' );
6495

96+
x = new Float64Array( [ 1.0e150, 1.0e150, 1.0e150, 1.0e150 ] );
97+
98+
z = dnrm2( x.length, x, 1, 0 );
99+
t.strictEqual( z, 2.0e+150, 'returns expected value' );
100+
101+
x = new Float64Array( [ 1.0e-155, 1.0e-155, 1.0e-155, 1.0e-155 ] );
102+
103+
z = dnrm2( x.length, x, 1, 0 );
104+
t.strictEqual( z, 2.0e-155, 'returns expected value' );
105+
106+
x = new Float64Array( [ 1.0e150, 1.0e50, 1.0e150, 1.0e50 ] );
107+
108+
z = dnrm2( x.length, x, 1, 0 );
109+
isApprox( t, z, 1.4142135623730951e150, 1.0 );
110+
111+
x = new Float64Array( [ 1.0e-155, 1.0e50, 1.0e-155, 1.0e50 ] );
112+
113+
z = dnrm2( x.length, x, 1, 0 );
114+
isApprox( t, z, 1.4142135623730951e50, 1.0 );
115+
116+
x = new Float64Array( [ 1.4e-154, 1.5e-154, 1.4e-154, 0.0 ] );
117+
118+
z = dnrm2( x.length, x, 1, 0 );
119+
isApprox( t, z, 2.4839480006885204e-154, 1.0 );
120+
65121
t.end();
66122
});
67123

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+
}

0 commit comments

Comments
 (0)