Function computeTupleIndices

  • Decomposes a tuple into a chain of tuples of arity paramTupleArity, indexing the tuples starting from firstAvailableTupleIndex.

    Generates part of the signal inputs for MultiTupleModule.

    Examples: computeTupleIndices(2, 5, [1, 3, 4]) === [[1, 3], [5, 4]] computeTupleIndices(3, 5, [0, 1, 4, 2]) === [[0, 1, 4], [5, 2, 0]] computeTupleIndices(4, 6, [3, 4, 2, 1, 5]) === [[3, 4, 2, 1], [6, 5, 3, 3]]

    This procedure takes an N-tuple of indices (referring to elements of some array of values) and returns its representation as an appropriately linked sequence of tuples of arity paramTupleArity, where these tuples are indexed starting at firstAvailableTupleIndex and the first index is used as padding. 'Appropriately linked' means that the first slot of every output tuple after the first has an index referring to the preceding tuple.

    Parameters

    • paramTupleArity: number

      the arity of the output tuple

    • firstAvailableTupleIndex: number

      the index of the first output tuple in the combined array of entry and tuple value hashes

    • indices: number[]

      the entry value indices forming the input tuple

    Returns number[][]

    list of index tuples of arity paramTupleArity representing the input tuple

    Throws

    RangeError if the parameters are not in the proper ranges.

Generated using TypeDoc