| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=ip), | intent(in) | :: | m | |||
| integer(kind=ip), | intent(in) | :: | n | |||
| integer(kind=ip), | intent(in) | :: | lena | |||
| integer(kind=ip), | intent(in) | :: | indc(lena) | |||
| integer(kind=ip), | intent(in) | :: | lenc(n) | |||
| integer(kind=ip), | intent(in) | :: | locc(n) | |||
| integer(kind=ip), | intent(out) | :: | iw(m) | |||
| integer(kind=ip), | intent(out) | :: | lerr | |||
| integer(kind=ip), | intent(out) | :: | inform |
subroutine lu1or3( m, n, lena, indc, lenc, locc, iw, lerr, inform ) integer(ip), intent(in) :: m, n, lena integer(ip), intent(in) :: indc(lena), lenc(n), locc(n) integer(ip), intent(out) :: lerr, inform integer(ip), intent(out) :: iw(m) !------------------------------------------------------------------ ! lu1or3 looks for duplicate elements in an m by n matrix A ! defined by the column list indc, lenc, locc. ! iw is used as a work vector of length m. ! ! xx Feb 1985: Original version. ! 17 Oct 2000: indc, indr now have size lena to allow nelem = 0. ! ! 10 Jan 2010: First f90 version. ! 12 Dec 2011: Declare intent and local variables. !------------------------------------------------------------------ integer(ip) :: i, j, l, l1, l2 iw(1:m) = 0 lerr = 0 do j = 1, n if (lenc(j) > 0) then l1 = locc(j) l2 = l1 + lenc(j) - 1 do l = l1, l2 i = indc(l) if (iw(i) == j) go to 910 iw(i) = j end do end if end do inform = 0 return 910 lerr = l inform = 1 return end subroutine lu1or3