Iterators
iterator combinations[T](v: openArray[T]; r: static[int]): array[r, T]
- Source Edit
iterator combinations[T](v: seq[T]; r: int): seq[T]
- Source Edit
iterator combinations_withf[T](v: openArray[T]; r: int; f: proc (l, r: T): T): T
- combinations(v, r) の各組合せを f で左畳み込みした値を yield する。 例: f = proc(a,b:int):int = a*b なら 各組合せの総積。 接頭辞畳み込みを保持し、変化のあった添字以降のみ再計算する差分更新版。 Source Edit
iterator distinct_permutations[T](v: seq[T]): seq[T]
- next_permutaionをするのと同じ動作をします。 Source Edit
iterator partitions(n: int): seq[int] {....raises: [], tags: [].}
- 分割数列挙 Source Edit
iterator permutations[T](v: seq[T]): seq[T]
- pythonのitertoolsのpermutationsと同じ動作をします。 Source Edit
Templates
template accumulate[T](sequence: var seq[T]; operation: untyped)
- Source Edit
template accumulated[T](sequence: seq[T]; operation: untyped): seq[T]
- Source Edit
template accumulated[T](sequence: seq[T]; operation: untyped; first: T): seq[T]
- Source Edit
template accumulatedr[T](sequence: seq[T]; operation: untyped): seq[T]
- Source Edit
template accumulatedr[T](sequence: seq[T]; operation: untyped; first: T): seq[T]
- Source Edit
template accumulater[T](sequence: var seq[T]; operation: untyped)
- Source Edit