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

    Interns tuples of one fixed arity. Each distinct tuple of 32-bit integers gets a dense id, counted from 0 in the order of first appearance, so two tuples are equal when their ids are equal.

    Small tables fill ordinary arrays on demand. Larger tables keep components in a dense integer array. Both find tuples by open addressing, so intern and find take expected time linear in the arity and at takes constant time. Memory is linear in tuple count times arity.

    A table with a budget charges one Resource.Cells for each new tuple.

    Index
    • Parameters

      • arity: number
      • Optionalbudget: Budget

      Returns TupleTable

    arity: number

    The number of components of every tuple.

    • get size(): number

      The number of distinct tuples.

      Returns number

    • Returns the id of tuple, and stores the tuple under the next id when it is new.

      Parameters

      • tuple: ArrayLike<number>

      Returns number

    • Returns the id of tuple, or undefined when the table does not hold the tuple.

      Parameters

      • tuple: ArrayLike<number>

      Returns Maybe<number>

    • Returns the component of the tuple id at position, counted from 0.

      Parameters

      • id: number
      • position: number

      Returns number

    • Returns a copy of the components of the tuple id.

      Parameters

      • id: number

      Returns number[]