Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/node_modules/@stdlib/blas/base/gscal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ limitations under the License.

# gscal

> Multiply a vector `x` by a constant `alpha`.
> Multiply a vector by a scalar constant.

<section class="usage">

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

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

Multiplies a vector `x` by a constant `alpha`.
Multiplies a vector by a scalar constant.

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

The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to multiply every other value by a constant
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:

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

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

Multiplies a vector `x` by a constant `alpha` using alternative indexing semantics.
Multiplies a vector by a scalar constant using alternative indexing semantics.

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

- **offset**: starting index.

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
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:

```javascript
var x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];
Expand Down
42 changes: 20 additions & 22 deletions lib/node_modules/@stdlib/blas/base/gscal/docs/repl.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@

{{alias}}( N, alpha, x, stride )
Multiplies a vector `x` by a constant `alpha`.
Multiplies a vector by a scalar constant.

The `N` and `stride` parameters determine which elements in `x` are accessed
at runtime.
The `N` and stride parameters determine which elements in the strided array
are accessed at runtime.

Indexing is relative to the first index. To introduce an offset, use typed
array views.
Expand All @@ -16,13 +16,13 @@
Number of indexed elements.

alpha: number
Constant.
Scalar constant.

x: Array<number>|TypedArray
Input array.

stride: integer
Index increment for `x`.
Stride length.

Returns
-------
Expand All @@ -32,13 +32,12 @@
Examples
--------
// Standard Usage:
> var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, -1.0, -3.0 ];
> var alpha = 5.0;
> {{alias}}( x.length, alpha, x, 1 )
[ -10.0, 5.0, 15.0, -25.0, 20.0, -5.0, -15.0 ]
> var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];
> {{alias}}( x.length, 5.0, x, 1 )
[ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]

// Using `N` and `stride` parameters:
> x = [ -2.0, 1.0, 3.0, -5.0, 4.0, -1.0, -3.0 ];
// Using `N` and stride parameters:
> x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0 -1.0, -3.0 ];
> {{alias}}( 3, 5.0, x, 2 )
[ -10.0, 1.0, 15.0, -5.0, 20.0, -1.0, -3.0 ]

Expand All @@ -51,29 +50,29 @@
<Float64Array>[ 1.0, -10.0, 3.0, -20.0, 5.0, -30.0 ]


{{alias}}.ndarray( N, alpha, x, stride, offset )
Multiplies `x` by a constant `alpha` using alternative indexing semantics.
{{alias}}.ndarray( N, alpha, x, stride, offsetX )
Multiplies a vector by a scalar constant.

While typed array views mandate a view offset based on the underlying
buffer, the `offset` parameter supports indexing semantics based on a
starting index.
buffer, the offset parameter supports indexing semantics based on a starting
index.

Parameters
----------
N: integer
Number of indexed elements.

alpha: number
Constant.
Scalar constant.

x: Array<number>|TypedArray
Input array.

stride: integer
Index increment for `x`.
Stride length.

offset: integer
Starting index of `x`.
offsetX: integer
Starting index.

Returns
-------
Expand All @@ -83,9 +82,9 @@
Examples
--------
// Standard Usage:
> var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, -1.0, -3.0 ];
> var x = [ -2.0, 1.0, 3.0, -5.0, 4.0, 0.0, -1.0, -3.0 ];
> {{alias}}.ndarray( x.length, 5.0, x, 1, 0 )
[ -10.0, 5.0, 15.0, -25.0, 20.0, -5.0, -15.0 ]
[ -10.0, 5.0, 15.0, -25.0, 20.0, 0.0, -5.0, -15.0 ]

// Using an index offset:
> x = [ 1.0, -2.0, 3.0, -4.0, 5.0, -6.0 ];
Expand All @@ -94,4 +93,3 @@

See Also
--------

12 changes: 6 additions & 6 deletions lib/node_modules/@stdlib/blas/base/gscal/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ type InputArray = NumericArray | Collection<number> | AccessorArrayLike<number>;
*/
interface Routine {
/**
* Multiplies a vector `x` by a constant `alpha`.
* Multiplies a vector by a scalar constant.
*
* @param N - number of indexed elements
* @param alpha - constant
* @param alpha - scalar constant
* @param x - input array
* @param stride - stride length
* @returns input array
Expand All @@ -49,10 +49,10 @@ interface Routine {
<T extends InputArray>( N: number, alpha: number, x: T, stride: number ): T;

/**
* Multiplies a vector `x` by a constant `alpha` using alternative indexing semantics.
* Multiplies a vector by a scalar constant.
*
* @param N - number of indexed elements
* @param alpha - constant
* @param alpha - scalar constant
* @param x - input array
* @param stride - stride length
* @param offset - starting index
Expand All @@ -68,10 +68,10 @@ interface Routine {
}

/**
* Multiplies a vector `x` by a constant `alpha`.
* Multiplies a vector by a scalar constant.
*
* @param N - number of indexed elements
* @param alpha - constant
* @param alpha - scalar constant
* @param x - input array
* @param stride - stride length
* @returns input array
Expand Down
2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/blas/base/gscal/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
'use strict';

/**
* BLAS level 1 routine to multiply `x` by a constant.
* Multiply a vector by a scalar constant.
*
* @module @stdlib/blas/base/gscal
*
Expand Down
6 changes: 3 additions & 3 deletions lib/node_modules/@stdlib/blas/base/gscal/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ var ndarray = require( './ndarray.js' );
// MAIN //

/**
* Multiplies `x` by a scalar `alpha`.
* Multiplies a vector by a scalar constant.
*
* @param {PositiveInteger} N - number of indexed elements
* @param {number} alpha - scalar
* @param {number} alpha - scalar constant
* @param {NumericArray} x - input array
* @param {PositiveInteger} stride - index increment
* @param {PositiveInteger} stride - stride length
* @returns {NumericArray} input array
*
* @example
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/blas/base/gscal/lib/ndarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ var M = 5;
// MAIN //

/**
* Multiplies `x` by a scalar `alpha`.
* Multiplies a vector by a scalar constant.
*
* @param {PositiveInteger} N - number of indexed elements
* @param {number} alpha - scalar
* @param {NumericArray} x - input array
* @param {integer} stride - index increment
* @param {integer} stride - stride length
* @param {NonNegativeInteger} offset - starting index
* @returns {NumericArray} input array
*
Expand Down
2 changes: 1 addition & 1 deletion lib/node_modules/@stdlib/blas/base/gscal/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@stdlib/blas/base/gscal",
"version": "0.0.0",
"description": "Multiply a vector by a constant.",
"description": "Multiply a vector by a scalar constant.",
"license": "Apache-2.0",
"author": {
"name": "The Stdlib Authors",
Expand Down
Loading