Skip to content

Commit 8dc22d7

Browse files
saurabhraghuvanshiikgryteheadlessNodestdlib-bot
authored
refactor: update blas/base/gscal to follow current project conventions
PR-URL: stdlib-js#5447 Closes: stdlib-js#5440 Co-authored-by: Athan Reines <[email protected]> Co-authored-by: Muhammad Haris <[email protected]> Co-authored-by: stdlib-bot <[email protected]> Reviewed-by: Athan Reines <[email protected]> Reviewed-by: Muhammad Haris <[email protected]>
1 parent b236546 commit 8dc22d7

File tree

7 files changed

+43
-43
lines changed

7 files changed

+43
-43
lines changed

lib/node_modules/@stdlib/blas/base/gscal/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# gscal
2222

23-
> Multiply a vector `x` by a constant `alpha`.
23+
> Multiply a vector by a scalar constant.
2424
2525
<section class="usage">
2626

@@ -32,7 +32,7 @@ var gscal = require( '@stdlib/blas/base/gscal' );
3232

3333
#### gscal( N, alpha, x, stride )
3434

35-
Multiplies a vector `x` by a constant `alpha`.
35+
Multiplies a vector by a scalar constant.
3636

3737
```javascript
3838
var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];
@@ -46,9 +46,9 @@ The function has the following parameters:
4646
- **N**: number of indexed elements.
4747
- **alpha**: scalar constant.
4848
- **x**: input [`Array`][mdn-array] or [`typed array`][mdn-typed-array].
49-
- **stride**: index increment.
49+
- **stride**: stride length.
5050

51-
The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to multiply every other value by a constant
51+
The `N` and stride parameters determine which elements in the strided array are accessed at runtime. For example, to multiply every other value by a scalar constant:
5252

5353
```javascript
5454
var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];
@@ -77,7 +77,7 @@ If either `N` or `stride` is less than or equal to `0`, the function returns `x`
7777

7878
#### gscal.ndarray( N, alpha, x, stride, offset )
7979

80-
Multiplies a vector `x` by a constant `alpha` using alternative indexing semantics.
80+
Multiplies a vector by a scalar constant using alternative indexing semantics.
8181

8282
```javascript
8383
var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];
@@ -90,7 +90,7 @@ The function has the following additional parameters:
9090

9191
- **offset**: starting index.
9292

93-
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 multiply the last three elements of `x` by a constant
93+
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 multiply the last three elements:
9494

9595
```javascript
9696
var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];

lib/node_modules/@stdlib/blas/base/gscal/docs/repl.txt

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11

2-
{{alias}}( N, alpha, x, stride )
3-
Multiplies a vector `x` by a constant `alpha`.
2+
{{alias}}( N, alpha, x, strideX )
3+
Multiplies a vector by a scalar constant.
44

5-
The `N` and `stride` parameters determine which elements in `x` are accessed
6-
at runtime.
5+
The `N` and stride parameters determine which elements in the strided array
6+
are accessed at runtime.
77

88
Indexing is relative to the first index. To introduce an offset, use typed
99
array views.
1010

11-
If `N <= 0` or `stride <= 0`, the function returns `x` unchanged.
11+
If `N <= 0`, the function returns `x` unchanged.
1212

1313
Parameters
1414
----------
1515
N: integer
1616
Number of indexed elements.
1717

1818
alpha: number
19-
Constant.
19+
Scalar constant.
2020

2121
x: Array<number>|TypedArray
2222
Input array.
2323

24-
stride: integer
25-
Index increment for `x`.
24+
strideX: integer
25+
Stride length.
2626

2727
Returns
2828
-------
@@ -32,12 +32,11 @@
3232
Examples
3333
--------
3434
// Standard Usage:
35-
> var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, -1.0, -3.0 ];
36-
> var alpha = 5.0;
37-
> {{alias}}( x.length, alpha, x, 1 )
38-
[ -10.0, 5.0, 15.0, -25.0, 20.0, -5.0, -15.0 ]
35+
> var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];
36+
> {{alias}}( x.length, 5.0, x, 1 )
37+
[ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]
3938

40-
// Using `N` and `stride` parameters:
39+
// Using `N` and stride parameters:
4140
> x = [ -2.0, 1.0, 3.0, -5.0, 4.0, -1.0, -3.0 ];
4241
> {{alias}}( 3, 5.0, x, 2 )
4342
[ -10.0, 1.0, 15.0, -5.0, 20.0, -1.0, -3.0 ]
@@ -51,29 +50,30 @@
5150
<Float64Array>[ 1.0, -10.0, 3.0, -20.0, 5.0, -30.0 ]
5251

5352

