petsc-3.10.5 2019-03-28
Report Typos and Errors

PetscHMapT

Hash table map

Synopsis

/*MC
  PetscHMapTCreate - Create a hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTCreate(PetscHMapT *ht)

  Output Parameter:
. ht - The hash table

  


.keywords: hash table, map, create
.seealso: PetscHMapTDestroy()
M*/

/*MC
  PetscHMapTDestroy - Destroy a hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTDestroy(PetscHMapT *ht)

  Input Parameter:
. ht - The hash table

  


.keywords: hash table, map, destroy
.seealso: PetscHMapTCreate()
M*/

/*MC
  PetscHMapTReset - Reset a hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTReset(PetscHMapT ht)

  Input Parameter:
. ht - The hash table

  


.keywords: hash table, map, reset
.seealso: PetscHMapTClear()
M*/

/*MC
  PetscHMapTDuplicate - Duplicate a hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTDuplicate(PetscHMapT ht,PetscHMapT *hd)

  Input Parameter:
. ht - The source hash table

  Output Parameter:
. ht - The duplicated hash table

  


.keywords: hash table, map, duplicate
.seealso: PetscHMapTCreate()
M*/

/*MC
  PetscHMapTClear - Clear a hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTClear(PetscHMapT ht)

  Input Parameter:
. ht - The hash table

  


.keywords: hash table, map, reset
.seealso: PetscHMapTReset()
M*/

/*MC
  PetscHMapTResize - Set the number of buckets in a hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTResize(PetscHMapT ht,PetscInt nb)

  Input Parameters:
+ ht - The hash table
- nb - The number of buckets

  


.seealso: PetscHMapTCreate()
M*/

/*MC
  PetscHMapTGetSize - Get the number of entries in a hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTGetSize(PetscHMapT ht,PetscInt *n)

  Input Parameter:
. ht - The hash table

  Output Parameter:
. n - The number of entries

  


.keywords: hash table, map, resize
.seealso: PetscHMapTResize()
M*/

/*MC
  PetscHMapTHas - Query for a key in the hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTHas(PetscHMapT ht,KeyType key,PetscBool *has)

  Input Parameters:
+ ht  - The hash table
- key - The key

  Output Parameter:
. has - Boolean indicating whether key is in the hash table

  


.keywords: hash table, map, query
.seealso:  PetscHMapTGet(), PetscHMapTSet(), PetscHMapTFind()
M*/

/*MC
  PetscHMapTGet - Get the value for a key in the hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTGet(PetscHMapT ht,KeyType key,ValType *val)

  Input Parameters:
+ ht  - The hash table
- key - The key

  Output Parameter:
. val - The value

  


.keywords: hash table, map, get
.seealso:  PetscHMapTSet(), PetscHMapTIterGet()
M*/

/*MC
  PetscHMapTSet - Set a (key,value) entry in the hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTSet(PetscHMapT ht,KeyType key,ValType val)

  Input Parameters:
+ ht  - The hash table
. key - The key
- val - The value

  


.keywords: hash table, map, set
.seealso: PetscHMapTGet(), PetscHMapTIterSet()
M*/

/*MC
  PetscHMapTDel - Remove a key and its value from the hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTDel(PetscHMapT ht,KeyType key)

  Input Parameters:
+ ht  - The hash table
- key - The key

  


.keywords: hash table, map, del
.seealso: PetscHMapTHas(), PetscHMapTIterDel()
M*/

/*MC
  PetscHMapTQuerySet - Query and set a (key,value) entry in the hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTQuerySet(PetscHMapT ht,KeyType key,ValType val,PetscBool *missing)

  Input Parameters:
+ ht  - The hash table
. key - The key
- val - The value

  Output Parameter:
. missing - Boolean indicating whether the key was missing

  


.keywords: hash table, map, query, set
.seealso: PetscHMapTQueryDel(), PetscHMapTSet()
M*/

/*MC
  PetscHMapTQueryDel - Query and remove a (key,value) entry from the hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTQueryDel(PetscHMapT ht,KeyType key,PetscBool *present)

  Input Parameters:
+ ht  - The hash table
- key - The key

  Output Parameter:
. present - Boolean indicating whether the key was present

  


.keywords: hash table, map, query, del
.seealso: PetscHMapTQuerySet(), PetscHMapTDel()
M*/

