Skip to content

Commit

Permalink
chore: apply review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed Oct 18, 2024
1 parent 0d06251 commit 8c7e2aa
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 63 deletions.
8 changes: 4 additions & 4 deletions lib/node_modules/@stdlib/blas/base/ddot-wasm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ var z = ddot.main( x.length, x, 1, y, 1 );
The function has the following parameters:

- **N**: number of indexed elements.
- **x**: input [`Float64Array`][@stdlib/array/float64].
- **x**: first input [`Float64Array`][@stdlib/array/float64].
- **strideX**: index increment for `x`.
- **y**: input [`Float64Array`][@stdlib/array/float64].
- **y**: second input [`Float64Array`][@stdlib/array/float64].
- **strideY**: index increment for `y`.

The `N` and stride parameters determine which elements in the strided arrays are accessed at runtime. For example, to calculate the dot product of every other value in `x` and the first `N` elements of `y` in reverse order,
Expand Down Expand Up @@ -190,9 +190,9 @@ console.log( z );
The function has the following parameters:

- **N**: number of indexed elements.
- **xp**: input [`Float64Array`][@stdlib/array/float64] pointer (i.e., byte offset).
- **xp**: first input [`Float64Array`][@stdlib/array/float64] pointer (i.e., byte offset).
- **sx**: index increment for `x`.
- **yp**: input [`Float64Array`][@stdlib/array/float64] pointer (i.e., byte offset).
- **yp**: second input [`Float64Array`][@stdlib/array/float64] pointer (i.e., byte offset).
- **sy**: index increment for `y`.

#### ddot.Module.prototype.ndarray( N, xp, sx, ox, yp, sy, oy )
Expand Down
22 changes: 11 additions & 11 deletions lib/node_modules/@stdlib/blas/base/ddot-wasm/docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,21 @@
Indexing is relative to the first index. To introduce an offset, use typed
array views.

If `N <= 0` both the functions return `0`.
If `N <= 0`, both the functions return `0`.

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

x: Float64Array
Input array.
First input array.

strideX: integer
Index increment for `x`.

y: Float64Array
Output array.
Second input array.

strideY: integer
Index increment for `y`.
Expand Down Expand Up @@ -69,7 +69,7 @@
Number of indexed elements.

x: Float64Array
Input array.
First input array.

strideX: integer
Index increment for `x`.
Expand All @@ -78,7 +78,7 @@
Starting index for `x`.

y: Float64Array
Output array.
Second input array.

strideY: integer
Index increment for `y`.
Expand Down Expand Up @@ -452,13 +452,13 @@
Number of indexed elements.

xp: integer
Input array pointer (i.e., byte offset).
First input array pointer (i.e., byte offset).

sx: integer
Index increment for `x`.

yp: integer
Output array pointer (i.e., byte offset).
Second input array pointer (i.e., byte offset).

sy: integer
Index increment for `y`.
Expand All @@ -483,7 +483,7 @@
> mod.write( yptr, {{alias:@stdlib/array/ones}}( 5, 'float64' ) );

// Perform computation:
> var dot = mod.main( 5, xptr, 1, yptr, 1 )
> var out = mod.main( 5, xptr, 1, yptr, 1 )
15.0


Expand All @@ -497,7 +497,7 @@
Number of indexed elements.

xp: integer
Input array pointer (i.e., byte offset).
First input array pointer (i.e., byte offset).

sx: integer
Index increment for `x`.
Expand All @@ -506,7 +506,7 @@
Starting index for `x`.

yp: integer
Output array pointer (i.e., byte offset).
Second input array pointer (i.e., byte offset).

sy: integer
Index increment for `y`.
Expand Down Expand Up @@ -534,7 +534,7 @@
> mod.write( yptr, {{alias:@stdlib/array/ones}}( 5, 'float64' ) );

// Perform computation:
> var dot = mod.ndarray( 5, xptr, 1, 0, yptr, 1, 0 )
> var out = mod.ndarray( 5, xptr, 1, 0, yptr, 1, 0 )
15.0


