TOC Toolkit API - v0.1.0
    Preparing search index...

    A partition of the integers that are below its capacity into blocks, which a caller splits by marking members. The blocks occupy disjoint ranges of one member array, and marking moves a member to the front of its block. refine then cuts every block that has marked members off at that front, in time linear in the marked members. A splitter queue holds the blocks that still have to be used as splitters.

    Members are the integers of the blocks that the caller gives, and block numbers count from 0 in the order in which the blocks appear. A block that a split cuts off gets the next number, and the old block keeps the unmarked rest.

    Index
    • Makes one block of each nonempty list in blocks, whose members are below capacity.

      Parameters

      • blocks: readonly (readonly number[])[]
      • capacity: number

      Returns Partition

    • get count(): number

      The number of blocks.

      Returns number

    • get capacity(): number

      The number of integers that a member may be below.

      Returns number

    • The block that holds state.

      Parameters

      • state: number

      Returns number

    • The number of members of block.

      Parameters

      • block: number

      Returns number

    • Replaces the content of buffer with the members of block, reusing its storage.

      Parameters

      • block: number
      • buffer: number[]

      Returns void

    • The smallest state of every block, found in one sweep of the member array.

      Returns readonly number[]

    • Marks a member, so that the next refine cuts it off from the unmarked members.

      Parameters

      • state: number

      Returns void

    • Splits every block with marked members, and reports each split as the old and the new block.

      Parameters

      • budget: Budget
      • split: (oldBlock: number, newBlock: number) => void

      Returns void