Skip to main content

TriuIndx

Returns the indices of upper triangle part of a matrix.

Interface 1

 INTERFACE
MODULE PURE FUNCTION TriuIndx(m, n, diagNo) RESULT(ans)
INTEGER(I4B), INTENT(IN) :: m
!! number of rows
INTEGER(I4B), OPTIONAL, INTENT(IN) :: n
!! number of columns, default = m
INTEGER(I4B), OPTIONAL, INTENT(IN) :: diagNo
!! diagonal number, default = 0
!! diagNo>0 means super diagonal
!! diagNo<0 means subdiagonal
INTEGER(I4B), ALLOCATABLE :: ans(:, :)
!! ans(:,1) contains the row indices
!! ans(:,2) contains the col indices
END FUNCTION TriuIndx
END INTERFACE

Interface 2

INTERFACE
MODULE PURE FUNCTION TriuIndx(A, diagNo) RESULT(ans)
CLASS(*), INTENT(IN) :: A(:, :)
INTEGER(I4B), OPTIONAL, INTENT(IN) :: diagNo
!! diagonal number, default = 0
!! diagNo>0 means super diagonal
!! diagNo<0 means subdiagonal
INTEGER(I4B), ALLOCATABLE :: ans(:, :)
!! ans(:,1) contains the row indices
!! ans(:,2) contains the col indices
END FUNCTION TriuIndx
END INTERFACE