time-to-botec

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

repl.txt (3111B)


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