@@ -45,6 +45,7 @@ import dtypes = require( './../../dtypes' );
4545import empty = require( './../../empty' ) ;
4646import emptyLike = require( './../../empty-like' ) ;
4747import every = require( './../../every' ) ;
48+ import everyBy = require( './../../every-by' ) ;
4849import FancyArray = require( './../../fancy' ) ;
4950import fill = require( './../../fill' ) ;
5051import fillBy = require( './../../fill-by' ) ;
@@ -109,6 +110,8 @@ import stride = require( './../../stride' );
109110import strides = require( './../../strides' ) ;
110111import sub2ind = require( './../../sub2ind' ) ;
111112import ndarray2array = require( './../../to-array' ) ;
113+ import toFlippedlr = require( './../../to-flippedlr' ) ;
114+ import toFlippedud = require( './../../to-flippedud' ) ;
112115import ndarray2json = require( './../../to-json' ) ;
113116import toReversed = require( './../../to-reversed' ) ;
114117import toReversedDimension = require( './../../to-reversed-dimension' ) ;
@@ -1123,6 +1126,82 @@ interface Namespace {
11231126 */
11241127 every : typeof every ;
11251128
1129+ /**
1130+ * Tests whether all elements along one or more ndarray dimensions pass a test implemented by a predicate function.
1131+ *
1132+ * @param x - input ndarray
1133+ * @param options - function options
1134+ * @param options.dims - list of dimensions over which to perform a reduction
1135+ * @param options.keepdims - boolean indicating whether the reduced dimensions should be included in the returned ndarray as singleton dimensions (default: false)
1136+ * @param predicate - predicate function
1137+ * @param thisArg - predicate execution context
1138+ * @returns output ndarray
1139+ *
1140+ * @example
1141+ * var Float64Array = require( '@stdlib/array/float64' );
1142+ * var ndarray = require( './../../ctor' );
1143+ *
1144+ * function isPositive( value ) {
1145+ * return value > 0.0;
1146+ * }
1147+ *
1148+ * // Create a data buffer:
1149+ * 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 ] );
1150+ *
1151+ * // Define the shape of the input array:
1152+ * var sh = [ 3, 1, 2 ];
1153+ *
1154+ * // Define the array strides:
1155+ * var sx = [ 4, 4, 1 ];
1156+ *
1157+ * // Define the index offset:
1158+ * var ox = 1;
1159+ *
1160+ * // Create an input ndarray:
1161+ * var x = new ndarray( 'float64', xbuf, sh, sx, ox, 'row-major' );
1162+ *
1163+ * // Perform reduction:
1164+ * var out = ns.everyBy( x, isPositive );
1165+ * // returns <ndarray>[ true ]
1166+ *
1167+ * @example
1168+ * var Float64Array = require( '@stdlib/array/float64' );
1169+ * var ndarray = require( './../../ctor' );
1170+ * var empty = require( './../../empty' );
1171+ *
1172+ * function isPositive( value ) {
1173+ * return value > 0.0;
1174+ * }
1175+ *
1176+ * // Create a data buffer:
1177+ * 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 ] );
1178+ *
1179+ * // Define the shape of the input array:
1180+ * var shape = [ 3, 1, 2 ];
1181+ *
1182+ * // Define the array strides:
1183+ * var sx = [ 4, 4, 1 ];
1184+ *
1185+ * // Define the index offset:
1186+ * var ox = 1;
1187+ *
1188+ * // Create an input ndarray:
1189+ * var x = new ndarray( 'float64', xbuf, shape, sx, ox, 'row-major' );
1190+ *
1191+ * // Create an output ndarray:
1192+ * var y = empty( [], {
1193+ * 'dtype': 'bool'
1194+ * });
1195+ *
1196+ * // Perform reduction:
1197+ * var out = ns.everyBy.assign( x, y, isPositive );
1198+ * // returns <ndarray>[ true ]
1199+ *
1200+ * var bool = ( out === y );
1201+ * // returns true
1202+ */
1203+ everyBy : typeof everyBy ;
1204+
11261205 /**
11271206 * Fancy array constructor.
11281207 *
@@ -3119,6 +3198,50 @@ interface Namespace {
31193198 */
31203199 ndarray2array : typeof ndarray2array ;
31213200
3201+ /**
3202+ * Returns a new ndarray where the order of elements along the last dimension of an input ndarray is reversed.
3203+ *
3204+ * @param x - input array
3205+ * @returns output ndarray
3206+ *
3207+ * @example
3208+ * var ndarray = require( './../../ctor' );
3209+ *
3210+ * var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
3211+ * var shape = [ 3, 2 ];
3212+ * var strides = [ 2, 1 ];
3213+ * var offset = 0;
3214+ *
3215+ * var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );
3216+ * // returns <ndarray>[ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
3217+ *
3218+ * var y = ns.toFlippedlr( x );
3219+ * // returns <ndarray>[ [ 2.0, 1.0 ], [ 4.0, 3.0 ], [ 6.0, 5.0 ] ]
3220+ */
3221+ toFlippedlr : typeof toFlippedlr ;
3222+
3223+ /**
3224+ * Returns a new ndarray where the order of elements along the second-to-last dimension of an input ndarray is reversed.
3225+ *
3226+ * @param x - input array
3227+ * @returns output ndarray
3228+ *
3229+ * @example
3230+ * var ndarray = require( './../../ctor' );
3231+ *
3232+ * var buffer = [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0 ];
3233+ * var shape = [ 3, 2 ];
3234+ * var strides = [ 2, 1 ];
3235+ * var offset = 0;
3236+ *
3237+ * var x = ndarray( 'generic', buffer, shape, strides, offset, 'row-major' );
3238+ * // returns <ndarray>[ [ 1.0, 2.0 ], [ 3.0, 4.0 ], [ 5.0, 6.0 ] ]
3239+ *
3240+ * var y = ns.toFlippedud( x );
3241+ * // returns <ndarray>[ [ 5.0, 6.0 ], [ 3.0, 4.0 ], [ 1.0, 2.0 ] ]
3242+ */
3243+ toFlippedud : typeof toFlippedud ;
3244+
31223245 /**
31233246 * Serializes an ndarray as a JSON object.
31243247 *
0 commit comments