src/cplib/graph/functional_graph_with_op

    Dark Mode
Search:
Group by:
  Source   Edit

Types

FunctionalGraph_with_op[T] = ref object
  F: Functional_Graph
  op: proc (x, y: T): T
  e: T
  st_hld: SegmentTree[T]
  st_cycle: SegmentTree[T]
  cum_cyclesize: seq[int]
  Source   Edit

Procs

proc `[]=`[T](self: FunctionalGraph_with_op[T]; x: int; value: T)
  Source   Edit
proc canmove_size[T](self: FunctionalGraph_with_op[T]; x: int): int
  Source   Edit
proc count_kth[T](self: FunctionalGraph_with_op[T]; x, k: int): int
  Source   Edit
proc cyclesize[T](self: FunctionalGraph_with_op[T]; x: int): int
  Source   Edit
proc depth[T](self: FunctionalGraph_with_op[T]; x: int): int
  Source   Edit
proc dist[T](self: FunctionalGraph_with_op[T]; u, v: int): int
  Source   Edit
proc get_cycle[T](self: FunctionalGraph_with_op[T]; x: int): seq[int]
  Source   Edit
proc incycle[T](self: FunctionalGraph_with_op[T]; x: int): bool
  Source   Edit
proc initFunctionalGraph_with_op[T](A: openArray[int]; values: seq[T];
                                    op: proc (l, r: T): T; e: T): FunctionalGraph_with_op[
    T]
  Source   Edit
proc initFunctionalGraph_with_op[T](G: UnWeightedDirectedGraph; values: seq[T];
                                    op: proc (l, r: T): T; e: T): FunctionalGraph_with_op[
    T]
  Source   Edit
proc move_while[T](self: FunctionalGraph_with_op[T]; f: proc (x: T): bool;
                   x, L: int): int
  Source   Edit
proc movekth[T](self: FunctionalGraph_with_op[T]; x, cnt: int): int
  Source   Edit
proc prod[T](self: FunctionalGraph_with_op[T]; start: int; k: int;
             include_start: bool = true): T
startからk回移動するまでの積。include_start=falseなら始点を積に含めない。   Source   Edit
proc prod_range[T](self: FunctionalGraph_with_op[T]; start, l, r: int;
                   include_start: bool = true): seq[T]
@[prod(start,l), ..., prod(start,r-1)]を返す。O(log^2 N + log l + (r-l))   Source   Edit
proc prod_range_fold[T](self: FunctionalGraph_with_op[T]; start, l, r: int;
                        f: proc (l, r: T): T; e: T; include_start: bool = true): T
prod(start,l), ..., prod(start,r-1)を順にfで畳み込む。O(log^2 N + log l + (r-l))   Source   Edit
proc prod_reachable_idempotent_all[T](self: FunctionalGraph_with_op[T]): seq[T]
各頂点から到達可能な相異なる頂点の値の積を全頂点について返す。 opは結合的・可換・冪等でなければならない。O(N)   Source   Edit
proc reachable_to_size[T](self: FunctionalGraph_with_op[T]; x: int): int
  Source   Edit
proc root[T](self: FunctionalGraph_with_op[T]; x: int): int
  Source   Edit
proc set[T](self: FunctionalGraph_with_op[T]; x: int; value: T)
  Source   Edit
proc walk[T](self: FunctionalGraph_with_op[T]; x, k: int): seq[int]
  Source   Edit