Expand Down
26 changes: 13 additions & 13 deletions lib/node_modules/@stdlib/blas/base/ddot-wasm/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ interface Module extends ModuleWrapper {
* Computes the dot product of `x` and `y`.
*
* @param N - number of indexed elements
* @param xptr - input array pointer (i.e., byte offset)
* @param xptr - first input array pointer (i.e., byte offset)
* @param strideX - `x` stride length
* @param yptr - output array pointer (i.e., byte offset)
* @param yptr - second input array pointer (i.e., byte offset)
* @param strideY - `y` stride length
* @returns dot product
*
Expand Down Expand Up @@ -177,10 +177,10 @@ interface Module extends ModuleWrapper {
* Computes the dot product of `x` and `y` using alternative indexing semantics.
*
* @param N - number of indexed elements
* @param xptr - input array pointer (i.e., byte offset)
* @param xptr - first input array pointer (i.e., byte offset)
* @param strideX - `x` stride length
* @param offsetX - starting index for `x`
* @param yptr - output array pointer (i.e., byte offset)
* @param yptr - second input array pointer (i.e., byte offset)
* @param strideY - `y` stride length
* @param offsetY - starting index for `y`
* @returns dot product
Expand Down Expand Up @@ -234,9 +234,9 @@ interface Routine extends ModuleWrapper {
* Computes the dot product of `x` and `y`.
*
* @param N - number of indexed elements
* @param x - input array
* @param x - first input array
* @param strideX - `x` stride length
* @param y - output array
* @param y - second input array
* @param strideY - `y` stride length
* @returns dot product
*
Expand All @@ -249,16 +249,16 @@ interface Routine extends ModuleWrapper {
* var dot = ddot.main( x.length, x, 1, y, 1 );
* // returns 15.0
*/
main( N: number, x: Float64Array, strideX: number, y: Float64Array, strideY: number ): Float64Array;
main( N: number, x: Float64Array, strideX: number, y: Float64Array, strideY: number ): number;

/**
* Computes the dot product of `x` and `y` using alternative indexing semantics.
*
* @param N - number of indexed elements
* @param x - input array
* @param x - first input array
* @param strideX - `x` stride length
* @param offsetX - starting index for `x`
* @param y - output array
* @param y - second input array
* @param strideY - `y` stride length
* @param offsetY - starting index for `y`
* @returns dot product
Expand All @@ -272,7 +272,7 @@ interface Routine extends ModuleWrapper {
* ddot.ndarray( x.length, x, 1, 0, y, 1, 0 );
* // returns 15.0
*/
ndarray( N: number, x: Float64Array, strideX: number, offsetX: number, y: Float64Array, strideY: number, offsetY: number ): Float64Array;
ndarray( N: number, x: Float64Array, strideX: number, offsetX: number, y: Float64Array, strideY: number, offsetY: number ): number;

/**
* Returns a new WebAssembly module wrapper instance which uses the provided WebAssembly memory instance as its underlying memory.
Expand Down Expand Up @@ -325,11 +325,11 @@ interface Routine extends ModuleWrapper {
* Computes the dot product of `x` and `y`.
*
* @param N - number of indexed elements
* @param x - input array
* @param x - first input array
* @param strideX - `x` stride length
* @param y - output array
* @param y - second input array
* @param strideY - `y` stride length
* @returns output array
* @returns dot product
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
Expand Down
10 changes: 5 additions & 5 deletions lib/node_modules/@stdlib/blas/base/ddot-wasm/docs/types/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ import ddot = require( './index' );

// TESTS //

// Attached to the main export is a `main` method which returns a Float64Array...
// Attached to the main export is a `main` method which returns a number...
{
const x = new Float64Array( 10 );
const y = new Float64Array( 10 );

ddot.main( x.length, x, 1, y, 1 ); // $ExpectType Float64Array
ddot.main( x.length, x, 1, y, 1 ); // $ExpectType number
}

// The compiler throws an error if the `main` method is provided a first argument which is not a number...
Expand Down Expand Up @@ -121,12 +121,12 @@ import ddot = require( './index' );
ddot.main( x.length, x, 1, y, 1, 10 ); // $ExpectError
}

// Attached to main export is an `ndarray` method which returns a Float64Array...
// Attached to main export is an `ndarray` method which returns a number...
{
const x = new Float64Array( 10 );
const y = new Float64Array( 10 );

ddot.ndarray( x.length, x, 1, 0, y, 1, 0 ); // $ExpectType Float64Array
ddot.ndarray( x.length, x, 1, 0, y, 1, 0 ); // $ExpectType number
}

// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...
Expand Down Expand Up @@ -493,7 +493,7 @@ import ddot = require( './index' );
mod.ndarray( 10, 0, 1, 0, 80, ( x: number ): number => x, 0 ); // $ExpectError
}

// The compiler throws an error if the `ndarray` method of a module instance is provided an seventh argument which is not a number...
// The compiler throws an error if the `ndarray` method of a module instance is provided a seventh argument which is not a number...
{
const mem = new Memory({
'initial': 1
Expand Down
4 changes: 2 additions & 2 deletions lib/node_modules/@stdlib/blas/base/ddot-wasm/lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );
*
* // Perform operation:
* var dot = ddot.main( x.length, 5.0, x, 1, y, 1 );
* var dot = ddot.main( x.length, x, 1, y, 1 );
* // returns 15.0
*
* @example
Expand All @@ -44,7 +44,7 @@
* var y = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );
*
* // Perform operation:
* var dot = ddot.ndarray( x.length, 5.0, x, 1, 0, y, 1, 0 );
* var dot = ddot.ndarray( x.length, x, 1, 0, y, 1, 0 );
* // returns 15.0
*
* @example
Expand Down
8 changes: 4 additions & 4 deletions lib/node_modules/@stdlib/blas/base/ddot-wasm/lib/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ inherits( Module, WasmModule );
* @readonly
* @type {Function}
* @param {PositiveInteger} N - number of indexed elements
* @param {NonNegativeInteger} xptr - input array pointer (i.e., byte offset)
* @param {NonNegativeInteger} xptr - first input array pointer (i.e., byte offset)
* @param {integer} strideX - `x` stride length
* @param {NonNegativeInteger} yptr - output array pointer (i.e., byte offset)
* @param {NonNegativeInteger} yptr - second input array pointer (i.e., byte offset)
* @param {integer} strideY - `y` stride length
* @returns {number} dot product
*
Expand Down Expand Up @@ -162,10 +162,10 @@ setReadOnly( Module.prototype, 'main', function ddot( N, xptr, strideX, yptr, st
* @readonly
* @type {Function}
* @param {PositiveInteger} N - number of indexed elements
* @param {NonNegativeInteger} xptr - input array pointer (i.e., byte offset)
* @param {NonNegativeInteger} xptr - first input array pointer (i.e., byte offset)
* @param {integer} strideX - `x` stride length
* @param {NonNegativeInteger} offsetX - starting `x` index
* @param {NonNegativeInteger} yptr - output array pointer (i.e., byte offset)
* @param {NonNegativeInteger} yptr - second input array pointer (i.e., byte offset)
* @param {integer} strideY - `y` stride length
* @param {NonNegativeInteger} offsetY - starting `y` index
* @returns {number} dot product
Expand Down
8 changes: 4 additions & 4 deletions lib/node_modules/@stdlib/blas/base/ddot-wasm/lib/routine.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ inherits( Routine, Module );
* @readonly
* @type {Function}
* @param {PositiveInteger} N - number of indexed elements
* @param {Float64Array} x - input array
* @param {Float64Array} x - first input array
* @param {integer} strideX - `x` stride length
* @param {Float64Array} y - output array
* @param {Float64Array} y - second input array
* @param {integer} strideY - `y` stride length
* @returns {number} dot product
*
Expand Down Expand Up @@ -130,10 +130,10 @@ setReadOnly( Routine.prototype, 'main', function ddot( N, x, strideX, y, strideY
* @readonly
* @type {Function}
* @param {PositiveInteger} N - number of indexed elements
* @param {Float64Array} x - input array
* @param {Float64Array} x - first input array
* @param {integer} strideX - `x` stride length
* @param {NonNegativeInteger} offsetX - starting `x` index
* @param {Float64Array} y - output array
* @param {Float64Array} y - second input array
* @param {integer} strideY - `y` stride length
* @param {NonNegativeInteger} offsetY - starting `y` index
* @returns {number} dot product
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,23 +128,23 @@ tape( 'a module instance has an `ndarray` method which supports an `x` offset',
yp = 40;

mod.write( xp, new Float64Array([
2.0, // 0
-3.0, // 1
-5.0, // 2
7.0,
2.0,
-3.0, // 0
-5.0, // 1
7.0, // 2
6.0
]));
mod.write( yp, new Float64Array([
8.0, // 0
2.0,
-3.0, // 1
2.0, // 1
-3.0, // 2
3.0,
-4.0, // 2
-4.0,
1.0
]));

dot = mod.ndarray( 3, xp, 1, 0, yp, 2, 0 );
t.strictEqual( dot, 45.0, 'returns expected value' );
dot = mod.ndarray( 3, xp, 1, 1, yp, 1, 0 );
t.strictEqual( dot, -55.0, 'returns expected value' );

t.end();
});
Expand Down Expand Up @@ -205,10 +205,10 @@ tape( 'a module instance has an `ndarray` method which supports a `y` offset', f

mod.write( xp, new Float64Array([
1.0, // 0
2.0,
3.0, // 1
2.0, // 1
3.0, // 2
4.0,
5.0, // 2
5.0,
6.0
]));
mod.write( yp, new Float64Array([
Expand All @@ -220,8 +220,8 @@ tape( 'a module instance has an `ndarray` method which supports a `y` offset', f
11.0 // 2
]));

dot = mod.ndarray( 3, xp, 2, 0, yp, 1, 3 );
t.strictEqual( dot, 94.0, 'returns expected value' );
dot = mod.ndarray( 3, xp, 1, 0, yp, 1, 3 );
t.strictEqual( dot, 62.0, 'returns expected value' );

t.end();
});
Expand Down Expand Up @@ -316,9 +316,9 @@ tape( 'a module instance has an `ndarray` method which supports complex access p
]));
mod.write( yp, new Float64Array([
6.0,
7.0, // 2
8.0, // 1
9.0, // 0
7.0, // 2
8.0, // 1
9.0, // 0
10.0
]));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ tape( 'the `ndarray` method supports complex access patterns', function test( t
]);
y = new Float64Array([
6.0,
7.0, // 2
8.0, // 1
9.0, // 0
7.0, // 2
8.0, // 1
9.0, // 0
10.0
]);

Expand Down

0 comments on commit 8c7e2aa

Please sign in to comment.