Skip to content

Commit 7c90e21

Browse files
committed
Auto-generated commit
1 parent bb6b69b commit 7c90e21

File tree

2 files changed

+157
-0
lines changed

2 files changed

+157
-0
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
##### Features
2222

23+
- [`1a202e3`](https://github.com/stdlib-js/stdlib/commit/1a202e3605b10cd01bf9654f8356c72c5c8a8186) - update namespace TypeScript declarations [(#3916)](https://github.com/stdlib-js/stdlib/pull/3916)
2324
- [`dbfd8f5`](https://github.com/stdlib-js/stdlib/commit/dbfd8f5c81d11be2142ebfc4f2f0bb0316ba7478) - add `filterMap` to namespace
2425
- [`cbc4d3f`](https://github.com/stdlib-js/stdlib/commit/cbc4d3f7514b7213cad4f9d2ca5d916e13eeffa5) - add `reject` to namespace
2526
- [`831de1b`](https://github.com/stdlib-js/stdlib/commit/831de1b4ba21cda245c073a5412bf1a2e9d7598d) - add `map` and `filter` to namespace
@@ -363,6 +364,7 @@ A total of 3 people contributed to this release. Thank you to the following cont
363364

364365
<details>
365366

367+
- [`1a202e3`](https://github.com/stdlib-js/stdlib/commit/1a202e3605b10cd01bf9654f8356c72c5c8a8186) - **feat:** update namespace TypeScript declarations [(#3916)](https://github.com/stdlib-js/stdlib/pull/3916) _(by stdlib-bot, Philipp Burckhardt)_
366368
- [`ef82c21`](https://github.com/stdlib-js/stdlib/commit/ef82c2133cc2cb955eb1fc73da0209eda97de59a) - **docs:** update namespace table of contents [(#3918)](https://github.com/stdlib-js/stdlib/pull/3918) _(by stdlib-bot, Philipp Burckhardt)_
367369
- [`14427c7`](https://github.com/stdlib-js/stdlib/commit/14427c79bc62f82b16cbadc9d34749901e48d105) - **feat:** add `fill`, `map`, and `toReversed` to namespace _(by Athan Reines)_
368370
- [`a0d6619`](https://github.com/stdlib-js/stdlib/commit/a0d66193409576538d0f16aa89cbaeedec7898be) - **feat:** add `minSignedIntegerDataType` and `minUnsignedIntegerDataType` to namespace _(by Athan Reines)_

docs/types/index.d.ts

+155
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,15 @@ import dtypes = require( './../../dtypes' );
3535
import empty = require( './../../empty' );
3636
import emptyLike = require( './../../empty-like' );
3737
import FancyArray = require( './../../fancy' );
38+
import filter = require( './../../filter' );
39+
import filterMap = require( './../../filter-map' );
3840
import flag = require( './../../flag' );
3941
import flags = require( './../../flags' );
4042
import scalar2ndarray = require( './../../from-scalar' );
4143
import ind2sub = require( './../../ind2sub' );
4244
import indexModes = require( './../../index-modes' );
4345
import iter = require( './../../iter' );
46+
import map = require( './../../map' );
4447
import maybeBroadcastArray = require( './../../maybe-broadcast-array' );
4548
import maybeBroadcastArrays = require( './../../maybe-broadcast-arrays' );
4649
import minDataType = require( './../../min-dtype' );
@@ -55,6 +58,7 @@ import order = require( './../../order' );
5558
import orders = require( './../../orders' );
5659
import outputDataTypePolicies = require( './../../output-dtype-policies' );
5760
import promotionRules = require( './../../promotion-rules' );
61+
import reject = require( './../../reject' );
5862
import safeCasts = require( './../../safe-casts' );
5963
import sameKindCasts = require( './../../same-kind-casts' );
6064
import shape = require( './../../shape' );
@@ -563,6 +567,83 @@ interface Namespace {
563567
*/
564568
FancyArray: typeof FancyArray;
565569

570+
/**
571+
* Returns a shallow copy of an ndarray containing only those elements which pass a test implemented by a predicate function.
572+
*
573+
* @param x - input ndarray
574+
* @param options - options
575+
* @param options.dtype - output ndarray data type
576+
* @param options.order - iteration order
577+
* @param predicate - predicate function
578+
* @param thisArg - predicate function execution context
579+
* @returns output ndarray
580+
*
581+
* @example
582+
* var isEven = require( '@stdlib/assert/is-even' ).isPrimitive;
583+
* var Float64Array = require( '@stdlib/array/float64' );
584+
* var ndarray = require( './../../ctor' );
585+
* var ndarray2array = require( './../../to-array' );
586+
*
587+
* var buffer = 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 ] );
588+
* var shape = [ 2, 3 ];
589+
* var strides = [ 6, 1 ];
590+
* var offset = 1;
591+
*
592+
* var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' );
593+
* // returns <ndarray>
594+
*
595+
* var opts = {
596+
* 'dtype': 'generic'
597+
* };
598+
* var y = ns.filter( x, opts, isEven );
599+
* // returns <ndarray>
600+
*
601+
* var arr = ndarray2array( y );
602+
* // returns [ 2.0, 4.0, 8.0, 10.0 ]
603+
*/
604+
filter: typeof filter;
605+
606+
/**
607+
* Filters and maps elements in an input ndarray to elements in a new output ndarray according to a callback function.
608+
*
609+
* @param x - input ndarray
610+
* @param options - options
611+
* @param options.dtype - output ndarray data type
612+
* @param options.order - iteration order
613+
* @param fcn - callback function
614+
* @param thisArg - callback function execution context
615+
* @returns output ndarray
616+
*
617+
* @example
618+
* var Float64Array = require( '@stdlib/array/float64' );
619+
* var ndarray = require( './../../ctor' );
620+
* var ndarray2array = require( './../../to-array' );
621+
*
622+
* function scale( z ) {
623+
* if ( z > 5.0 ) {
624+
* return z * 10.0;
625+
* }
626+
* }
627+
*
628+
* var buffer = 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 ] );
629+
* var shape = [ 2, 3 ];
630+
* var strides = [ 6, 1 ];
631+
* var offset = 1;
632+
*
633+
* var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' );
634+
* // returns <ndarray>
635+
*
636+
* var opts = {
637+
* 'dtype': 'generic'
638+
* };
639+
* var y = ns.filterMap( x, opts, scale );
640+
* // returns <ndarray>
641+
*
642+
* var arr = ndarray2array( y );
643+
* // returns [ 80.0, 90.0, 100.0 ]
644+
*/
645+
filterMap: typeof filterMap;
646+
566647
/**
567648
* Returns a specified flag for a provided ndarray.
568649
*
@@ -693,6 +774,44 @@ interface Namespace {
693774
*/
694775
iter: typeof iter;
695776

777+
/**
778+
* Applies a callback function to elements in an input ndarray and assigns results to elements in a new output ndarray.
779+
*
780+
* @param x - input ndarray
781+
* @param options - options
782+
* @param options.dtype - output ndarray data type
783+
* @param fcn - callback function
784+
* @param thisArg - callback function execution context
785+
* @returns output ndarray
786+
*
787+
* @example
788+
* var Float64Array = require( '@stdlib/array/float64' );
789+
* var ndarray = require( './../../ctor' );
790+
* var ndarray2array = require( './../../to-array' );
791+
*
792+
* function scale( z ) {
793+
* return z * 10.0;
794+
* }
795+
*
796+
* var buffer = 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 ] );
797+
* var shape = [ 2, 3 ];
798+
* var strides = [ 6, 1 ];
799+
* var offset = 1;
800+
*
801+
* var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' );
802+
* // returns <ndarray>
803+
*
804+
* var opts = {
805+
* 'dtype': 'generic'
806+
* };
807+
* var y = ns.map( x, opts, scale );
808+
* // returns <ndarray>
809+
*
810+
* var arr = ndarray2array( y );
811+
* // returns [ [ 20, 30, 40 ], [ 80, 90, 100 ] ]
812+
*/
813+
map: typeof map;
814+
696815
/**
697816
* Broadcasts an ndarray to a specified shape if and only if the specified shape differs from the provided ndarray's shape.
698817
*
@@ -1019,6 +1138,42 @@ interface Namespace {
10191138
*/
10201139
promotionRules: typeof promotionRules;
10211140

1141+
/**
1142+
* Returns a shallow copy of an ndarray containing only those elements which fail a test implemented by a predicate function.
1143+
*
1144+
* @param x - input ndarray
1145+
* @param options - options
1146+
* @param options.dtype - output ndarray data type
1147+
* @param options.order - iteration order
1148+
* @param predicate - predicate function
1149+
* @param thisArg - predicate function execution context
1150+
* @returns output ndarray
1151+
*
1152+
* @example
1153+
* var isOdd = require( '@stdlib/assert/is-odd' ).isPrimitive;
1154+
* var Float64Array = require( '@stdlib/array/float64' );
1155+
* var ndarray = require( './../../ctor' );
1156+
* var ndarray2array = require( './../../to-array' );
1157+
*
1158+
* var buffer = 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 ] );
1159+
* var shape = [ 2, 3 ];
1160+
* var strides = [ 6, 1 ];
1161+
* var offset = 1;
1162+
*
1163+
* var x = ndarray( 'float64', buffer, shape, strides, offset, 'row-major' );
1164+
* // returns <ndarray>
1165+
*
1166+
* var opts = {
1167+
* 'dtype': 'generic'
1168+
* };
1169+
* var y = ns.reject( x, opts, isOdd );
1170+
* // returns <ndarray>
1171+
*
1172+
* var arr = ndarray2array( y );
1173+
* // returns [ 2.0, 4.0, 8.0, 10.0 ]
1174+
*/
1175+
reject: typeof reject;
1176+
10221177
/**
10231178
* Returns a list of ndarray data types to which a provided ndarray data type can be safely cast.
10241179
*

0 commit comments

Comments
 (0)