is_overlap_to_seg_list Function

public pure function is_overlap_to_seg_list(seg, list, len) result(res)

Checks if a segment overlaps with any segments in a list.

This function determines whether the given segment seg overlaps with any of the segments in the provided list. It returns a logical array indicating the overlap status for each segment in the list.

Arguments

Type IntentOptional Attributes Name
type(segment_t), intent(in) :: seg
type(segment_t), intent(in) :: list(:)
integer(kind=int32), intent(in) :: len

Return Value logical, (len)


Source Code

   pure function is_overlap_to_seg_list(seg, list, len) result(res)
      use, intrinsic :: iso_fortran_env, only: int32
      implicit none
      integer(int32),  intent(in) :: len
      type(segment_t), intent(in) :: seg, list(:)
      logical :: res(len)

      integer :: i

      ! Initialize the result array.
      res(:) = .false.

      do i = 1, len
         res(i) = list(i) .in. seg  ! Check if each segment overlaps.
      end do
   end function is_overlap_to_seg_list