time-to-botec

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

repl.txt (2580B)


      1 
      2 {{alias}}( N, x, stride )
      3     Computes the maximum absolute value of a sorted single-precision floating-
      4     point strided array.
      5 
      6     The input strided array must be sorted in either strictly ascending or
      7     descending order.
      8 
      9     The `N` and `stride` parameters determine which elements in `x` are accessed
     10     at runtime.
     11 
     12     Indexing is relative to the first index. To introduce an offset, use a typed
     13     array view.
     14 
     15     If `N <= 0`, the function returns `NaN`.
     16 
     17     Parameters
     18     ----------
     19     N: integer
     20         Number of indexed elements.
     21 
     22     x: Float32Array
     23         Sorted input array.
     24 
     25     stride: integer
     26         Index increment.
     27 
     28     Returns
     29     -------
     30     out: number
     31         Maximum absolute value.
     32 
     33     Examples
     34     --------
     35     // Standard Usage:
     36     > var x = new {{alias:@stdlib/array/float32}}( [ -1.0, -2.0, -3.0 ] );
     37     > {{alias}}( x.length, x, 1 )
     38     3.0
     39 
     40     // Using `N` and `stride` parameters:
     41     > x = new {{alias:@stdlib/array/float32}}( [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0 ] );
     42     > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
     43     > var stride = 2;
     44     > {{alias}}( N, x, stride )
     45     2.0
     46 
     47     // Using view offsets:
     48     > var x0 = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, 3.0 ] );
     49     > var x1 = new {{alias:@stdlib/array/float32}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
     50     > N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 );
     51     > stride = 2;
     52     > {{alias}}( N, x1, stride )
     53     3.0
     54 
     55 {{alias}}.ndarray( N, x, stride, offset )
     56     Computes the maximum absolute value of a sorted single-precision floating-
     57     point strided array using alternative indexing semantics.
     58 
     59     While typed array views mandate a view offset based on the underlying
     60     buffer, the `offset` parameter supports indexing semantics based on a
     61     starting index.
     62 
     63     Parameters
     64     ----------
     65     N: integer
     66         Number of indexed elements.
     67 
     68     x: Float32Array
     69         Sorted input array.
     70 
     71     stride: integer
     72         Index increment.
     73 
     74     offset: integer
     75         Starting index.
     76 
     77     Returns
     78     -------
     79     out: number
     80         Maximum absolute value.
     81 
     82     Examples
     83     --------
     84     // Standard Usage:
     85     > var x = new {{alias:@stdlib/array/float32}}( [ -1.0, -2.0, -3.0 ] );
     86     > {{alias}}.ndarray( x.length, x, 1, 0 )
     87     3.0
     88 
     89     // Using offset parameter:
     90     > var x = new {{alias:@stdlib/array/float32}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, 3.0 ] );
     91     > var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
     92     > {{alias}}.ndarray( N, x, 2, 1 )
     93     3.0
     94 
     95     See Also
     96     --------
     97