{{alias}}( x[, options], fcn[, thisArg] ) Flattens an ndarray according to a callback function. Parameters ---------- x: ndarray Input ndarray. options: Object (optional) Function options. options.depth: integer (optional) Maximum number of dimensions to flatten. By default, the function flattens all input ndarray dimensions. options.order: string (optional) Order in which input ndarray elements should be flattened. The following orders are supported: - row-major: flatten in lexicographic order. - column-major: flatten in colexicographic order. - same: flatten according to the stated order of the input ndarray. - any: flatten according to physical layout of the input ndarray data in memory, regardless of the stated order of the input ndarray. Default: 'row-major'. options.dtype: string (optional) Output ndarray data type. By default, the function returns an ndarray having the same data type as the provided input ndarray. fcn: Function Callback function. thisArg: any (optional) Callback execution context. Returns ------- out: ndarray Output ndarray. Examples -------- > var x = {{alias:@stdlib/ndarray/array}}( [ [ 1.0, 2.0 ], [ 3.0, 4.0 ] ] ); > function f ( v ) { return v * 2.0 }; > var y = {{alias}}( x, f ) [ 2.0, 4.0, 6.0, 8.0 ] See Also --------