Skip to content

Commit c51bad4

Browse files
committed
Auto-generated commit
1 parent 09701bb commit c51bad4

File tree

8 files changed

+168
-0
lines changed

8 files changed

+168
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4754,6 +4754,10 @@ A total of 18 people contributed to this release. Thank you to the following con
47544754

47554755
<details>
47564756

4757+
- [`9b76065`](https://github.com/stdlib-js/stdlib/commit/9b76065b017415494be482c0a085afda2e526a77) - **test:** add test cases for `blas/base/dsyr` [(#6729)](https://github.com/stdlib-js/stdlib/pull/6729) _(by Shabareesh Shetty)_
4758+
- [`b25755a`](https://github.com/stdlib-js/stdlib/commit/b25755aec061fdb02888f6e1cb400cec6aae8293) - **test:** add test cases for `blas/base/dsyr2` [(#6731)](https://github.com/stdlib-js/stdlib/pull/6731) _(by Shabareesh Shetty)_
4759+
- [`899dd17`](https://github.com/stdlib-js/stdlib/commit/899dd17a577e2158b040bb7d9464fb8a79e38d59) - **docs:** document exceptions in `blas/base/sgemm` [(#6746)](https://github.com/stdlib-js/stdlib/pull/6746) _(by Shabareesh Shetty)_
4760+
- [`4bf2683`](https://github.com/stdlib-js/stdlib/commit/4bf26831b85d4bd29ac6365a908302f792711d54) - **test:** add test cases for `blas/base/ssyr2` [(#6730)](https://github.com/stdlib-js/stdlib/pull/6730) _(by Shabareesh Shetty)_
47574761
- [`dae553b`](https://github.com/stdlib-js/stdlib/commit/dae553bfe3c1f0d651b07eda1b36e87a516df7ef) - **feat:** add `blas/base/wasm/dsdot` [(#6751)](https://github.com/stdlib-js/stdlib/pull/6751) _(by Shabareesh Shetty, stdlib-bot)_
47584762
- [`bf46e99`](https://github.com/stdlib-js/stdlib/commit/bf46e995c93ababb1eb49a635f1616697471b70a) - **style:** remove unused import [(#6781)](https://github.com/stdlib-js/stdlib/pull/6781) _(by Shabareesh Shetty)_
47594763
- [`43bfc6b`](https://github.com/stdlib-js/stdlib/commit/43bfc6bc1d850367f3957fdb550c40d25c6f0e62) - **fix:** include value in error message _(by Athan Reines)_

base/dsyr/lib/ndarray.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ var base = require( './base.js' );
4343
* @throws {TypeError} first argument must specify whether to reference the lower or upper triangular matrix
4444
* @throws {RangeError} second argument must be a nonnegative integer
4545
* @throws {RangeError} fifth argument must be non-zero
46+
* @throws {RangeError} eighth argument must be non-zero
47+
* @throws {RangeError} ninth argument must be non-zero
4648
* @returns {Float64Array} `A`
4749
*
4850
* @example
@@ -64,6 +66,12 @@ function dsyr( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offse
6466
if ( strideX === 0 ) {
6567
throw new RangeError( format( 'invalid argument. Fifth argument must be non-zero. Value: `%d`.', strideX ) );
6668
}
69+
if ( strideA1 === 0 ) {
70+
throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideA1 ) );
71+
}
72+
if ( strideA2 === 0 ) {
73+
throw new RangeError( format( 'invalid argument. Ninth argument must be non-zero. Value: `%d`.', strideA2 ) );
74+
}
6775
if ( N === 0 || alpha === 0.0 ) {
6876
return A;
6977
}

base/dsyr/test/test.ndarray.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,52 @@ tape( 'the function throws an error if provided an invalid fifth argument', func
139139
}
140140
});
141141

142+
tape( 'the function throws an error if provided an invalid eighth argument', function test( t ) {
143+
var values;
144+
var data;
145+
var i;
146+
147+
data = ru;
148+
149+
values = [
150+
0
151+
];
152+
153+
for ( i = 0; i < values.length; i++ ) {
154+
t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
155+
}
156+
t.end();
157+
158+
function badValue( value ) {
159+
return function badValue() {
160+
dsyr( data.uplo, data.N, data.alpha, new Float64Array( data.x ), data.strideX, data.offsetX, new Float64Array( data.A ), value, data.strideA2, data.offsetA );
161+
};
162+
}
163+
});
164+
165+
tape( 'the function throws an error if provided an invalid ninth argument', function test( t ) {
166+
var values;
167+
var data;
168+
var i;
169+
170+
data = ru;
171+
172+
values = [
173+
0
174+
];
175+
176+
for ( i = 0; i < values.length; i++ ) {
177+
t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
178+
}
179+
t.end();
180+
181+
function badValue( value ) {
182+
return function badValue() {
183+
dsyr( data.uplo, data.N, data.alpha, new Float64Array( data.x ), data.strideX, data.offsetX, new Float64Array( data.A ), data.strideA1, value, data.offsetA );
184+
};
185+
}
186+
});
187+
142188
tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (row-major, upper)', function test( t ) {
143189
var expected;
144190
var data;

base/dsyr2/lib/ndarray.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ var base = require( './base.js' );
4747
* @throws {RangeError} second argument must be a nonnegative integer
4848
* @throws {RangeError} fifth argument must be non-zero
4949
* @throws {RangeError} eighth argument must be non-zero
50+
* @throws {RangeError} eleventh argument must be non-zero
51+
* @throws {RangeError} twelfth argument must be non-zero
5052
* @returns {Float64Array} `A`
5153
*
5254
* @example
@@ -72,6 +74,12 @@ function dsyr2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, str
7274
if ( strideY === 0 ) {
7375
throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideY ) );
7476
}
77+
if ( strideA1 === 0 ) {
78+
throw new RangeError( format( 'invalid argument. Eleventh argument must be non-zero. Value: `%d`.', strideA1 ) );
79+
}
80+
if ( strideA2 === 0 ) {
81+
throw new RangeError( format( 'invalid argument. Twelfth argument must be non-zero. Value: `%d`.', strideA2 ) );
82+
}
7583
if ( N === 0 || alpha === 0.0 ) {
7684
return A;
7785
}

base/dsyr2/test/test.ndarray.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,52 @@ tape( 'the function throws an error if provided an invalid eighth argument', fun
168168
}
169169
});
170170

