Skip to content

Commit 37363f2

Browse files
authored
feat: update blas/base/ndarray TypeScript declarations
PR-URL: #11356 Reviewed-by: Athan Reines <kgryte@gmail.com>
1 parent 843db97 commit 37363f2

File tree

1 file changed

+56
-0
lines changed
  • lib/node_modules/@stdlib/blas/base/ndarray/docs/types

1 file changed

+56
-0
lines changed

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

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@
2121
/* eslint-disable max-lines */
2222

2323
import dasum = require( '@stdlib/blas/base/ndarray/dasum' );
24+
import daxpy = require( '@stdlib/blas/base/ndarray/daxpy' );
2425
import ddot = require( '@stdlib/blas/base/ndarray/ddot' );
2526
import gasum = require( '@stdlib/blas/base/ndarray/gasum' );
2627
import gdot = require( '@stdlib/blas/base/ndarray/gdot' );
2728
import sasum = require( '@stdlib/blas/base/ndarray/sasum' );
29+
import saxpy = require( '@stdlib/blas/base/ndarray/saxpy' );
2830
import sdot = require( '@stdlib/blas/base/ndarray/sdot' );
2931

3032
/**
@@ -49,6 +51,33 @@ interface Namespace {
4951
*/
5052
dasum: typeof dasum;
5153

54+
/**
55+
* Multiplies a one-dimensional double-precision floating-point ndarray `x` by a constant `alpha` and adds the result to a one-dimensional double-precision floating-point ndarray `y`.
56+
*
57+
* @param arrays - array-like object containing an input ndarray, an output ndarray, and a zero-dimensional ndarray containing a scalar constant
58+
* @returns output ndarray
59+
*
60+
* @example
61+
* var Float64Array = require( '@stdlib/array/float64' );
62+
* var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
63+
* var ndarray = require( '@stdlib/ndarray/base/ctor' );
64+
*
65+
* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
66+
* var x = new ndarray( 'float64', xbuf, [ 5 ], [ 1 ], 0, 'row-major' );
67+
*
68+
* var ybuf = new Float64Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );
69+
* var y = new ndarray( 'float64', ybuf, [ 5 ], [ 1 ], 0, 'row-major' );
70+
*
71+
* var alpha = scalar2ndarray( 5.0, 'float64', 'row-major' );
72+
*
73+
* var z = ns.daxpy( [ x, y, alpha ] );
74+
* // returns <ndarray>[ 6.0, 11.0, 16.0, 21.0, 26.0 ]
75+
*
76+
* var bool = ( z === y );
77+
* // returns true
78+
*/
79+
daxpy: typeof daxpy;
80+
5281
/**
5382
* Computes the dot product of two one-dimensional double-precision floating-point ndarrays.
5483
*
@@ -125,6 +154,33 @@ interface Namespace {
125154
*/
126155
sasum: typeof sasum;
127156

157+
/**
158+
* Multiplies a one-dimensional single-precision floating-point ndarray `x` by a constant `alpha` and adds the result to a one-dimensional single-precision floating-point ndarray `y`.
159+
*
160+
* @param arrays - array-like object containing an input ndarray, an output ndarray, and a zero-dimensional ndarray containing a scalar constant
161+
* @returns output ndarray
162+
*
163+
* @example
164+
* var Float32Array = require( '@stdlib/array/float32' );
165+
* var scalar2ndarray = require( '@stdlib/ndarray/base/from-scalar' );
166+
* var ndarray = require( '@stdlib/ndarray/base/ctor' );
167+
*
168+
* var xbuf = new Float32Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] );
169+
* var x = new ndarray( 'float32', xbuf, [ 5 ], [ 1 ], 0, 'row-major' );
170+
*
171+
* var ybuf = new Float32Array( [ 1.0, 1.0, 1.0, 1.0, 1.0 ] );
172+
* var y = new ndarray( 'float32', ybuf, [ 5 ], [ 1 ], 0, 'row-major' );
173+
*
174+
* var alpha = scalar2ndarray( 5.0, 'float32', 'row-major' );
175+
*
176+
* var z = ns.saxpy( [ x, y, alpha ] );
177+
* // returns <ndarray>[ 6.0, 11.0, 16.0, 21.0, 26.0 ]
178+
*
179+
* var bool = ( z === y );
180+
* // returns true
181+
*/
182+
saxpy: typeof saxpy;
183+
128184
/**
129185
* Computes the dot product of two one-dimensional single-precision floating-point ndarrays.
130186
*

0 commit comments

Comments
 (0)