Initialize the hash table.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(hash_table), | intent(inout) | :: | self | The hash table. |
||
integer(kind=I4P), | intent(in), | optional | :: | buckets_number | Number of buckets for initialize the hash table. |
|
logical, | intent(in), | optional | :: | use_prime | If true the buckets number is rendered prime. |
|
logical, | intent(in), | optional | :: | homogeneous | If true the hash is supposed to accept only homogeneous nodes. |
|
class(*), | intent(in), | optional | :: | typeguard_key | Key type guard (mold) for homogeneous keys check. |
|
class(*), | intent(in), | optional | :: | typeguard_content | content type guard (mold) for homogeneous contents check. |
subroutine initialize(self, buckets_number, use_prime, homogeneous, typeguard_key, typeguard_content)
!---------------------------------------------------------------------------------------------------------------------------------
!< Initialize the hash table.
!---------------------------------------------------------------------------------------------------------------------------------
class(hash_table), intent(inout) :: self !< The hash table.
integer(I4P), intent(in), optional :: buckets_number !< Number of buckets for initialize the hash table.
logical, intent(in), optional :: use_prime !< If true the buckets number is rendered prime.
logical, intent(in), optional :: homogeneous !< If true the hash is supposed to accept only homogeneous nodes.
class(*), intent(in), optional :: typeguard_key !< Key type guard (mold) for homogeneous keys check.
class(*), intent(in), optional :: typeguard_content !< content type guard (mold) for homogeneous contents check.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
call self%destroy
call self%set_buckets_number(buckets_number=buckets_number, use_prime=use_prime)
call self%allocate_members(typeguard_key=typeguard_key, typeguard_content=typeguard_content)
call self%set_caf_dimensions
call self%set_homogeneous(homogeneous=homogeneous)
self%is_initialized_ = .true.
call self%synchronize_images
!---------------------------------------------------------------------------------------------------------------------------------
endsubroutine initialize