@brief Fill the upper/lower triangle of the symmetric matrix
@param[inout] a square NxN matrix in triangular form
@param[in] n matrix dimension
@param[in] uplo U if A
is upper triangular, L if lower triangular
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(inout) | :: | a(n,*) | |||
integer, | intent(in) | :: | n | |||
character(len=1), | intent(in) | :: | uplo |
subroutine triangular_to_full(a,n,uplo) use precision, only: dp use messages, only: show_message, with_abort implicit none real(kind=dp), intent(inout) :: a(n,*) integer, intent(in) :: n character(len=1), intent(in) :: uplo integer :: i if (uplo=='u' .or. uplo=='U') then do i = 1, n a(i+1:n,i) = a(i,i+1:n) end do else if (uplo=='l' .or. uplo=='L') then do i = 1, n a(i,i+1:n) = a(i+1:n,i) end do else call show_message('Invalid parameter UPLO='//uplo// & ' in `triangular_to_full`. Use either `L` or `U`.', with_abort) end if end subroutine triangular_to_full