{{alias}}( base, dtype ) Returns a function which interchanges two vectors. Parameters ---------- base: Function Base function which interchanges two vectors. Must have an ndarray signature (i.e., must support index offsets). dtype: any Array data type. The function assumes that the data type of all provided arrays is the same. Returns ------- fcn: Function Function which interchanges two vectors. Examples -------- > var fcn = {{alias}}( {{alias:@stdlib/blas/base/dswap}}, 'float64' ) fcn( x, y[, dim] ) Interchanges two vectors. For multi-dimensional input arrays, the function performs batched computation, such that the function interchanges each pair of vectors in `x` and `y` according to the specified dimension index. Both input arrays must have the same shape. Parameters ---------- x: ndarray First input array. Must have at least one dimension and must have the same shape as the second input array. y: ndarray Second input array. Must have at least one dimension and must have the same shape as the first input array. dim: integer (optional) Dimension index along which to interchange vectors. Must be a negative integer. Negative indices are resolved relative to the last array dimension, with the last dimension corresponding to `-1`. Default: -1. Returns ------- y: ndarray The second input array `y`. Examples -------- > var fcn = {{alias}}( {{alias:@stdlib/blas/base/dswap}}.ndarray, 'float64' ); > var x = {{alias:@stdlib/ndarray/array}}( new {{alias:@stdlib/array/float64}}( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) ); > var y = {{alias:@stdlib/ndarray/array}}( new {{alias:@stdlib/array/float64}}( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) ); > fcn( x, y ); > x.data [ 2.0, 6.0, -1.0, -4.0, 8.0 ] > y.data [ 4.0, 2.0, -3.0, 5.0, -1.0 ] See Also --------