solve_least_squares_svd Interface

public interface solve_least_squares_svd

Module Procedures

private subroutine solve_least_squares_mtx_svd(a, b, s, arnk, work, olwork, err)

Solves the system of equations using a singular value decomposition of .

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(inout), dimension(:,:) :: a

On input, the M-by-N matrix . On output, the matrix is overwritten.

real(kind=real64), intent(inout), dimension(:,:) :: b

If the system is overdetermined, the M-by-NRHS matrix ; else, the matrix should be sized as N-by-NRHS with the first M rows containing . On output, the first N rows will contain the solution matrix .

real(kind=real64), intent(out), optional, target, dimension(:) :: s

An optional MIN(M, N)-element array that on output contains the singular values of in descending order. Notice, the condition number of can be determined by S(1) / S(MIN(M, N)).

integer(kind=int32), intent(out), optional :: arnk

An optional output, that if provided, will return the rank of .

real(kind=real64), intent(out), optional, target, dimension(:) :: work

An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

integer(kind=int32), intent(out), optional :: olwork

An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

class(errors), intent(inout), optional, target :: err

The error object to be updated.

private subroutine solve_least_squares_mtx_svd_cmplx(a, b, s, arnk, work, olwork, rwork, err)

Solves the system of equations using a singular value decomposition of .

Arguments

Type IntentOptional Attributes Name
complex(kind=real64), intent(inout), dimension(:,:) :: a

On input, the M-by-N matrix . On output, the matrix is overwritten.

complex(kind=real64), intent(inout), dimension(:,:) :: b

If the system is overdetermined, the M-by-NRHS matrix ; else, the matrix should be sized as N-by-NRHS with the first M rows containing . On output, the first N rows will contain the solution matrix .

real(kind=real64), intent(out), optional, target, dimension(:) :: s

An optional MIN(M, N)-element array that on output contains the singular values of in descending order. Notice, the condition number of can be determined by S(1) / S(MIN(M, N)).

integer(kind=int32), intent(out), optional :: arnk

An optional output, that if provided, will return the rank of .

complex(kind=real64), intent(out), optional, target, dimension(:) :: work

An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

integer(kind=int32), intent(out), optional :: olwork

An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

real(kind=real64), intent(out), optional, target, dimension(:) :: rwork

An optional input, that if provided, prevents any local memory allocation for real-valued workspaces. If not provided, the memory required is allocated within. If provided, the length of the array must be at least 5 * MIN(M, N).

class(errors), intent(inout), optional, target :: err

The error object to be updated.

private module subroutine solve_least_squares_vec_svd(a, b, s, arnk, work, olwork, err)

Solves the system of equations using a singular value decomposition of .

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(inout), dimension(:,:) :: a

On input, the M-by-N matrix . On output, the matrix is overwritten.

real(kind=real64), intent(inout), dimension(:) :: b

If the system is overdetermined, the M-element vector ; else, the array should be sized as N-element with the first M elements containing . On output, the first N rows will contain the solution vector .

real(kind=real64), intent(out), optional, target, dimension(:) :: s

An optional MIN(M, N)-element array that on output contains the singular values of in descending order. Notice, the condition number of can be determined by S(1) / S(MIN(M, N)).

integer(kind=int32), intent(out), optional :: arnk

An optional output, that if provided, will return the rank of .

real(kind=real64), intent(out), optional, target, dimension(:) :: work

An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

integer(kind=int32), intent(out), optional :: olwork

An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

class(errors), intent(inout), optional, target :: err

The error object to be updated.

private module subroutine solve_least_squares_vec_svd_cmplx(a, b, s, arnk, work, olwork, rwork, err)

Solves the system of equations using a singular value decomposition of .

Arguments

Type IntentOptional Attributes Name
complex(kind=real64), intent(inout), dimension(:,:) :: a

On input, the M-by-N matrix . On output, the matrix is overwritten.

complex(kind=real64), intent(inout), dimension(:) :: b

If the system is overdetermined, the M-element vector ; else, the array should be sized as N-element with the first M elements containing . On output, the first N rows will contain the solution vector .

real(kind=real64), intent(out), optional, target, dimension(:) :: s

An optional MIN(M, N)-element array that on output contains the singular values of in descending order. Notice, the condition number of can be determined by S(1) / S(MIN(M, N)).

integer(kind=int32), intent(out), optional :: arnk

An optional output, that if provided, will return the rank of .

complex(kind=real64), intent(out), optional, target, dimension(:) :: work

An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork.

integer(kind=int32), intent(out), optional :: olwork

An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations.

real(kind=real64), intent(out), optional, target, dimension(:) :: rwork

An optional input, that if provided, prevents any local memory allocation for real-valued workspaces. If not provided, the memory required is allocated within. If provided, the length of the array must be at least 5 * MIN(M, N).

class(errors), intent(inout), optional, target :: err

The error object to be updated.