atlas Library · Script File
hash.at
Hash tables for any type |T| that can provide hahshing and equality testing. The functions that implement this are combined into a |HashInfo<T>| structure, from which the generic function |make_hash| can make am empty |Hash<T>| value. Filling the table and other functionality is provided by the |Hash<T>| component functions. These are, in order of frequencey of use: . |match| to possibly add an entry, retuning its sequence number in all cases - |could_add| is similar but reports whether the element was new - |index| gets an element from its sequence number - |search| tests for membership and looks up, without modifying the table - |list| produces all values currently in the hash table, by order of arrival - |iterator| provides an |Iterator<T>| to range over entries dynamically (it will also find entries added after the |iterator| call, unlike |list|) - |fill| can add multiple elements to the table - |clear| empties the table so that it can be re-used - |size| tells the number of entries currrently stored - |capacity| gives the current size of the storage used
Definitions in source order
HashInfo type
set_type HashInfo<T> = ((T,int->int) hash_code, (T,T->bool) eq)!
Fields: hash_code, eq
Sometimes it is useful to store non-key infomation in a hash table, which does not participate in hashing and testing for equality (and which will therefore be dropped when trying to add an entry for which the key information is already known in the table), but which can be retrieved using |index|, |list| and |iterator|. This can be implemented simply by creating a |HashInfo<T>| for a (tuple) type that contains a hashable subtype |S|. The function |lift| prouced this from a |HashInfo<S>| and a (projection) map |T->S|L25
lift
also defined in tits.at, center.at, nilpotent_orbits.at, disconnected.at
triv_hash_info
triv_hash_info = HashInfo<int>One can even do this with a subtype |S=int|, which needs no active hashing
make |int| into a "hashable" type
Hash type
set_type Hash<T> =
( ( -> int) size
, ( -> int) capacity
, ( -> ) clear
, ( -> [T]) list
, (int->T ) index
, (T ->bool,int) acquire { sequence number, and whether it was new }
, (T ->Maybe<int> ) search
)!Fields: size, capacity, clear, list, index, acquire, search
The specification of the |Hash| interface, a type constructor.
with additional functions (Hash<T>->([T] -> )) fill (Hash<T>->(T ->bool)) could_add (Hash<T>->(T ->int)) match (Hash<T>->(T ->int)) lookup (Hash<T>->( ->Iterator<T>) iteratorL53
And here is the implementation, in the form of the |make_hash| constructorL61
make_hash
fill
also defined in K_Nilpotent.at
could_add
match
iterator
lookup
also defined in basic.at, hodge_K_type_formula.at, structure_constants.at
exhaust
efficient orbit generation; client seeds |hash| with initial element(s) first
of abstraction of type |T|L133
eval_at_mod
eval_at_mod(int n, int m) = (vec->int)fast polynomial evaluation modulo power of 2, similar to polynomial |eval|
hash_code 3 overloads
hash_code (vec v, int mod) = intmeant to hash a [vec] to int in [0,d_mod)
hash_code (mat M, int mod) = intmeant to hash a [mat] to int in [0,mod)
hash_code (ratvec v, int mod) = intmeant to hash a [rat_vec] to int in [0,mod)
also in this file at line 157, line 161, line 168, line 178, line 183, line 188, line 209; also defined in W_classes.at
make_vec_hash
make_vec_hash () = Hash<vec>make_mat_hash
make_mat_hash () = Hash<mat>make_ratvec_hash
make_ratvec_hash () = Hash<ratvec>hash_code 2 overloads
hash_code (KType p, int mod) = intmeant to hash KTypes for single group G
hash_code (Param p, int mod) = intmeant to hash Params for single group G
also in this file at line 142, line 145, line 148, line 168, line 178, line 183, line 188, line 209; also defined in W_classes.at
to_vecs
to_vecs (KTypePol P) = [vec]meant to hash a [KTypePol]
hash_code
hash_code (KTypePol P, int mod) = intalso in this file at line 142, line 145, line 148, line 157, line 161, line 178, line 183, line 188, line 209; also defined in W_classes.at
make_KType_hash
make_KType_hash () = Hash<KType>make_Param_hash
make_Param_hash () = Hash<Param>make_KTypePol_hash
make_KTypePol_hash () = Hash<KTypePol>hash_code 3 overloads
hash_code (RootDatum rd, int mod) = inthash_code (InnerClass ic, int mod) = inthash_code (RealForm G, int mod) = intalso in this file at line 142, line 145, line 148, line 157, line 161, line 168, line 209; also defined in W_classes.at
make_RootDatum_hash
make_RootDatum_hash () = Hash<RootDatum>make_InnerClass_hash
make_InnerClass_hash () = Hash<InnerClass>make_RealForm_hash
make_RealForm_hash () = Hash<RealForm>also in this file at line 226
KGBratvec type
set_type KGBratvec = (KGBElt x, ratvec lambda)
Fields: x, lambda
=
= (KGBratvec A, KGBratvec B) = boolalso defined in basic.at, combinatorics.at, modules.at, parabolics.at, synthetic.at, tits.at, K_highest_weights.at, nilpotent_orbits.at, cyclotomic.at, polynomial.at, W_reps_type_BC.at, hodgeParamLaurentPol.at, hodgeParamPol.at, laurentPolynomial.at, extended.at, disconnected.at, cyclotomic_Lie_algebra.at, cyclotomicMat.at, bracket.at
!=
!= (KGBratvec A, KGBratvec B) = boolalso defined in basic.at, combinatorics.at, synthetic.at, tits.at, cyclotomic.at, polynomial.at, cyclotomicMat.at
hash_code
hash_code(KGBratvec p, int mod) = intalso in this file at line 142, line 145, line 148, line 157, line 161, line 168, line 178, line 183, line 188; also defined in W_classes.at
make_xlambda_hash
make_xlambda_hash () = Hash<KGBratvec>vec_hash type
set_type vec_hash = Hash<vec>
ratvec_hash type
set_type ratvec_hash = Hash<ratvec>
mat_hash type
set_type mat_hash = Hash<mat>
RootDatum_hash type
set_type RootDatum_hash = Hash<RootDatum>
InnerClass_hash type
set_type InnerClass_hash = Hash<InnerClass>
RealForm_hash type
set_type RealForm_hash = Hash<RealForm>
xlambda_hash type
set_type xlambda_hash = Hash<KGBratvec>
KType_hash type
set_type KType_hash = Hash<KType>
KTypePol_hash type
set_type KTypePol_hash = Hash<KTypePol>
Param_hash type
set_type Param_hash = Hash<Param>
make_RealForm_hash
make_RealForm_hash ([RealForm] list, (RealForm,int->int).) = RealForm_hashalso in this file at line 196
Generated from atlas-scripts at commit 648506c (2026-10-13).