Source
Edit
To paraphrase Mandalorians: "These are the ways" (various algorithms).
proc diffs[T](src: seq[T]; stride = 1): seq[T]
-
Batch first differences of random-access src (vectorizable).
Source
Edit
iterator diffs[T](src: iterator (): T; stride = 1): T
-
First differences
Source
Edit
iterator diffs2[T](src: iterator (): T; stride = 1): T
-
Second differences
Source
Edit
iterator kWayMerge[T](itrs: openArray[iterator (): T]): T
-
k-way merge of ordered itrs[i] yields using std/heapqueue.
Source
Edit
iterator returns[T](src: iterator (): T; stride = 1): T
-
Arithmetic returns (of, e.g. prices)
Source
Edit