is_prime_semgment Function

public pure function is_prime_semgment(seg, disjoined_list) result(res)

Checks if a segment is a prime segment within a disjoined list.

This function determines whether the given segment seg is a prime segment, meaning it does not overlap with any segment in the disjoined_list.

Arguments

Type IntentOptional Attributes Name
type(segment_t), intent(in) :: seg
type(segment_t), intent(in) :: disjoined_list(:)

Return Value logical


Source Code

   pure function is_prime_semgment(seg, disjoined_list) result(res)
      implicit none
      type(segment_t), intent(in) :: seg, disjoined_list(:)

      logical :: res
      integer :: j

      ! Initialize the result.
      res = .false.

      ! リストのうちのいずれかと一致すれば、交差していない。
      ! Check if any segment in `disjoined_list` contains `seg`.
      do j = 1, size(disjoined_list)
         res = res .or. ( disjoined_list(j)%min <= seg%min .and. seg%max <= disjoined_list(j)%max)
      end do
   end function is_prime_semgment