Lookup a value in a shared-read-only hashtable. Returns the position of a given ilut in the target space used for setting up this hash table no need to decode again the given ilut
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(shared_rhash_t), | intent(in) | :: | core_ht |
hashtable used for the lookup |
||
| integer(kind=n_int), | intent(in) | :: | ilut(0:NIfTot) | |||
| integer, | intent(in) | :: | nI(:) | |||
| integer(kind=int64), | intent(in) | :: | tgt_space(0:,1:) | |||
| integer, | intent(out) | :: | i |
on return, position of ilut in tgt_space if found, 0 else |
||
| logical, | intent(out) | :: | core_state |
on return, true if ilut is found, false else |
subroutine shared_rht_lookup(core_ht, ilut, nI, tgt_space, i, core_state) use hash, only: FindWalkerHash use bit_rep_data, only: NIfTot, nifd type(shared_rhash_t), intent(in) :: core_ht integer(n_int), intent(in) :: ilut(0:NIfTot) integer, intent(in) :: nI(:) integer(int64), intent(in) :: tgt_space(0:, 1:) integer, intent(out) :: i logical, intent(out) :: core_state integer(int64) :: hash_val, i_tmp hash_val = FindWalkerHash(nI, int(core_ht%val_range())) call core_ht%callback_lookup(hash_val, i_tmp, core_state, loc_verify) ! cast down to int32 i = int(i_tmp) contains function loc_verify(ind) result(match) integer(int64), intent(in) :: ind logical :: match match = all(ilut(0:nifd) == tgt_space(0:nifd, ind)) end function loc_verify end subroutine shared_rht_lookup