/*MC
  PetscHMapTFind - Query for key in the hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTFind(PetscHMapT ht,KeyType key,PetscHashIter *iter,PetscBool *found)

  Input Parameters:
+ ht  - The hash table
- key - The key

  Output Parameter:
+ iter - Iterator referencing the value for key
- found - Boolean indicating whether the key was present

  


.keywords: hash table, map, iterator, find
.seealso: PetscHMapTIterGet(), PetscHMapTIterDel()
M*/

/*MC
  PetscHMapTPut - Set a key in the hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTPut(PetscHMapT ht,KeyType key,PetscHashIter *iter,PetscBool *missing)

  Input Parameters:
+ ht  - The hash table
- key - The key

  Output Parameter:
+ iter - Iterator referencing the value for key
- missing - Boolean indicating whether the key was missing

  


.keywords: hash table, map, iterator, put
.seealso: PetscHMapTIterSet(), PetscHMapTQuerySet(), PetscHMapTSet()
M*/

/*MC
  PetscHMapTIterGet - Get the value referenced by an iterator in the hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTIterGet(PetscHMapT ht,PetscHashIter iter,ValType *val)

  Input Parameters:
+ ht   - The hash table
- iter - The iterator

  Output Parameter:
. val  - The value

  


.keywords: hash table, map, iterator, get
.seealso: PetscHMapTFind(), PetscHMapTGet()
M*/

/*MC
  PetscHMapTIterSet - Set the value referenced by an iterator in the hash

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTIterSet(PetscHMapT ht,PetscHashIter iter,ValType val)

  Input Parameters:
+ ht   - The hash table
. iter - The iterator
- val  - The value

  


.keywords: hash table, map, iterator, set
.seealso: PetscHMapTPut(), PetscHMapTQuerySet(), PetscHMapTSet()
M*/

/*MC
  PetscHMapTIterDel - Remove the (key,value) referenced by an iterator from the hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTIterDel(PetscHMapT ht,PetscHashIter iter)

  Input Parameters:
+ ht   - The hash table
- iter - The iterator

  


.keywords: hash table, map, iterator, del
.seealso: PetscHMapTFind(), PetscHMapTQueryDel(), PetscHMapTDel()
M*/

/*MC
  PetscHMapTGetKeys - Get all keys from a hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTGetKeys(PetscHMapT ht,PetscInt *off,KeyType array[])

  Input Parameters:
+ ht    - The hash table
. off   - Input offset in array (usually zero)
- array - Array where to put hash table keys into

  Output Parameter:
+ off   - Output offset in array (output offset = input offset + hash table size)
- array - Array filled with the hash table keys

  


.keywords: hash table, map, array
.seealso: PetscHSetTGetSize(), PetscHMapTGetVals()
M*/

/*MC
  PetscHMapTGetVals - Get all values from a hash table

  Synopsis:
  #include <petsc/private/hashmap.h>
  PetscErrorCode PetscHMapTGetVals(PetscHMapT ht,PetscInt *off,ValType array[])

  Input Parameters:
+ ht    - The hash table
. off   - Input offset in array (usually zero)
- array - Array where to put hash table values into

  Output Parameter:
+ off   - Output offset in array (output offset = input offset + hash table size)
- array - Array filled with the hash table values

  


.keywords: hash table, map, array
.seealso: PetscHSetTGetSize(), PetscHMapTGetKeys()
M*/

#define PETSC_HASH_MAP(HashT, KeyType, ValType, HashFunc, EqualFunc, DefaultValue)                   \
                                                                                                     \
KHASH_INIT(HashT, KeyType, ValType, 1, HashFunc, EqualFunc)                                          \
                                                                                                     \
typedef khash_t(HashT) *Pet.c.html##HashT;

Synopsis

typedef khash_t(HMapT) *PetscHMapT;

Keywords

hash table, map

See Also

PETSC_HASH_MAP(), PetscHMapTCreate()

Level

developer

Location

include/petsc/private/hashmap.h
Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages