Skip to content
Merged
Changes from all 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
42 changes: 37 additions & 5 deletions lib/node_modules/@stdlib/ndarray/base/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ import numel = require( '@stdlib/ndarray/base/numel' );
import numelDimension = require( '@stdlib/ndarray/base/numel-dimension' );
import offset = require( '@stdlib/ndarray/base/offset' );
import ones = require( '@stdlib/ndarray/base/ones' );
import onesLike = require( '@stdlib/ndarray/base/ones-like' );
import order = require( '@stdlib/ndarray/base/order' );
import outputDataType = require( '@stdlib/ndarray/base/output-dtype' );
import outputPolicyEnum2Str = require( '@stdlib/ndarray/base/output-policy-enum2str' );
Expand Down Expand Up @@ -3183,6 +3184,37 @@ interface Namespace {
*/
ones: typeof ones;

/**
* Creates a ones-filled array having the same shape and data type as a provided input ndarray.
*
* @param x - input array
* @returns ones-filled array
*
* @example
* var getShape = require( '@stdlib/ndarray/shape' );
* var getDType = require( '@stdlib/ndarray/dtype' );
* var ones = require( '@stdlib/ndarray/base/ones' );
*
* var x = ones( 'float64', [ 2, 2 ], 'row-major' );
* // returns <ndarray>[ [ 1.0, 1.0 ], [ 1.0, 1.0 ] ]
*
* var sh = getShape( x );
* // returns [ 2, 2 ]
*
* var dt = String( getDType( x ) );
* // returns 'float64'
*
* var y = ns.onesLike( x );
* // returns <ndarray>[ [ 1.0, 1.0 ], [ 1.0, 1.0 ] ]
*
* sh = getShape( y );
* // returns [ 2, 2 ]
*
* dt = String( getDType( y ) );
* // returns 'float64'
*/
onesLike: typeof onesLike;

/**
* Returns the layout order of a provided ndarray.
*
Expand Down Expand Up @@ -5435,23 +5467,23 @@ interface Namespace {
* var getDType = require( '@stdlib/ndarray/dtype' );
* var zeros = require( '@stdlib/ndarray/base/zeros' );
*
* var x = zeros( 'generic', [ 2, 2 ], 'row-major' );
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
* var x = zeros( 'float64', [ 2, 2 ], 'row-major' );
* // returns <ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
*
* var sh = getShape( x );
* // returns [ 2, 2 ]
*
* var dt = String( getDType( x ) );
* // returns 'generic'
* // returns 'float64'
*
* var y = ns.zerosLike( x );
* // returns <ndarray>[ [ 0, 0 ], [ 0, 0 ] ]
* // returns <ndarray>[ [ 0.0, 0.0 ], [ 0.0, 0.0 ] ]
*
* sh = getShape( y );
* // returns [ 2, 2 ]
*
* dt = String( getDType( y ) );
* // returns 'generic'
* // returns 'float64'
*/
zerosLike: typeof zerosLike;

Expand Down