function factory() {
	var nargs;
	var unary;
	var fcn;
	var f;

	nargs = arguments.length;

	// Case: factory()
	if ( nargs === 0 ) {
		unary = main;
		f = wrap;
	}
	// Case: factory( fcn, opts )
	else if ( nargs > 1 ) {
		unary = mainFactory( arguments[ 1 ] );
		fcn = arguments[ 0 ];
		f = apply;
	}
	// Case: factory( fcn )
	else if ( isFunction( arguments[ 0 ] ) ) {
		unary = main;
		fcn = arguments[ 0 ];
		f = apply;
	}
	// Case: factory( opts )
	else {
		unary = mainFactory( arguments[ 0 ] );
		f = wrap;
	}
	return f;

	/**
	* Applies a one-dimensional strided array function to a list of specified dimensions in an input ndarray and assigns results to a provided output ndarray.
	*
	* @private
	* @param {ArrayLikeObject<Object>} arrays - array-like object containing ndarrays
	* @param {IntegerArray} dims - list of dimensions to which to apply a strided array function
	* @param {Options} [options] - function options
	* @returns {void}
	*/
	function apply( arrays, dims, options ) {
		var opts;
		if ( arguments.length > 2 ) {
			opts = options;
		} else {
			opts = {};
		}
		return unary( fcn, arrays, dims, opts );
	}

	/**
	* Applies a one-dimensional strided array function to a list of specified dimensions in an input ndarray and assigns results to a provided output ndarray.
	*
	* @private
	* @param {Function} fcn - wrapper for a one-dimensional strided array function
	* @param {ArrayLikeObject<Object>} arrays - array-like object containing ndarrays
	* @param {IntegerArray} dims - list of dimensions to which to apply a strided array function
	* @param {Options} [options] - function options
	* @returns {void}
	*/
	function wrap( fcn, arrays, dims, options ) {
		var opts;
		if ( arguments.length > 3 ) {
			opts = options;
		} else {
			opts = {};
		}
		return unary( fcn, arrays, dims, opts );
	}
}
Return a function for applying a one-dimensional strided array function to a list of specified dimensions in an input ndarray and assigning results to a provided output ndarray.

@param {Function} [fcn] - wrapper for a one-dimensional strided array function
@param {Options} [options] - function options
@param {boolean} [options.strictTraversalOrder=false] - boolean specifying whether to require that element traversal match the memory layout of an input ndarray
@throws {TypeError} options argument must be an object
@throws {TypeError} must provide valid options
@returns {Function} function for applying a strided array function

@example
var Float64Array = require( '@stdlib/array/float64' );
var ndarray2array = require( '@stdlib/ndarray/base/to-array' );
var getStride = require( '@stdlib/ndarray/base/stride' );
var getOffset = require( '@stdlib/ndarray/base/offset' );
var getData = require( '@stdlib/ndarray/base/data-buffer' );
var numelDimension = require( '@stdlib/ndarray/base/numel-dimension' );
var gcusum = require( '@stdlib/blas/ext/base/gcusum' ).ndarray;

function wrapper( arrays ) {
    var x = arrays[ 0 ];
    var y = arrays[ 1 ];
    var s = arrays[ 2 ];
    return gcusum( numelDimension( x, 0 ), getData( s )[ getOffset( s ) ], getData( x ), getStride( x, 0 ), getOffset( x ), getData( y ), getStride( y, 0 ), getOffset( y ) );
}

// Create data buffers:
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 ] );
var ybuf = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );

// Define the array shapes:
var xsh = [ 1, 3, 2, 2 ];
var ysh = [ 1, 3, 2, 2 ];

// Define the array strides:
var sx = [ 12, 4, 2, 1 ];
var sy = [ 12, 4, 2, 1 ];

// Define the index offsets:
var ox = 0;
var oy = 0;

// Create an input ndarray-like object:
var x = {
    'dtype': 'float64',
    'data': xbuf,
    'shape': xsh,
    'strides': sx,
    'offset': ox,
    'order': 'row-major'
};

// Create an ndarray-like object for the initial sum:
var initial = {
    'dtype': 'float64',
    'data': new Float64Array( [ 0.0 ] ),
    'shape': [ 1, 3 ],
    'strides': [ 0, 0 ],
    'offset': 0,
    'order': 'row-major'
};

// Create an output ndarray-like object:
var y = {
    'dtype': 'float64',
    'data': ybuf,
    'shape': ysh,
    'strides': sy,
    'offset': oy,
    'order': 'row-major'
};

// Create a function for applying a strided function:
var cusum = factory( wrapper );
// returns <Function>

// Apply strided function:
cusum( [ x, y, initial ], [ 2, 3 ] );

var arr = ndarray2array( y.data, y.shape, y.strides, y.offset, y.order );
// returns [ [ [ [ 1.0, 3.0 ], [ 6.0, 10.0 ] ], [ [ 5.0, 11.0 ], [ 18.0, 26.0 ] ], [ [ 9.0, 19.0 ], [ 30.0, 42.0 ] ] ] ]