MAPL_HashMod is a FORTRAN binding to a simple C has facility.
The API is:
! Create a hash table with Nbucketsinteger function MAPL_HashCreate(Nbuckets)integer,intent(IN)::Nbuckets! Update table Hash with integer[s] i[,j]! The return value is the order of occurence of the integer[s].! If i is new, the return value is the new hash size.integer function MAPL_HashIncrement(Hash,i,j)integer,intent(IN)::Hashinteger,intent(IN)::iinteger,optional,intent(IN)::j! Dump the list of integers or integer pairs in the hash.! The list is in no particular order.! If the arrays are not long enough, nothing is dumped and -1! is returned; otherwise it returns the current hash size ! (the length of the list).integer function MAPL_HashDump(Hash,i,j)integer,intent(IN)::Hashinteger,intent(OUT)::i(:)integer,optional,intent(OUT)::j(:)! Get the size of a hashinteger function MAPL_HashSize(Hash)integer,intent(IN)::Hash! Destroy a hash tablesubroutine MAPL_HashDestroy(Hash)integer,intent(IN)::Hash
The following is a sample usage that makes a list of
unique integers in the large array II. It can similarly
be used to find ordered pairs of integers. The asserts
are put in to clarify the usage.
Nodes of different colours represent the following:
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.
Nodes of different colours represent the following:
Solid arrows point from a submodule to the (sub)module which it is
descended from. Dashed arrows point from a module or program unit to
modules which it uses.
Where possible, edges connecting nodes are
given different colours to make them easier to distinguish in
large graphs.