{{alias}}( table, idtypes, odtypes, policies ) Returns an ndarray function interface for performing a reduction on an input ndarray. Parameters ---------- table: Object Dispatch table containing strided reduction functions. The table object must have the following property: - default: default strided reduction function to invoke when provided ndarrays have data types which do not have a corresponding specialized implementation. The table may having the following additional properties: - types: one-dimensional list of ndarray data types describing specialized input ndarray argument signatures. - fcns: list of strided reduction functions which are specific to specialized input ndarray argument signatures. A strided reduction function should have the following signature: f( arrays ) where - arrays: array containing an input ndarray, followed by any additional ndarray arguments. idtypes: Array> List containing lists of supported input array data types for each input ndarray argument. odtypes: Array List of supported output array data types. policies: Object Dispatch policies. Must have the following properties: - output: output data type policy. - casting: input ndarray casting policy. Returns ------- out: Object Instance having methods for performing a reduction. Examples -------- > var dts = [ 'float64', 'float32', 'generic' ]; > var p = { 'output': 'same', 'casting': 'none' }; > var t = { 'default': {{alias:@stdlib/stats/base/ndarray/max}} }; > var out = new {{alias}}( t, [ dts ], dts, p ); {{alias}}.prototype.apply( x[, ...args][, options] ) Performs a reduction on a provided input ndarray. Parameters ---------- x: ndarray Input array. args: ...ndarray (optional) Additional ndarray arguments. options: Object (optional) Function options. options.dtype: string|DataType (optional) Output array data type. Setting this option overrides the output data type policy. options.dims: Array (optional) List of dimensions over which to perform a reduction. If not provided, the function performs a reduction over all elements in a provided input ndarray. options.keepdims: boolean (optional) Boolean indicating whether the reduced dimensions should be included in the returned ndarray as singleton dimensions. Default: false. Returns ------- out: ndarray Output array. Examples -------- > var dts = [ 'float64', 'float32', 'generic' ]; > var p = { 'output': 'same', 'casting': 'none' }; > var t = { 'default': {{alias:@stdlib/stats/base/ndarray/max}} }; > var f = new {{alias}}( t, [ dts ], dts, p ); > var buf = [ -1.0, 2.0, -3.0, -4.0 ]; > var dt = 'generic'; > var sh = [ buf.length ]; > var sx = [ 1 ]; > var ox = 0; > var ord = 'row-major'; > var x = new {{alias:@stdlib/ndarray/ctor}}( dt, buf, sh, sx, ox, ord ); > var y = f.apply( x ); > var v = y.get() 2.0 {{alias}}.prototype.assign( x[, ...args], out[, options] ) Performs a reduction on a provided input ndarray and assigns results to a provided output ndarray. Parameters ---------- x: ndarray Input array. args: ...ndarray (optional) Additional ndarray arguments. out: ndarray Output array. options: Object (optional) Function options. options.dims: Array (optional) List of dimensions over which to perform a reduction. If not provided, the function performs a reduction over all elements in a provided input ndarray. Returns ------- out: ndarray Output array. Examples -------- > var dts = [ 'float64', 'float32', 'generic' ]; > var p = { 'output': 'same', 'casting': 'none' }; > var t = { 'default': {{alias:@stdlib/stats/base/ndarray/max}} }; > var f = new {{alias}}( t, [ dts ], dts, p ); > var buf = [ -1.0, 2.0, -3.0, -4.0 ]; > var dt = 'generic'; > var sh = [ buf.length ]; > var sx = [ 1 ]; > var ox = 0; > var ord = 'row-major'; > var x = new {{alias:@stdlib/ndarray/ctor}}( dt, buf, sh, sx, ox, ord ); > var out = {{alias:@stdlib/ndarray/zeros}}( [], { 'dtype': dt } ); > var y = f.assign( x, out ) > var bool = ( out === y ) true > var v = out.get() 2.0 See Also --------