File: example_universal_mult_hash_64.f90

package info (click to toggle)
fortran-stdlib 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 34,008 kB
  • sloc: f90: 24,178; ansic: 1,244; cpp: 623; python: 119; makefile: 13
file content (16 lines) | stat: -rw-r--r-- 520 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
program example_universal_mult_hash_64
  use stdlib_hash_64bit, only: odd_random_integer, &
                               universal_mult_hash
  use iso_fortran_env, only: int64
  implicit none
  integer, allocatable :: array1(:)
  integer(int64) :: hash, seed, source
  seed = 0
  allocate (array1(0:2**6 - 1))
  array1 = 0
  call odd_random_integer(seed)
  source = 42_int64
  hash = universal_mult_hash(source, seed, 6)
  array1(hash) = source
  print *, seed, hash, array1
end program example_universal_mult_hash_64