Interface TwolayerGreedy<Op>

a Twolayer that greedily swaps nodes

Create with twolayerGreedy.

interface TwolayerGreedy<Op extends Twolayer = Twolayer> {
    base<NewOp extends Twolayer<never, never>>(
        val: NewOp,
    ): TwolayerGreedy<NewOp>;
    base(): Op;
    scan(val: boolean): TwolayerGreedy<Op>;
    scan(): boolean;
    (
        topLayer: SugiNode<
            Op extends Twolayer<N, never> ? N : never,
            Op extends Twolayer<never, L> ? L : never,
        >[],
        bottomLayer: SugiNode<
            Op extends Twolayer<N, never> ? N : never,
            Op extends Twolayer<never, L> ? L : never,
        >[],
        topDown: boolean,
    ): void;
}

Type Parameters

Hierarchy (View Summary)

  • rearrange one layer conditioned on another

    Parameters

    • topLayer: SugiNode<
          Op extends Twolayer<N, never> ? N : never,
          Op extends Twolayer<never, L> ? L : never,
      >[]

      the top layer

    • bottomLayer: SugiNode<
          Op extends Twolayer<N, never> ? N : never,
          Op extends Twolayer<never, L> ? L : never,
      >[]

      the bottom layer

    • topDown: boolean

      if true rearrange bottomLayer, else rearrange topLayer

    Returns void

Methods

Methods