src/cplib/collections/lazysegtree

  Source   Edit

Types

LazySegmentTree[S; F] = ref object
  default: S
  merge: proc (x: S; y: S): S
  arr*: seq[S]
  lazy*: seq[F]
  mapping: proc (f: F; x: S): S
  composition: proc (f, g: F): F
  id: F
  lastnode: int
  log: int
  length: int
  Source   Edit

Procs

proc `$`[S, F](self: var LazySegmentTree[S, F]): string
  Source   Edit
proc `[]=`[S, F](self: var LazySegmentTree[S, F]; p: Natural; val: S)
  Source   Edit
proc `[]`[S, F](self: var LazySegmentTree[S, F]; p: Natural): S
  Source   Edit
proc `[]`[S, F](self: var LazySegmentTree[S, F]; segment: HSlice[int, int]): S
  Source   Edit
proc apply[S, F](self: var LazySegmentTree[S, F]; q_left, q_right: int; f: F)
半解区間[q_left,q_right)についての演算結果を返します。   Source   Edit
proc apply[S, F](self: var LazySegmentTree[S, F]; segment: HSlice[int, int];
                 f: F)
  Source   Edit
proc get[S, F](self: var LazySegmentTree[S, F]; q_left, q_right: int): S
半解区間[q_left,q_right)についての演算結果を返します。   Source   Edit
proc get[S, F](self: var LazySegmentTree[S, F]; segment: HSlice[int, int]): S
  Source   Edit
proc initLazySegmentTree[S, F](v_or_n: int or seq[S];
                               merge: proc (x: S; y: S): S; default: S;
                               mapping: proc (f: F; x: S): S;
                               composition: proc (f, g: F): F; id: F): LazySegmentTree[
    S, F]
  Source   Edit
proc len[S, F](self: var LazySegmentTree[S, F]): int
  Source   Edit
proc update[S, F](self: var LazySegmentTree[S, F]; p: Natural; val: S)
pの要素をvalに変更します。   Source   Edit

Templates

template newLazySegWith(v_or_n, merge, default, mapping, composition, id: untyped): untyped
  Source   Edit