|
21 | 21 | /* eslint-disable max-lines */ |
22 | 22 |
|
23 | 23 | import unary = require( '@stdlib/math-array-tools-unary' ); |
| 24 | +import unaryFactory = require( '@stdlib/math-array-tools-unary-factory' ); |
24 | 25 |
|
25 | 26 | /** |
26 | 27 | * Interface describing the `tools` namespace. |
27 | 28 | */ |
28 | 29 | interface Namespace { |
29 | 30 | /** |
30 | | - * TODO |
| 31 | + * Constructor for applying a unary function to each element in a provided array. |
| 32 | + * |
| 33 | + * @param fcn - unary function to apply |
| 34 | + * @param idtypes - list of supported input data types |
| 35 | + * @param odtypes - list of supported output data types |
| 36 | + * @param policy - output data type policy |
| 37 | + * @returns instance |
| 38 | + * |
| 39 | + * @example |
| 40 | + * var base = require( '@stdlib/math-base-special-abs' ); |
| 41 | + * var dtypes = require( '@stdlib/array-dtypes' ); |
| 42 | + * |
| 43 | + * var idt = dtypes( 'real_and_generic' ); |
| 44 | + * var odt = idt; |
| 45 | + * var policy = 'same'; |
| 46 | + * |
| 47 | + * var abs = new Unary( base, idt, odt, policy ); |
| 48 | + * |
| 49 | + * var x = [ -1.0, -2.0, -3.0 ]; |
| 50 | + * |
| 51 | + * var y = abs.apply( x ); |
| 52 | + * // returns [ 1.0, 2.0, 3.0 ] |
31 | 53 | */ |
32 | 54 | unary: typeof unary; |
33 | 55 |
|
| 56 | + /** |
| 57 | + * Creates a function for applying a unary function to each element in a provided array. |
| 58 | + * |
| 59 | + * @param fcn - unary function to apply |
| 60 | + * @param idtypes - list of supported input data types |
| 61 | + * @param odtypes - list of supported output data types |
| 62 | + * @param policy - output data type policy |
| 63 | + * @returns function for applying a unary function |
| 64 | + * |
| 65 | + * @example |
| 66 | + * var base = require( '@stdlib/math-base-special-abs' ); |
| 67 | + * var dtypes = require( '@stdlib/array-dtypes' ); |
| 68 | + * |
| 69 | + * var idt = dtypes( 'real_and_generic' ); |
| 70 | + * var odt = idt; |
| 71 | + * var policy = 'same'; |
| 72 | + * |
| 73 | + * var abs = ns.unaryFactory( base, idt, odt, policy ); |
| 74 | + * |
| 75 | + * var x = [ -1.0, -2.0, -3.0 ]; |
| 76 | + * |
| 77 | + * var y = abs( x ); |
| 78 | + * // returns [ 1.0, 2.0, 3.0 ] |
| 79 | + */ |
| 80 | + unaryFactory: typeof unaryFactory; |
34 | 81 | } |
35 | 82 |
|
36 | 83 | /** |
|
0 commit comments