Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | matrix(:,:) |
logical function check_symmetric(matrix)
! function to check if a given matrix is symmetric
! for a square matrix!
real(dp), intent(in) :: matrix(:,:)
real(dp) :: diff(size(matrix,1),size(matrix,2))
diff = matrix - transpose(matrix)
check_symmetric = .false.
if (near_zero(sum(abs(diff)))) check_symmetric = .true.
end function check_symmetric