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
123 changes: 123 additions & 0 deletions lib/node_modules/@stdlib/ndarray/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import dtypes = require( '@stdlib/ndarray/dtypes' );
import empty = require( '@stdlib/ndarray/empty' );
import emptyLike = require( '@stdlib/ndarray/empty-like' );
import every = require( '@stdlib/ndarray/every' );
import everyBy = require( '@stdlib/ndarray/every-by' );
import FancyArray = require( '@stdlib/ndarray/fancy' );
import fill = require( '@stdlib/ndarray/fill' );
import fillBy = require( '@stdlib/ndarray/fill-by' );
Expand Down Expand Up @@ -109,6 +110,8 @@ import stride = require( '@stdlib/ndarray/stride' );
import strides = require( '@stdlib/ndarray/strides' );
import sub2ind = require( '@stdlib/ndarray/sub2ind' );
import ndarray2array = require( '@stdlib/ndarray/to-array' );
import toFlippedlr = require( '@stdlib/ndarray/to-flippedlr' );
import toFlippedud = require( '@stdlib/ndarray/to-flippedud' );
import ndarray2json = require( '@stdlib/ndarray/to-json' );
import toReversed = require( '@stdlib/ndarray/to-reversed' );
import toReversedDimension = require( '@stdlib/ndarray/to-reversed-dimension' );
Expand Down Expand Up @@ -1123,6 +1126,82 @@ interface Namespace {
*/
every: typeof every;

/**
* Tests whether all elements along one or more ndarray dimensions pass a test implemented by a predicate function.
*
* @param x - input ndarray
* @param options - function options
* @param options.dims - list of dimensions over which to perform a reduction
* @param options.keepdims - boolean indicating whether the reduced dimensions should be included in the returned ndarray as singleton dimensions (default: false)
* @param predicate - predicate function
* @param thisArg - predicate execution context
* @returns output ndarray
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var ndarray = require( '@stdlib/ndarray/ctor' );
*
* function isPositive( value ) {
* return value > 0.0;
* }
*
* // Create a data buffer:
* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
*
* // Define the shape of the input array:
* var sh = [ 3, 1, 2 ];
*
* // Define the array strides:
* var sx = [ 4, 4, 1 ];
*
* // Define the index offset:
* var ox = 1;
*
* // Create an input ndarray:
* var x = new ndarray( 'float64', xbuf, sh, sx, ox, 'row-major' );
*
* // Perform reduction:
* var out = ns.everyBy( x, isPositive );
* // returns <ndarray>[ true ]
*
* @example
* var Float64Array = require( '@stdlib/array/float64' );
* var ndarray = require( '@stdlib/ndarray/ctor' );
* var empty = require( '@stdlib/ndarray/empty' );
*
* function isPositive( value ) {
* return value > 0.0;
* }
*
* // Create a data buffer:
* var xbuf = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ] );
*
* // Define the shape of the input array:
* var shape = [ 3, 1, 2 ];
*
* // Define the array strides:
* var sx = [ 4, 4, 1 ];
*
* // Define the index offset:
* var ox = 1;
*
* // Create an input ndarray:
* var x = new ndarray( 'float64', xbuf, shape, sx, ox, 'row-major' );
*
* // Create an output ndarray:
* var y = empty( [], {
* 'dtype': 'bool'
* });
*
* // Perform reduction:
* var out = ns.everyBy.assign( x, y, isPositive );
* // returns <ndarray>[ true ]
*
* var bool = ( out === y );
* // returns true
*/
everyBy: typeof everyBy;

/**
* Fancy array constructor.
*
Expand Down Expand Up @@ -3119,6 +3198,50 @@ interface Namespace {
*/
ndarray2array: typeof ndarray2array;

/**
* Returns a new ndarray where the order of elements along the last dimension of an input ndarray is reversed.
*
* @param x - input array
* @returns output ndarray
*
* @example
* var ndarray = require( '@stdlib/ndarray/ctor' );
*
* var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
* var shape = [ 3, 2 ];
* var strides = [ 2, 1 ];
* var offset = 0;
*
* var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );
* // returns <ndarray>[ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
*
* var y = ns.toFlippedlr( x );
* // returns <ndarray>[ [ 2.0, 1.0 ], [ 4.0, 3.0 ], [ 6.0, 5.0 ] ]
*/
toFlippedlr: typeof toFlippedlr;

/**
* Returns a new ndarray where the order of elements along the second-to-last dimension of an input ndarray is reversed.
*
* @param x - input array
* @returns output ndarray
*
* @example
* var ndarray = require( '@stdlib/ndarray/ctor' );
*
* var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
* var shape = [ 3, 2 ];
* var strides = [ 2, 1 ];
* var offset = 0;
*
* var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );
* // returns <ndarray>[ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
*
* var y = ns.toFlippedud( x );
* // returns <ndarray>[ [ 5.0, 6.0 ], [ 3.0, 4.0 ], [ 1.0, 2.0 ] ]
*/
toFlippedud: typeof toFlippedud;

/**
* Serializes an ndarray as a JSON object.
*
Expand Down
Loading