test_morton3D Subroutine

subroutine test_morton3D(tester_handler, indexes, reference)

Test morton3 encoder/decoder.

Arguments

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

Tester handler.

integer(kind=int32), intent(in) :: indexes(1:3)

Indexes.

integer(kind=int64), intent(in) :: reference

Reference morton code.

Calls

proc~~test_morton3d~~CallsGraph proc~test_morton3d test_morton3D proc~morton3d morton3D proc~test_morton3d->proc~morton3d proc~demorton3d demorton3D proc~test_morton3d->proc~demorton3d proc~dilatate dilatate proc~morton3d->proc~dilatate proc~contract contract proc~demorton3d->proc~contract
Help

Called By

proc~~test_morton3d~~CalledByGraph proc~test_morton3d test_morton3D program~mortif_test_correctness mortif_test_correctness program~mortif_test_correctness->proc~test_morton3d
Help

Source Code


Source Code

  subroutine test_morton3D(tester_handler, indexes, reference)
  !---------------------------------------------------------------------------------------------------------------------------------
  !< Test morton3 encoder/decoder.
  !---------------------------------------------------------------------------------------------------------------------------------
  type(tester_t), intent(inout) :: tester_handler  !< Tester handler.
  integer(int32), intent(in)    :: indexes(1:3)    !< Indexes.
  integer(int64), intent(in)    :: reference       !< Reference morton code.
  integer(int64)                :: morton          !< Morton code.
  integer(int32)                :: de_indexes(1:3) !< Indexes computed by decoding reference.
  !---------------------------------------------------------------------------------------------------------------------------------

  !---------------------------------------------------------------------------------------------------------------------------------
  morton = morton3D(i=indexes(1), j=indexes(2), k=indexes(3))
  call demorton3D(code=reference, i=de_indexes(1), j=de_indexes(2), k=de_indexes(3))
  call tester_handler%assert_equal(int(morton, int32), int(reference, int32))
  ! call tester_handler%assert_equal(.true., all(de_indexes==indexes)) ! TODO reintroduce
  !---------------------------------------------------------------------------------------------------------------------------------
  endsubroutine test_morton3D