time-to-botec

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

repl.txt (3544B)


      1 
      2 {{alias}}( N, x, strideX, y, strideY )
      3     Computes the absolute value for each element in a double-precision floating-
      4     point strided array `x` and assigns the results to elements in a double-
      5     precision floating-point strided array `y`.
      6 
      7     The `N` and `stride` parameters determine which elements in `x` and `y` are
      8     accessed at runtime.
      9 
     10     Indexing is relative to the first index. To introduce an offset, use typed
     11     array views.
     12 
     13     Parameters
     14     ----------
     15     N: integer
     16         Number of indexed elements.
     17 
     18     x: Float64Array
     19         Input array.
     20 
     21     strideX: integer
     22         Index increment for `x`.
     23 
     24     y: Float64Array
     25         Destination array.
     26 
     27     strideY: integer
     28         Index increment for `y`.
     29 
     30     Returns
     31     -------
     32     y: Float64Array
     33         Input array `y`.
     34 
     35     Examples
     36     --------
     37     // Standard usage:
     38     > var x = new {{alias:@stdlib/array/float64}}( [ -1.0, -2.0, -3.0, -4.0 ] );
     39     > var y = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] );
     40     > {{alias}}( x.length, x, 1, y, 1 )
     41     <Float64Array>[ 1.0, 2.0, 3.0, 4.0 ]
     42 
     43     // Using `N` and `stride` parameters:
     44     > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
     45     > y = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] );
     46     > {{alias}}( N, x, 2, y, -1 )
     47     <Float64Array>[ 3.0, 1.0, 0.0, 0.0 ]
     48 
     49     // Using view offsets:
     50     > var x0 = new {{alias:@stdlib/array/float64}}( [ -1.0, -2.0, -3.0, -4.0 ] );
     51     > var y0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] );
     52     > var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
     53     > var y1 = new {{alias:@stdlib/array/float64}}( y0.buffer, y0.BYTES_PER_ELEMENT*2 );
     54     > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 );
     55     > {{alias}}( N, x1, -2, y1, 1 )
     56     <Float64Array>[ 4.0, 2.0 ]
     57     > y0
     58     <Float64Array>[ 0.0, 0.0, 4.0, 2.0 ]
     59 
     60 
     61 {{alias}}.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )
     62     Computes the absolute value for each element in a double-precision floating-
     63     point strided array `x` and assigns the results to elements in a double-
     64     precision floating-point strided array `y` using alternative indexing
     65     semantics.
     66 
     67     While typed array views mandate a view offset based on the underlying
     68     buffer, the `offsetX` and `offsetY` parameters support indexing semantics
     69     based on starting indices.
     70 
     71     Parameters
     72     ----------
     73     N: integer
     74         Number of indexed elements.
     75 
     76     x: Float64Array
     77         Input array.
     78 
     79     strideX: integer
     80         Index increment for `x`.
     81 
     82     offsetX: integer
     83         Starting index for `x`.
     84 
     85     y: Float64Array
     86         Destination array.
     87 
     88     strideY: integer
     89         Index increment for `y`.
     90 
     91     offsetY: integer
     92         Starting index for `y`.
     93 
     94     Returns
     95     -------
     96     y: Float64Array
     97         Input array `y`.
     98 
     99     Examples
    100     --------
    101     // Standard usage:
    102     > var x = new {{alias:@stdlib/array/float64}}( [ -1.0, -2.0, -3.0, -4.0 ] );
    103     > var y = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] );
    104     > {{alias}}.ndarray( x.length, x, 1, 0, y, 1, 0 )
    105     <Float64Array>[ 1.0, 2.0, 3.0, 4.0 ]
    106 
    107     // Advanced indexing:
    108     > x = new {{alias:@stdlib/array/float64}}( [ -1.0, -2.0, -3.0, -4.0 ] );
    109     > y = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.0, 0.0, 0.0 ] );
    110     > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
    111     > {{alias}}.ndarray( N, x, 2, 1, y, -1, y.length-1 )
    112     <Float64Array>[ 0.0, 0.0, 4.0, 2.0 ]
    113 
    114     See Also
    115     --------
    116