Skip to content

Commit

Permalink
docs: fix examples and notes
Browse files Browse the repository at this point in the history
  • Loading branch information
kgryte committed Oct 21, 2024
1 parent fe8255a commit 420e21c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
8 changes: 4 additions & 4 deletions lib/node_modules/@stdlib/blas/base/drot-wasm/docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
Number of indexed elements.

x: Float64Array
Input array.
First input array.

strideX: integer
Index increment for `x`.
Expand Down Expand Up @@ -300,9 +300,9 @@
Reallocates the underlying WebAssembly memory instance to a specified number
of bytes.

WebAssembly memory can only **grow**, not shrink. Hence, if provided a
number of bytes which is less than or equal to the size of the current
memory, the function does nothing.
WebAssembly memory can only *grow*, not shrink. Hence, if provided a number
of bytes which is less than or equal to the size of the current memory, the
function does nothing.

When non-shared memory is resized, the underlying the `ArrayBuffer` is
detached, consequently invalidating any associated typed array views. Before
Expand Down
15 changes: 10 additions & 5 deletions lib/node_modules/@stdlib/blas/base/drot-wasm/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ interface ModuleConstructor {
* var viewX = zeros( N, dtype );
* var viewY = zeros( N, dtype );
* mod.read( xptr, viewX );
* mod.read( yptr, viewY );
* // viewX => <Float64Array>[ 1.0, 1.0, 1.0, 1.0, 1.0 ]
*
* mod.read( yptr, viewY );
* // viewY => <Float64Array>[ -1.0, -2.0, -3.0, -4.0, -5.0 ]
*/
new( mem: Memory ): Module; // newable
Expand Down Expand Up @@ -134,8 +135,9 @@ interface ModuleConstructor {
* var viewX = zeros( N, dtype );
* var viewY = zeros( N, dtype );
* mod.read( xptr, viewX );
* mod.read( yptr, viewY );
* // viewX => <Float64Array>[ 1.0, 1.0, 1.0, 1.0, 1.0 ]
*
* mod.read( yptr, viewY );
* // viewY => <Float64Array>[ -1.0, -2.0, -3.0, -4.0, -5.0 ]
*/
( mem: Memory ): Module; // callable
Expand Down Expand Up @@ -202,8 +204,9 @@ interface Module extends ModuleWrapper {
* var viewX = zeros( N, dtype );
* var viewY = zeros( N, dtype );
* mod.read( xptr, viewX );
* mod.read( yptr, viewY );
* // viewX => <Float64Array>[ 1.0, 1.0, 1.0, 1.0, 1.0 ]
*
* mod.read( yptr, viewY );
* // viewY => <Float64Array>[ -1.0, -2.0, -3.0, -4.0, -5.0 ]
*/
main( N: number, xptr: number, strideX: number, yptr: number, strideY: number, c: number, s: number ): number;
Expand Down Expand Up @@ -267,8 +270,9 @@ interface Module extends ModuleWrapper {
* var viewX = zeros( N, dtype );
* var viewY = zeros( N, dtype );
* mod.read( xptr, viewX );
* mod.read( yptr, viewY );
* // viewX => <Float64Array>[ 1.0, 1.0, 1.0, 1.0, 1.0 ]
*
* mod.read( yptr, viewY );
* // viewY => <Float64Array>[ -1.0, -2.0, -3.0, -4.0, -5.0 ]
*/
ndarray( N: number, xptr: number, strideX: number, offsetX: number, yptr: number, strideY: number, offsetY: number, c: number, s: number ): number;
Expand Down Expand Up @@ -379,8 +383,9 @@ interface Routine extends ModuleWrapper {
* var viewX = zeros( N, dtype );
* var viewY = zeros( N, dtype );
* mod.read( xptr, viewX );
* mod.read( yptr, viewY );
* // viewX => <Float64Array>[ 1.0, 1.0, 1.0, 1.0, 1.0 ]
*
* mod.read( yptr, viewY );
* // viewY => <Float64Array>[ -1.0, -2.0, -3.0, -4.0, -5.0 ]
*/
Module: ModuleConstructor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ setReadOnly( Routine.prototype, 'ndarray', function drot( N, x, strideX, offsetX
// Perform computation by calling the corresponding parent method:
Module.prototype.ndarray.call( this, N, p0.ptr, p0.stride, p0.offset, p1.ptr, p1.stride, p1.offset, c, s ); // eslint-disable-line max-len

// If the output arrays data had to be copied to module memory, copy the results to the provided output arrays...
// If output array data had to be copied to module memory, copy the results to the provided output arrays...
if ( p0.copy ) {
readDataView( N, this.view, p0.stride*p0.BYTES_PER_ELEMENT, p0.ptr, x, strideX, offsetX, true ); // eslint-disable-line max-len
}
Expand Down

1 comment on commit 420e21c

@stdlib-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage Report

Package Statements Branches Functions Lines
blas/base/drot-wasm $\color{green}673/673$
$\color{green}+100.00\%$
$\color{green}17/17$
$\color{green}+100.00\%$
$\color{green}6/6$
$\color{green}+100.00\%$
$\color{green}673/673$
$\color{green}+100.00\%$

The above coverage report was generated for the changes in this push.

Please sign in to comment.