test_16_16_16 Subroutine

subroutine test_16_16_16(tester_handler)

Test morton3 encoder/decoder for the matrix [(0,0,0), (1,0,0), … (15,15,15)], namely 4096 tests.

Arguments

Type IntentOptional AttributesName
type(tester_t), intent(inout) :: tester_handler

Tester handler.

Calls

proc~~test_16_16_16~~CallsGraph proc~test_16_16_16 test_16_16_16 proc~create_morton_file create_morton_file proc~test_16_16_16->proc~create_morton_file proc~morton3d morton3D proc~test_16_16_16->proc~morton3d proc~create_indexes_file create_indexes_file proc~test_16_16_16->proc~create_indexes_file proc~dilatate dilatate proc~morton3d->proc~dilatate
Help

Source Code


Source Code

  subroutine test_16_16_16(tester_handler)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< Test morton3 encoder/decoder for the matrix [(0,0,0), (1,0,0), ... (15,15,15)], namely 4096 tests.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(tester_t), intent(inout) :: tester_handler                 !< Tester handler.
  integer(int64)                :: reference_morton(1:4096)       !< Morton code references.
  integer(int32)                :: reference_indexes(1:3, 1:4096) !< Indexes references.
  integer(int32)                :: unit_scratch                   !< Unit of scratch file.
  integer(int64)                :: morton                         !< Morton encode result.
  integer(int32)                :: indexes(1:3)                   !< Indexes decoding result.
  integer(int32)                :: i                              !< Counter.
  integer(int32)                :: j                              !< Counter.
  integer(int32)                :: t                              !< Counter.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  call create_morton_file(u=unit_scratch)
  read(unit_scratch, *)reference_morton
  close(unit=unit_scratch)

  call create_indexes_file(u=unit_scratch)
  read(unit_scratch, *)((reference_indexes(i, j), i=3,1,-1), j=1,4096)
  close(unit=unit_scratch)

  do t=1, size(reference_morton, dim=1)
    morton = morton3D(i=reference_indexes(1,t), j=reference_indexes(2,t), k=reference_indexes(3,t))
    ! call tester_handler%assert_equal(morton, reference_morton(t)) ! TODO reintroduce
  enddo
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine test_16_16_16