171+
tape( 'the function throws an error if provided an invalid eleventh argument', function test( t ) {
172+
var values;
173+
var data;
174+
var i;
175+
176+
data = ru;
177+
178+
values = [
179+
0
180+
];
181+
182+
for ( i = 0; i < values.length; i++ ) {
183+
t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
184+
}
185+
t.end();
186+
187+
function badValue( value ) {
188+
return function badValue() {
189+
dsyr2( data.uplo, data.N, data.alpha, new Float64Array( data.x ), data.strideX, data.offsetX, new Float64Array( data.y ), data.strideY, data.offsetY, new Float64Array( data.A ), value, data.strideA2, data.offsetA );
190+
};
191+
}
192+
});
193+
194+
tape( 'the function throws an error if provided an invalid twelfth argument', function test( t ) {
195+
var values;
196+
var data;
197+
var i;
198+
199+
data = ru;
200+
201+
values = [
202+
0
203+
];
204+
205+
for ( i = 0; i < values.length; i++ ) {
206+
t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
207+
}
208+
t.end();
209+
210+
function badValue( value ) {
211+
return function badValue() {
212+
dsyr2( data.uplo, data.N, data.alpha, new Float64Array( data.x ), data.strideX, data.offsetX, new Float64Array( data.y ), data.strideY, data.offsetY, new Float64Array( data.A ), data.strideA1, value, data.offsetA );
213+
};
214+
}
215+
});
216+
171217
tape( 'the function performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` (row-major, upper)', function test( t ) {
172218
var expected;
173219
var data;

base/sgemm/lib/ndarray.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ var base = require( './base.js' );
5454
* @throws {RangeError} third argument must be a nonnegative integer
5555
* @throws {RangeError} fourth argument must be a nonnegative integer
5656
* @throws {RangeError} fifth argument must be a nonnegative integer
57+
* @throws {RangeError} seventeenth argument must be non-zero
58+
* @throws {RangeError} eighteenth argument must be non-zero
5759
* @returns {Float32Array} `C`
5860
*
5961
* @example

base/ssyr2/lib/ndarray.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ var base = require( './base.js' );
4747
* @throws {RangeError} second argument must be a nonnegative integer
4848
* @throws {RangeError} fifth argument must be non-zero
4949
* @throws {RangeError} eighth argument must be non-zero
50+
* @throws {RangeError} eleventh argument must be non-zero
51+
* @throws {RangeError} twelfth argument must be non-zero
5052
* @returns {Float32Array} `A`
5153
*
5254
* @example
@@ -72,6 +74,12 @@ function ssyr2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, str
7274
if ( strideY === 0 ) {
7375
throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideY ) );
7476
}
77+
if ( strideA1 === 0 ) {
78+
throw new RangeError( format( 'invalid argument. Eleventh argument must be non-zero. Value: `%d`.', strideA1 ) );
79+
}
80+
if ( strideA2 === 0 ) {
81+
throw new RangeError( format( 'invalid argument. Twelfth argument must be non-zero. Value: `%d`.', strideA2 ) );
82+
}
7583
if ( N === 0 || alpha === 0.0 ) {
7684
return A;
7785
}

base/ssyr2/test/test.ndarray.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,52 @@ tape( 'the function throws an error if provided an invalid eighth argument', fun
168168
}
169169
});
170170

171+
tape( 'the function throws an error if provided an invalid eleventh argument', function test( t ) {
172+
var values;
173+
var data;
174+
var i;
175+
176+
data = ru;
177+
178+
values = [
179+
0
180+
];
181+
182+
for ( i = 0; i < values.length; i++ ) {
183+
t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
184+
}
185+
t.end();
186+
187+
function badValue( value ) {
188+
return function badValue() {
189+
ssyr2( data.uplo, data.N, data.alpha, new Float32Array( data.x ), data.strideX, data.offsetX, new Float32Array( data.y ), data.strideY, data.offsetY, new Float32Array( data.A ), value, data.strideA2, data.offsetA );
190+
};
191+
}
192+
});
193+
194+
tape( 'the function throws an error if provided an invalid twelfth argument', function test( t ) {
195+
var values;
196+
var data;
197+
var i;
198+
199+
data = ru;
200+
201+
values = [
202+
0
203+
];
204+
205+
for ( i = 0; i < values.length; i++ ) {
206+
t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] );
207+
}
208+
t.end();
209+
210+
function badValue( value ) {
211+
return function badValue() {
212+
ssyr2( data.uplo, data.N, data.alpha, new Float32Array( data.x ), data.strideX, data.offsetX, new Float32Array( data.y ), data.strideY, data.offsetY, new Float32Array( data.A ), data.strideA1, value, data.offsetA );
213+
};
214+
}
215+
});
216+
171217
tape( 'the function performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` (row-major, upper)', function test( t ) {
172218
var expected;
173219
var data;

0 commit comments

Comments
 (0)