time-to-botec

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

repl.txt (1348B)


      1 
      2 {{alias}}( iterator, W )
      3     Returns an iterator which iteratively computes a moving sum of absolute
      4     values.
      5 
      6     The `W` parameter defines the number of iterated values over which to
      7     compute the moving sum.
      8 
      9     As `W` values are needed to fill the window buffer, the first `W-1` returned
     10     values are calculated from smaller sample sizes. Until the window is full,
     11     each returned value is calculated from all previously iterated values.
     12 
     13     If an environment supports Symbol.iterator, the returned iterator is
     14     iterable.
     15 
     16     Parameters
     17     ----------
     18     iterator: Object
     19         Input iterator.
     20 
     21     W: integer
     22         Window size.
     23 
     24     Returns
     25     -------
     26     iterator: Object
     27         Iterator.
     28 
     29     iterator.next(): Function
     30         Returns an iterator protocol-compliant object containing the next
     31         iterated value (if one exists) and a boolean flag indicating whether the
     32         iterator is finished.
     33 
     34     iterator.return( [value] ): Function
     35         Finishes an iterator and returns a provided value.
     36 
     37     Examples
     38     --------
     39     > var arr = {{alias:@stdlib/array/to-iterator}}( [ 2.0, -5.0, 3.0, 5.0 ] );
     40     > var it = {{alias}}( arr, 3 );
     41     > var s = it.next().value
     42     2.0
     43     > s = it.next().value
     44     7.0
     45     > s = it.next().value
     46     10.0
     47     > s = it.next().value
     48     13.0
     49 
     50     See Also
     51     --------
     52