time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

repl.txt (1135B)


      1 
      2 {{alias}}( x, y )
      3     Interchanges two vectors.
      4 
      5     In general, for best performance, especially for large vectors, provide
      6     1-dimensional ndarrays whose underlying data type is either 'float64' or
      7     'float32'.
      8 
      9     Parameters
     10     ----------
     11     x: ndarray|ArrayLikeObject
     12         First input array.
     13 
     14     y: ndarray|ArrayLikeObject
     15         Second input array.
     16 
     17     Returns
     18     -------
     19     y: ndarray
     20         The second input array `y`.
     21 
     22     Examples
     23     --------
     24     // Using ndarrays...
     25     > var x = {{alias:@stdlib/ndarray/array}}( new {{alias:@stdlib/array/float64}}( [ 4.0, 2.0, -3.0, 5.0, -1.0 ] ) );
     26     > var y = {{alias:@stdlib/ndarray/array}}( new {{alias:@stdlib/array/float64}}( [ 2.0, 6.0, -1.0, -4.0, 8.0 ] ) );
     27     > {{alias}}( x, y );
     28     > x.data
     29     <Float64Array>[ 2.0, 6.0, -1.0, -4.0, 8.0 ]
     30     > y.data
     31     <Float64Array>[ 4.0, 2.0, -3.0, 5.0, -1.0 ]
     32 
     33     // Using array-like objects...
     34     > x = [ 4.0, 2.0, -3.0, 5.0, -1.0 ];
     35     > y = [ 2.0, 6.0, -1.0, -4.0, 8.0 ];
     36     > {{alias}}( x, y );
     37     > x
     38     [ 2.0, 6.0, -1.0, -4.0, 8.0 ]
     39     > y
     40     [ 4.0, 2.0, -3.0, 5.0, -1.0 ]
     41 
     42     See Also
     43     --------
     44