svd_rel Subroutine

private pure subroutine svd_rel(A, U, S, VT, method)

Calculates the singular value decomposition (SVD) of a matrix A.

Arguments

Type IntentOptional Attributes Name
real(kind=rk), intent(in), dimension(:, :), contiguous :: A
real(kind=rk), intent(out), dimension(:,:) :: U
real(kind=rk), intent(out), dimension(:) :: S
real(kind=rk), intent(out), dimension(:,:) :: VT
character(len=*), intent(in), optional :: method

Calls

proc~~svd_rel~~CallsGraph proc~svd_rel forsvd::svd_rel proc~gesdd_rel forsvd::gesdd_rel proc~svd_rel->proc~gesdd_rel proc~gesvd_rel forsvd::gesvd_rel proc~svd_rel->proc~gesvd_rel

Called by

proc~~svd_rel~~CalledByGraph proc~svd_rel forsvd::svd_rel interface~svd forsvd::svd interface~svd->proc~svd_rel proc~lowrank forsvd::tsvd%lowrank proc~lowrank->interface~svd program~benchmark benchmark program~benchmark->interface~svd program~test1 test1 program~test1->interface~svd program~test2 test2 program~test2->interface~svd program~test3 test3 program~test3->interface~svd proc~compress_pixels forsvd::pixel%compress_pixels proc~compress_pixels->proc~lowrank program~test4 test4 program~test4->proc~lowrank program~test5 test5 program~test5->proc~compress_pixels

Source Code

   pure subroutine svd_rel(A, U,S,VT, method)

      ! Inputs:
      real(rk), dimension(:, :), contiguous, intent(in)  :: A    ! Input matrix A

      ! Outputs:
      real(rk), dimension(:,:), intent(out) :: U    ! Left singular vectors
      real(rk), dimension(:,:), intent(out) :: VT   ! Right singular vectors
      real(rk), dimension(:),   intent(out) :: S    ! Singular values

      character(*), intent(in), optional :: method

      if (.not. present(method)) then
         call gesvd_rel(A, U,S,VT)
      else

         select case (method)
            case ('gesvd')
            call gesvd_rel(A, U,S,VT)
            case( 'gesdd')
            call gesdd_rel(A, U,S,VT)
         end select

      end if

   end subroutine svd_rel