Free Touch Pricker
    Preparing search index...

    Class Table

    Data table that stores a number for each row.

    Data tables can be large and are stored separately from the core library. They can be downloaded when required.

    Once a table has been built it can be compressed by packing multiple rows into a smaller number of bytes. Tables containing smaller values can be packed more tightly.

    > const buffer = readFileSync('stedman.7.dat');
    > const data = new Uint8Array(buffer.buffer);
    > const table = new Table(Stage.Triples, data);
    > table.getValue(0);
    0
    > table.getValue(5039);
    7
    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    • Constructor.

      Parameters

      • _stage: Stage

        Stage on which the data is valid

      • Optionaldata: Uint8Array<ArrayBufferLike>

        Compressed table data (omit to create an empty table)

      Returns Table

      if the provided data cannot be unpacked

    Properties

    _data: Uint8Array

    Table data.

    Stores the value for each row indexed by rank. On stage n this array will contain n! entries.

    Accessors

    • get data(): Uint8Array

      Provides read access to compressed table data.

      Returns Uint8Array

    • get length(): number

      Provides easy access to the number of entries in the table.

      Returns number

    • get maximum(): number

      Provides easy access to the maximum value in the table.

      Returns number

    Methods

    • Retrieves a value from the table.

      Parameters

      • rank: number

        Rank of the row for which to retrieve the value

      Returns number

      retrieved value (this must be between 0 and 15)

      if the provided rank is out of range

    • Stores a value in the table.

      Parameters

      • rank: number

        Rank of the row for which to set the value

      • value: number

        Value to set

      Returns void

      if the provided rank or value are out of range

    • Unpacks compressed table data into the internal data array.

      Parameters

      • data: Uint8Array

        Compressed table data to unpack

      Returns void

      if the data cannot be unpacked