Skip to content

Commit 95a9a97

Browse files
committed
chore: clean-up
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: passed - task: lint_c_benchmarks status: passed - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent f933ec8 commit 95a9a97

19 files changed

Lines changed: 152 additions & 133 deletions

File tree

lib/node_modules/@stdlib/blas/ext/base/drrss/README.md

Lines changed: 33 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,22 @@ limitations under the License.
2020

2121
# drrss
2222

23-
> Calculate the square root of the [residual sum of squares][residual sum of squares] of two double-precision floating-point vectors.
23+
> Calculate the square root of the [residual sum of squares][wikipedia-residual-sum-of-squares] of two double-precision floating-point strided arrays.
2424
2525
<section class="intro">
2626

27-
The square root of the [residual sum of squares][residual sum of squares] is defined as
27+
The square root of the [residual sum of squares][wikipedia-residual-sum-of-squares] is defined as
2828

2929
<!-- <equation class="equation" label="eq:sqrt_of_residual_sum_of_squares" align="center" raw="d = \sqrt{\sum_{i=0}^{N-1} (y_i - x_i)^2}" alt="Equation for the square root of residual sum of squares."> -->
3030

31-
<div class="equation" align="center" data-raw-text="\d = \sqrt{\sum_{i=0}^{N-1} (y_i - x_i)^2}" data-equation="eq:sqrt_rss">
32-
<img src="./docs/img/drrss.svg" alt="Square root of residual sum of squares.">
33-
<br>
34-
</div>
31+
```math
32+
d = \sqrt{\sum_{i=0}^{N-1} (y_i - x_i)^2}
33+
```
3534

35+
<!-- <div class="equation" align="center" data-raw-text="d = \sqrt{\sum_{i=0}^{N-1} (y_i - x_i)^2}" data-equation="eq:sqrt_of_residual_sum_of_squares">
36+
<img src="" alt="Square root of residual sum of squares.">
37+
<br>
38+
</div> -->
3639

3740
<!-- </equation> -->
3841

@@ -50,7 +53,7 @@ var drrss = require( '@stdlib/blas/ext/base/drrss' );
5053

5154
#### drrss( N, x, strideX, y, strideY )
5255

53-
Computes the square root of the [residual sum of squares][residual sum of squares] of two double-precision floating-point vectors `x` and `y`.
56+
Computes the square root of the [residual sum of squares][wikipedia-residual-sum-of-squares] of two double-precision floating-point strided arrays.
5457

5558
```javascript
5659
var Float64Array = require( '@stdlib/array/float64' );
@@ -66,11 +69,11 @@ The function has the following parameters:
6669

6770
- **N**: number of indexed elements.
6871
- **x**: first input [`Float64Array`][@stdlib/array/float64].
69-
- **strideX**: index increment for `x`.
72+
- **strideX**: stride length for `x`.
7073
- **y**: second input [`Float64Array`][@stdlib/array/float64].
71-
- **strideY**: index increment for `y`.
74+
- **strideY**: stride length for `y`.
7275

73-
The `N`, `strideX` and `strideY` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the [residual sum of squares][residual sum of squares] of every other element in `x` and `y`
76+
The `N` and stride parameters determine which elements in strided arrays are accessed at runtime. For example, to compute the [residual sum of squares][wikipedia-residual-sum-of-squares] of every other element in `x` and `y`
7477

7578
```javascript
7679
var Float64Array = require( '@stdlib/array/float64' );
@@ -82,8 +85,7 @@ var z = drrss( x.length, x, 1, y, 1 );
8285
// returns ~8.485
8386
```
8487

85-
Note that indexing is relative to the first index. To introduce an offset,
86-
use [`typed array`][mdn-typed-array] views.
88+
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
8789

8890
<!-- eslint-disable stdlib/capitalized-comments -->
8991

@@ -104,7 +106,7 @@ If `N` is less than or equal to `0`, the function returns `0`.
104106

105107
#### drrss.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )
106108

107-
Computes the square root of the [residual sum of squares][residual sum of squares] of two double-precision floating-point vectors using alternative indexing semantics.
109+
Computes the square root of the [residual sum of squares][wikipedia-residual-sum-of-squares] of two double-precision floating-point strided arrays using alternative indexing semantics.
108110

109111
```javascript
110112
var Float64Array = require( '@stdlib/array/float64' );
@@ -121,7 +123,7 @@ The function has the following additional parameters:
121123
- **offsetX**: starting index for `x`.
122124
- **offsetY**: starting index for `y`.
123125

124-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the `offset` parameter supports indexing semantics based on a starting index. For example, to calculate the [residual sum of squares][residual sum of squares] for every other value in `x` and `y` starting from the second value
126+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to calculate the square root of the [residual sum of squares][wikipedia-residual-sum-of-squares] for every other element in `x` and `y` starting from the second element
125127

126128
```javascript
127129
var Float64Array = require( '@stdlib/array/float64' );
@@ -200,58 +202,58 @@ console.log( d );
200202
#include "stdlib/blas/ext/base/drrss.h"
201203
```
202204

203-
#### stdlib_blas_ext_base_drrss( N, \*X, strideX, \*Y, strideY )
205+
#### stdlib_strided_drrss( N, \*X, strideX, \*Y, strideY )
204206

205-
Computes the square root of the residual sum of squares of two double-precision floating-point vectors.
207+
Computes the square root of the [residual sum of squares][wikipedia-residual-sum-of-squares] of two double-precision floating-point strided arrays.
206208

207209
```c
208210
const double x[] = { 1.0, -2.0, 2.0 };
209211
const double y[] = { 1.0, 1.0, -4.0 };
210212

211-
double z = stdlib_blas_ext_base_drrss( 3, x, 1, y, 1 );
213+
double z = stdlib_strided_drrss( 3, x, 1, y, 1 );
212214
// returns ~6.7
213215
```
214216
215217
The function accepts the following arguments:
216218
217219
- **N**: `[in] CBLAS_INT` number of indexed elements.
218220
- **X**: `[in] double*` first input array.
219-
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
221+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
220222
- **Y**: `[in] double*` second input array.
221-
- **strideY**: `[in] CBLAS_INT` index increment for `Y`.
223+
- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
222224
223225
```c
224-
double stdlib_blas_ext_base_drrss( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const double *Y, const CBLAS_INT strideY );
226+
double stdlib_strided_drrss( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const double *Y, const CBLAS_INT strideY );
225227
```
226228

227229
<!--lint ignore maximum-heading-length-->
228230

229-
#### stdlib_blas_ext_base_drrss_ndarray( N, \*X, strideX, offsetX, \*Y, strideY, offsetY )
231+
#### stdlib_strided_drrss_ndarray( N, \*X, strideX, offsetX, \*Y, strideY, offsetY )
230232

231233
<!--lint enable maximum-heading-length-->
232234

233-
Computes the square root of the residual sum of squares of two double-precision floating-point vectors using alternative indexing semantics.
235+
Computes the square root of the [residual sum of squares][wikipedia-residual-sum-of-squares] of two double-precision floating-point strided arrays using alternative indexing semantics.
234236

235237
```c
236238
const double x[] = { 1.0, -2.0, 2.0 };
237239
const double y[] = { 1.0, 1.0, -4.0 };
238240

239-
double v = stdlib_blas_ext_base_drrss_ndarray( 3, x, 1, 0, 1, 0 );
241+
double v = stdlib_strided_drrss_ndarray( 3, x, 1, 0, 1, 0 );
240242
// returns ~6.7
241243
```
242244
243245
The function accepts the following arguments:
244246
245247
- **N**: `[in] CBLAS_INT` number of indexed elements.
246248
- **X**: `[in] double*` first input array.
247-
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
249+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
248250
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
249251
- **Y**: `[in] double*` second input array.
250-
- **strideY**: `[in] CBLAS_INT` index increment for `Y`.
252+
- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
251253
- **offsetY**: `[in] CBLAS_INT` starting index for `Y`.
252254
253255
```c
254-
double stdlib_blas_ext_base_drrss_ndarray( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY );
256+
double stdlib_strided_drrss_ndarray( const CBLAS_INT N, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY );
255257
```
256258

257259
</section>
@@ -273,7 +275,7 @@ double stdlib_blas_ext_base_drrss_ndarray( const CBLAS_INT N, const double *X, c
273275
### Examples
274276

275277
```c
276-
#include "stdlib/blas/base/drrss.h"
278+
#include "stdlib/blas/ext/base/drrss.h"
277279
#include <stdio.h>
278280

279281
int main( void ) {
@@ -289,17 +291,17 @@ int main( void ) {
289291
const int strideY = 1;
290292

291293
// Compute the square root of the residual sum of squares of `x` and `y`:
292-
double d = stdlib_blas_ext_base_drrss( N, x, strideX, y, strideY );
294+
double d = stdlib_strided_drrss( N, x, strideX, y, strideY );
293295

294296
// Print the result:
295297
printf( "drrss: %lf\n", d );
296298

297-
// Specify the offsets
299+
// Specify index offsets:
298300
const int offsetX = 1;
299301
const int offsetY = 1;
300302

301303
// Compute the square root of the residual sum of squares of `x` and `y` with offsets:
302-
d = stdlib_blas_ext_base_drrss_ndarray( N, x, strideX, offsetX, y, strideY, offsetY );
304+
d = stdlib_strided_drrss_ndarray( N, x, strideX, offsetX, y, strideY, offsetY );
303305

304306
// Print the result:
305307
printf( "drrss: %lf\n", d );
@@ -318,11 +320,6 @@ int main( void ) {
318320
319321
<section class="related">
320322
321-
* * *
322-
323-
## See Also
324-
325-
326323
</section>
327324
328325
<!-- /.related -->
@@ -331,17 +328,12 @@ int main( void ) {
331328
332329
<section class="links">
333330
334-
[residual sum of squares]: https://en.wikipedia.org/wiki/Residual_sum_of_squares
331+
[wikipedia-residual-sum-of-squares]: https://en.wikipedia.org/wiki/Residual_sum_of_squares
335332
336333
[@stdlib/array/float64]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/array/float64
337334
338335
[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
339336
340-
<!-- <related-links> -->
341-
342-
343-
<!-- </related-links> -->
344-
345337
</section>
346338
347339
<!-- /.links -->

lib/node_modules/@stdlib/blas/ext/base/drrss/benchmark/c/benchmark.length.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ static double benchmark1( int iterations, int len ) {
110110
t = tic();
111111
for ( i = 0; i < iterations; i++ ) {
112112
// cppcheck-suppress uninitvar
113-
v = stdlib_blas_ext_base_drrss( len, x, 1, y, 1 );
113+
v = stdlib_strided_drrss( len, x, 1, y, 1 );
114114
if ( v != v ) {
115115
printf( "should not return NaN\n" );
116116
break;
@@ -146,7 +146,7 @@ static double benchmark2( int iterations, int len ) {
146146
t = tic();
147147
for ( i = 0; i < iterations; i++ ) {
148148
// cppcheck-suppress uninitvar
149-
v = stdlib_blas_ext_base_drrss_ndarray( len, x, 1, 0, y, 1, 0 );
149+
v = stdlib_strided_drrss_ndarray( len, x, 1, 0, y, 1, 0 );
150150
if ( v != v ) {
151151
printf( "should not return NaN\n" );
152152
break;

lib/node_modules/@stdlib/blas/ext/base/drrss/docs/img/drrss.svg

Lines changed: 0 additions & 2 deletions
This file was deleted.

lib/node_modules/@stdlib/blas/ext/base/drrss/docs/repl.txt

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11

22
{{alias}}( N, x, strideX, y, strideY )
3-
Computes the square root of the residual sum of squares of two
4-
double-precision floating-point vectors.
3+
Computes the square root of the residual sum of squares of two double-
4+
precision floating-point strided arrays.
55

6-
The `N` and stride parameters determine which elements in the strided
7-
arrays are accessed at runtime.
6+
The `N` and stride parameters determine which elements in the strided arrays
7+
are accessed at runtime.
88

9-
Indexing is relative to the first index. To introduce an offset, use a
10-
typed array view.
9+
Indexing is relative to the first index. To introduce an offset, use a typed
10+
array view.
1111

1212
If `N <= 0`, the function returns `0`.
1313

@@ -30,8 +30,8 @@
3030

3131
Returns
3232
-------
33-
drrss: number
34-
The square root of the residual sum of squares.
33+
out: number
34+
Square root of the residual sum of squares.
3535

3636
Examples
3737
--------
@@ -50,22 +50,20 @@
5050
// Using view offsets:
5151
> var x0 = new {{alias:@stdlib/array/float64}}( [ 2.0, 1.0, 2.0, -2.0 ] );
5252
> var y0 = new {{alias:@stdlib/array/float64}}( [ 8.0, -2.0, 3.0, -2.0 ] );
53-
> var x0bpe = x0.BYTES_PER_ELEMENT*1;
54-
> var y0bpe = y0.BYTES_PER_ELEMENT*1;
55-
> var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0bpe );
56-
> var y1 = new {{alias:@stdlib/array/float64}}( y0.buffer, y0bpe );
53+
> var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
54+
> var y1 = new {{alias:@stdlib/array/float64}}( y0.buffer, y0.BYTES_PER_ELEMENT*1 );
5755
> {{alias}}( 2, x1, 2, y1, 2 )
5856
3
5957

6058

6159
{{alias}}.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )
62-
Computes the square root of the residual sum of squares of
63-
two double-precision floating-point vectors using alternative
64-
indexing semantics.
60+
Computes the square root of the residual sum of squares of two double-
61+
precision floating-point strided arrays using alternative indexing
62+
semantics.
6563

6664
While typed array views mandate a view offset based on the underlying
67-
buffer, the `offset` parameter supports indexing semantics based on a
68-
starting index.
65+
buffer, the offset parameters support indexing semantics based on starting
66+
indices.
6967

7068
Parameters
7169
----------
@@ -92,8 +90,8 @@
9290

9391
Returns
9492
-------
95-
drrss: number
96-
The square root of the residual sum of squares.
93+
out: number
94+
Square root of the residual sum of squares.
9795

9896
Examples
9997
--------
@@ -103,11 +101,12 @@
103101
> {{alias}}.ndarray( x.length, x, 1, 0, y, 1, 0 )
104102
~18.11
105103

106-
// Using offset parameter:
107-
> var x = new {{alias:@stdlib/array/float64}}([ 2.0, 1.0, 2.0, -2.0 ]);
108-
> var y = new {{alias:@stdlib/array/float64}}([ 8.0, -2.0, 3.0, -2.0 ]);
104+
// Using offset parameters:
105+
> x = new {{alias:@stdlib/array/float64}}([ 2.0, 1.0, 2.0, -2.0 ]);
106+
> y = new {{alias:@stdlib/array/float64}}([ 8.0, -2.0, 3.0, -2.0 ]);
109107
> {{alias}}.ndarray( 2, x, 2, 1, y, 2, 1 )
110108
3
111109

112110
See Also
113111
--------
112+

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

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
*/
2424
interface Routine {
2525
/**
26-
* Computes the square root of the residual sum of squares of two double-precision floating-point vectors.
26+
* Computes the square root of the residual sum of squares of two double-precision floating-point strided arrays.
2727
*
28-
* @param {PositiveInteger} N - number of indexed elements
29-
* @param {Float64Array} x - first input array
30-
* @param {integer} strideX - stride length of `x`
31-
* @param {Float64Array} y - second input array
32-
* @param {integer} strideY - stride length of `y`
33-
* @returns {number} square root of the residual sum of squares
28+
* @param N - number of indexed elements
29+
* @param x - first input array
30+
* @param strideX - stride length of `x`
31+
* @param y - second input array
32+
* @param strideY - stride length of `y`
33+
* @returns square root of the residual sum of squares
3434
*
3535
* @example
3636
* var Float64Array = require( '@stdlib/array/float64' );
@@ -44,33 +44,38 @@ interface Routine {
4444
( N: number, x: Float64Array, strideX: number, y: Float64Array, strideY: number ): number;
4545

4646
/**
47-
* Computes the square root of the residual sum of squares of two double-precision floating-point vectors using alternative indexing semantics.
47+
* Computes the square root of the residual sum of squares of two double-precision floating-point strided arrays using alternative indexing semantics.
4848
*
49-
* @param {PositiveInteger} N - number of indexed elements
50-
* @param {Float64Array} x - first input array
51-
* @param {integer} strideX - stride length of `x`
52-
* @param {NonNegativeInteger} offsetX - starting index of `x`
53-
* @param {Float64Array} y - second input array
54-
* @param {integer} strideY - stride length of `y`
55-
* @param {NonNegativeInteger} offsetY - starting index of `y`
56-
* @returns {number} square root of the residual sum of squares
49+
* @param N - number of indexed elements
50+
* @param x - first input array
51+
* @param strideX - stride length of `x`
52+
* @param offsetX - starting index of `x`
53+
* @param y - second input array
54+
* @param strideY - stride length of `y`
55+
* @param offsetY - starting index of `y`
56+
* @returns square root of the residual sum of squares
5757
*
5858
* @example
5959
* var Float64Array = require( '@stdlib/array/float64' );
6060
*
6161
* var x = new Float64Array( [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ] );
6262
* var y = new Float64Array( [ 2.0, 1.0, 2.0, 1.0, -2.0, 2.0, 3.0, 4.0 ] );
6363
*
64-
* var z = drrss( x.length, x, 1, y, 1 );
64+
* var z = drrss.ndarray( x.length, x, 1, 0, y, 1, 0 );
6565
* // returns ~8.485
6666
*/
6767
ndarray( N: number, x: Float64Array, strideX: number, offsetX: number, y: Float64Array, strideY: number, offsetY: number ): number;
6868
}
6969

7070
/**
71-
* Compute the square root of the residual sum of squares of two double-precision floating-point vectors.
71+
* Compute the square root of the residual sum of squares of two double-precision floating-point strided arrays.
7272
*
73-
* @module @stdlib/blas/ext/base/drrss
73+
* @param N - number of indexed elements
74+
* @param x - first input array
75+
* @param strideX - stride length of `x`
76+
* @param y - second input array
77+
* @param strideY - stride length of `y`
78+
* @returns square root of the residual sum of squares
7479
*
7580
* @example
7681
* var Float64Array = require( '@stdlib/array/float64' );

0 commit comments

Comments
 (0)