s_spline_matrix_dense__factorize Subroutine

private subroutine s_spline_matrix_dense__factorize(self)

Type Bound

sll_t_spline_matrix_dense

Arguments

Type IntentOptional Attributes Name
class(sll_t_spline_matrix_dense), intent(inout) :: self

Calls

proc~~s_spline_matrix_dense__factorize~~CallsGraph proc~s_spline_matrix_dense__factorize sll_t_spline_matrix_dense%s_spline_matrix_dense__factorize dgetrf dgetrf proc~s_spline_matrix_dense__factorize->dgetrf sll_assert sll_assert proc~s_spline_matrix_dense__factorize->sll_assert sll_error sll_error proc~s_spline_matrix_dense__factorize->sll_error

Source Code

  subroutine s_spline_matrix_dense__factorize( self )
    class(sll_t_spline_matrix_dense), intent(inout) :: self

    integer :: info

    character(len=*), parameter :: &
         this_sub_name = "sll_t_spline_matrix_dense % factorize"
    character(len=256) :: err_msg

    SLL_ASSERT( size(self%a,1) == self%n )
    SLL_ASSERT( size(self%a,2) == self%n )
    SLL_ASSERT( .not.self%factorized )

    ! Perform LU decomposition using Lapack (A=PLU)
    call dgetrf( self%n, self%n, self%a, self%n, self%ipiv, info )

    if ( info < 0 ) then
      write( err_msg, '(i0,a)' ) abs(info), "-th argument had an illegal value"
      SLL_ERROR(this_sub_name,err_msg)
    else if ( info > 0 ) then
      write( err_msg, "('U(',i0,',',i0,')',a)" ) info, info, &
           " is exactly zero. The factorization has been completed, but the factor" &
           //" U is exactly singular, and division by zero will occur if it is used to" &
           //" solve a system of equations."
      SLL_ERROR(this_sub_name,err_msg)
    end if
    self%factorized=.TRUE.

  end subroutine s_spline_matrix_dense__factorize