Generate the dependency matrix for the DAG.
This is an matrix with elements , such that is true if vertex depends on vertex .
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(dag), | intent(in) | :: | me | |||
logical, | intent(out), | dimension(:,:), allocatable | :: | mat |
dependency matrix |
subroutine dag_generate_dependency_matrix(me,mat) class(dag),intent(in) :: me logical,dimension(:,:),intent(out),allocatable :: mat !! dependency matrix integer(ip) :: i !! vertex counter integer(ip) :: j !! edge counter if (me%n > 0) then allocate(mat(me%n,me%n)) mat = .false. do i=1,me%n if (allocated(me%vertices(i)%edges)) then do j = 1, size(me%vertices(i)%edges) mat(i,me%vertices(i)%edges(j)%ivertex) = .true. end do end if end do end if end subroutine dag_generate_dependency_matrix