Skip to content

Commit 6325ca2

Browse files
committed
Auto-generated commit
1 parent 66f23b5 commit 6325ca2

File tree

2 files changed

+125
-0
lines changed

2 files changed

+125
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
### Features
1212

13+
- [`d597c1d`](https://github.com/stdlib-js/stdlib/commit/d597c1d7b7dcb6b9a8d30e93b0042b61b0b2f130) - update `ndarray` TypeScript declarations [(#11048)](https://github.com/stdlib-js/stdlib/pull/11048)
1314
- [`02c34bc`](https://github.com/stdlib-js/stdlib/commit/02c34bcc0cdd0ebba2f0fc8c311534aebf1ede2a) - add `everyBy` to namespace
1415
- [`37969ad`](https://github.com/stdlib-js/stdlib/commit/37969adc28a67964a680c4205775d12383d02938) - add `ndarray/every-by` [(#11012)](https://github.com/stdlib-js/stdlib/pull/11012)
1516
- [`c412a6e`](https://github.com/stdlib-js/stdlib/commit/c412a6efedf30e63a34d2ac7850bd69fc89e6f48) - add `toFlippedud` to namespace
@@ -790,6 +791,7 @@ A total of 44 issues were closed in this release:
790791

791792
<details>
792793

794+
- [`d597c1d`](https://github.com/stdlib-js/stdlib/commit/d597c1d7b7dcb6b9a8d30e93b0042b61b0b2f130) - **feat:** update `ndarray` TypeScript declarations [(#11048)](https://github.com/stdlib-js/stdlib/pull/11048) _(by stdlib-bot)_
793795
- [`23887f6`](https://github.com/stdlib-js/stdlib/commit/23887f6a96dbba2fd988205a9db15aafad49d3a1) - **docs:** update namespace table of contents [(#11049)](https://github.com/stdlib-js/stdlib/pull/11049) _(by stdlib-bot)_
794796
- [`02c34bc`](https://github.com/stdlib-js/stdlib/commit/02c34bcc0cdd0ebba2f0fc8c311534aebf1ede2a) - **feat:** add `everyBy` to namespace _(by Athan Reines)_
795797
- [`37969ad`](https://github.com/stdlib-js/stdlib/commit/37969adc28a67964a680c4205775d12383d02938) - **feat:** add `ndarray/every-by` [(#11012)](https://github.com/stdlib-js/stdlib/pull/11012) _(by Muhammad Haris)_

docs/types/index.d.ts

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ import dtypes = require( './../../dtypes' );
4545
import empty = require( './../../empty' );
4646
import emptyLike = require( './../../empty-like' );
4747
import every = require( './../../every' );
48+
import everyBy = require( './../../every-by' );
4849
import FancyArray = require( './../../fancy' );
4950
import fill = require( './../../fill' );
5051
import fillBy = require( './../../fill-by' );
@@ -109,6 +110,8 @@ import stride = require( './../../stride' );
109110
import strides = require( './../../strides' );
110111
import sub2ind = require( './../../sub2ind' );
111112
import ndarray2array = require( './../../to-array' );
113+
import toFlippedlr = require( './../../to-flippedlr' );
114+
import toFlippedud = require( './../../to-flippedud' );
112115
import ndarray2json = require( './../../to-json' );
113116
import toReversed = require( './../../to-reversed' );
114117
import 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

Comments
 (0)