Macaulay2 » Documentation
Packages » Macaulay2Doc » The Macaulay2 language » hash tables » HashTable
next | previous | forward | backward | up | index | toc

# HashTable -- the class of all hash tables

## Description

A hash table consists of: a class type, a parent type, and a set of key-value pairs. The keys and values can be anything. The access functions below accept a key and return the corresponding value. For details of the mechanism underlying this, see hashing.

One important feature of hash tables that when the keys are consecutive integers starting at 0, the keys are scanned in the natural order.

There is a subclass of HashTable called MutableHashTable which consists of those hash tables whose entries can be changed.

This node is currently in progress!!!

## See also

- # -- length or access to elements
- . -- access to elements whose key is a symbol
- #? -- check existence of value in a list, hash table, database, or string
- .? -- check for presence of elements whose key is a symbol

### Menu

- VirtualTally
- OptionTable -- the class of hash tables for optional arguments

## Types of hash table:

- DocumentTag -- the class of all document tags
- Ideal -- the class of all ideals
- ImmutableType -- the class of all immutable types
- Matrix -- the class of all matrices
- MonoidElement -- the class of all monoid elements
- MutableHashTable -- the class of all mutable hash tables
- MutableMatrix -- the class of all mutable matrices
- OptionTable -- the class of hash tables for optional arguments
- Program -- external program object
- ProgramRun -- result of running an external program
- ProjectiveHilbertPolynomial -- the class of all Hilbert polynomials
- RingMap -- the class of all ring maps
- `TestInput` -- see tests -- locate a package's tests
- VirtualTally

## Functions and methods returning a hash table:

- `applyKeys(HashTable,Function)` -- see applyKeys -- apply a function to each key in a hash table
- `applyKeys(HashTable,Function,Function)` -- see applyKeys -- apply a function to each key in a hash table
- `applyPairs(HashTable,Function)` -- see applyPairs -- apply a function to each pair in a hash table
- `applyValues(HashTable,Function)` -- see applyValues -- apply a function to each value in a hash table
- `hashTable(BasicList)` -- see hashTable -- make a hash table
- `hashTable(Function,BasicList)` -- see hashTable -- make a hash table
- `instances(Type)` -- see instances
- `merge(HashTable,HashTable,Function)` -- see merge -- merge two hash tables
- new HashTable from List -- make a hash table from a list
- parent(HashTable) (missing documentation)
- `partition(Function,VirtualTally)` -- see partition -- partition a set or list by values of a function
- `partition(Function,VirtualTally,VisibleList)` -- see partition -- partition a set or list by values of a function
- `partition(Function,VisibleList)` -- see partition -- partition a set or list by values of a function
- `partition(Function,VisibleList,VisibleList)` -- see partition -- partition a set or list by values of a function
- `selectKeys(HashTable,Function)` -- see selectKeys -- select a part of a hash table by keys
- `selectKeys(ZZ,HashTable,Function)` -- see selectKeys -- select a part of a hash table by keys
- `selectPairs(HashTable,Function)` -- see selectPairs -- select a part of a hash table by pairs
- `selectPairs(ZZ,HashTable,Function)` -- see selectPairs -- select a part of a hash table by pairs
- `select(HashTable,Function)` -- see selectValues -- select part of a hash table by values
- `select(ZZ,HashTable,Function)` -- see selectValues -- select part of a hash table by values
- `selectValues(HashTable,Function)` -- see selectValues -- select part of a hash table by values
- `selectValues(ZZ,HashTable,Function)` -- see selectValues -- select part of a hash table by values

## Methods that use a hash table:

- `# HashTable` -- see # List -- length or cardinality of a list, hash table, dictionary, set, or string
- `HashTable #? Thing` -- see #? -- check existence of value in a list, hash table, database, or string
- all(HashTable,Function) -- whether all key/value pairs in a hash table satisfy a specified condition
- any(HashTable,Function) -- whether all key/value pairs in a hash table satisfy a specified condition
- `hooks(HashTable)` -- see hooks -- list hooks attached to a key
- indices(HashTable) (missing documentation)
- `installAssignmentMethod(Symbol,HashTable,Function)` -- see installing assignment methods -- install methods assignment to the value of an operator
- `installAssignmentMethod(Symbol,HashTable,HashTable,Function)` -- see installing assignment methods -- install methods assignment to the value of an operator
- `installAssignmentMethod(Symbol,HashTable,HashTable,Option)` -- see installing assignment methods -- install methods assignment to the value of an operator
- `installAssignmentMethod(Symbol,HashTable,Option)` -- see installing assignment methods -- install methods assignment to the value of an operator
- `keys(HashTable)` -- see keys -- keys used in a hash table, dictionary, or database
- `HashTable # Thing` -- see List # ZZ -- get value from list, hash table, database, dictionary, or string
- `package(HashTable)` -- see package -- get containing package
- `pairs(HashTable)` -- see pairs -- list the pairs in a hash table, dictionary, or basic list
- `remove(HashTable,Thing)` -- see remove -- remove an entry from a mutable hash table, list, or database
- `scanKeys(HashTable,Function)` -- see scanKeys -- apply a function to each key in a hash table or database
- `scanPairs(HashTable,Function)` -- see scanPairs -- apply a function to the pairs in a hash table
- `scanValues(HashTable,Function)` -- see scanValues -- apply a function to each value in a hash table or database
- `set(HashTable)` -- see set -- make a set
- `values(HashTable)` -- see values -- values in a hash table

## For the programmer

The object HashTable is a type, with ancestor class Thing.

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/Macaulay2Doc/ov_hashtables.m2:117:0.