PetscHMapIJSetWithMode#
Set a (key,value) entry in the hash table according to an InsertMode
Synopsis#
#include <petsc/private/hashmapij.h>
PetscErrorCode PetscHMapIJSetWithMode(PetscHMapIJ ht, struct {PetscInt i, j;} key, PetscScalar val, InsertMode mode)
Input Parameters#
ht - The hash table
key - The key
val - The value
mode - The insertion mode
Notes#
mode may be any of the following:
INSERT_VALUES: this routine behaves identically toPetscHMapIJSet().ADD_VALUES: ifkeyis foundvalis added to the current entry, otherwise (key,value) is inserted intohtas-if-byINSERT_VALUES.MAX_VALUES: ifkeyis found the current value is replaced by the maximum ofvaland the current entry, otherwise (key,value) is inserted intohtas-if-byINSERT_VALUES.MIN_VALUES: ifkeyis found the current value is replaced by the minimum ofvaland the current entry, otherwise (key,value) is inserted intohtas-if-byINSERT_VALUES.
All other InsertMode values raise an error.
Since this routine relies on +, <, and > being well-formed for a particular type
it is not available by default for all PETSc hash table instantiations. If a particular
instantiation supports this routine it must define PETSC_HMAPIJ_HAVE_EXTENDED_API to
1.
See Also#
PetscHMapIJSet(), PetscHMapIJGet(), PetscHMapIJGetWithDefault(),
PetscHMapIJIterSet()
Level#
developer
Location#
include/petsc/private/generated_khash.h
Index of all PetscH routines
Table of Contents for all manual pages
Index of all manual pages