54-
{{alias}}.ndarray( N, alpha, x, stride, offset )
55-
Multiplies `x` by a constant `alpha` using alternative indexing semantics.
53+
{{alias}}.ndarray( N, alpha, x, strideX, offsetX )
54+
Multiplies a vector by a scalar constant using alternative indexing
55+
semantics.
5656

5757
While typed array views mandate a view offset based on the underlying
58-
buffer, the `offset` parameter supports indexing semantics based on a
59-
starting index.
58+
buffer, the offset parameter supports indexing semantics based on a starting
59+
index.
6060

6161
Parameters
6262
----------
6363
N: integer
6464
Number of indexed elements.
6565

6666
alpha: number
67-
Constant.
67+
Scalar constant.
6868

6969
x: Array<number>|TypedArray
7070
Input array.
7171

72-
stride: integer
73-
Index increment for `x`.
72+
strideX: integer
73+
Stride length.
7474

75-
offset: integer
76-
Starting index of `x`.
75+
offsetX: integer
76+
Starting index.
7777

7878
Returns
7979
-------
@@ -83,9 +83,9 @@
8383
Examples
8484
--------
8585
// Standard Usage:
86-
> var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, -1.0, -3.0 ];
86+
> var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];
8787
> {{alias}}.ndarray( x.length, 5.0, x, 1, 0 )
88-
[ -10.0, 5.0, 15.0, -25.0, 20.0, -5.0, -15.0 ]
88+
[ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]
8989

9090
// Using an index offset:
9191
> x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ type InputArray = NumericArray | Collection<number> | AccessorArrayLike<number>;
3232
*/
3333
interface Routine {
3434
/**
35-
* Multiplies a vector `x` by a constant `alpha`.
35+
* Multiplies a vector by a scalar constant.
3636
*
3737
* @param N - number of indexed elements
38-
* @param alpha - constant
38+
* @param alpha - scalar constant
3939
* @param x - input array
4040
* @param stride - stride length
4141
* @returns input array
@@ -49,10 +49,10 @@ interface Routine {
4949
<T extends InputArray>( N: number, alpha: number, x: T, stride: number ): T;
5050

5151
/**
52-
* Multiplies a vector `x` by a constant `alpha` using alternative indexing semantics.
52+
* Multiplies a vector by a scalar constant using alternative indexing semantics.
5353
*
5454
* @param N - number of indexed elements
55-
* @param alpha - constant
55+
* @param alpha - scalar constant
5656
* @param x - input array
5757
* @param stride - stride length
5858
* @param offset - starting index
@@ -68,10 +68,10 @@ interface Routine {
6868
}
6969

7070
/**
71-
* Multiplies a vector `x` by a constant `alpha`.
71+
* Multiplies a vector by a scalar constant.
7272
*
7373
* @param N - number of indexed elements
74-
* @param alpha - constant
74+
* @param alpha - scalar constant
7575
* @param x - input array
7676
* @param stride - stride length
7777
* @returns input array

lib/node_modules/@stdlib/blas/base/gscal/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'use strict';
2020

2121
/**
22-
* BLAS level 1 routine to multiply `x` by a constant.
22+
* Multiply a vector by a scalar constant.
2323
*
2424
* @module @stdlib/blas/base/gscal
2525
*

lib/node_modules/@stdlib/blas/base/gscal/lib/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ var ndarray = require( './ndarray.js' );
2727
// MAIN //
2828

2929
/**
30-
* Multiplies `x` by a scalar `alpha`.
30+
* Multiplies a vector by a scalar constant.
3131
*
3232
* @param {PositiveInteger} N - number of indexed elements
33-
* @param {number} alpha - scalar
33+
* @param {number} alpha - scalar constant
3434
* @param {NumericArray} x - input array
35-
* @param {PositiveInteger} stride - index increment
35+
* @param {PositiveInteger} stride - stride length
3636
* @returns {NumericArray} input array
3737
*
3838
* @example

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ var M = 5;
3232
// MAIN //
3333

3434
/**
35-
* Multiplies `x` by a scalar `alpha`.
35+
* Multiplies a vector by a scalar constant using alternative indexing semantics.
3636
*
3737
* @param {PositiveInteger} N - number of indexed elements
3838
* @param {number} alpha - scalar
3939
* @param {NumericArray} x - input array
40-
* @param {integer} stride - index increment
40+
* @param {integer} stride - stride length
4141
* @param {NonNegativeInteger} offset - starting index
4242
* @returns {NumericArray} input array
4343
*

lib/node_modules/@stdlib/blas/base/gscal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@stdlib/blas/base/gscal",
33
"version": "0.0.0",
4-
"description": "Multiply a vector by a constant.",
4+
"description": "Multiply a vector by a scalar constant.",
55
"license": "Apache-2.0",
66
"author": {
77
"name": "The Stdlib Authors",

0 commit comments

Comments
 (0)