Hash-based lookup table for O(1) fragment index retrieval
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | public | :: | initialized | = | .false. | ||
| integer(kind=int64), | public | :: | n_entries | = | 0 | ||
| type(hash_entry_t), | public, | allocatable | :: | table(:) | |||
| integer, | public | :: | table_size | = | 0 |
Clean up hash table and all chains
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fragment_lookup_t), | intent(inout) | :: | this |
Find fragment index for given monomer combination
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fragment_lookup_t), | intent(in) | :: | this | |||
| integer, | intent(in) | :: | monomers(:) | |||
| integer, | intent(in) | :: | n |
Initialize hash table with estimated size
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fragment_lookup_t), | intent(inout) | :: | this | |||
| integer(kind=int64), | intent(in) | :: | estimated_entries |
Insert a monomer combination -> fragment index mapping
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(fragment_lookup_t), | intent(inout) | :: | this | |||
| integer, | intent(in) | :: | monomers(:) | |||
| integer, | intent(in) | :: | n | |||
| integer(kind=int64), | intent(in) | :: | fragment_idx | |||
| type(error_t), | intent(out), | optional | :: | error |
type :: fragment_lookup_t !! Hash-based lookup table for O(1) fragment index retrieval integer :: table_size = 0 type(hash_entry_t), allocatable :: table(:) integer(int64) :: n_entries = 0 logical :: initialized = .false. contains procedure :: init => fragment_lookup_init procedure :: insert => fragment_lookup_insert procedure :: find => fragment_lookup_find procedure :: destroy => fragment_lookup_destroy end type fragment_lookup_t