solve_least_squares_full Interface

public interface solve_least_squares_full

Module Procedures

private subroutine solve_least_squares_mtx_pvt(a, b, ipvt, arnk, work, olwork, err)

Solves the system of equations using a full orthogonal factorization 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 by its orthogonal factorization.

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 .

integer(kind=int32), intent(inout), optional, target, dimension(:) :: ipvt

An optional input that on input, an N-element array that if IPVT(I) .ne. 0, the I-th column of A is permuted to the front of A * P; if IPVT(I) = 0, the I-th column of A is a free column. On output, if IPVT(I) = K, then the I-th column of A * P was the K-th column of A. If not supplied, memory is allocated internally, and IPVT is set to all zeros such that all columns are treated as free.

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_pvt_cmplx(a, b, ipvt, arnk, work, olwork, rwork, err)

Solves the system of equations using a full orthogonal factorization 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 by its orthogonal factorization.

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 .

integer(kind=int32), intent(inout), optional, target, dimension(:) :: ipvt

An optional input that on input, an N-element array that if IPVT(I) .ne. 0, the I-th column of A is permuted to the front of A * P; if IPVT(I) = 0, the I-th column of A is a free column. On output, if IPVT(I) = K, then the I-th column of A * P was the K-th column of A. If not supplied, memory is allocated internally, and IPVT is set to all zeros such that all columns are treated as free.

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 2 * N.

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

The error object to be updated.

private subroutine solve_least_squares_vec_pvt(a, b, ipvt, arnk, work, olwork, err)

Solves the system of equations using a full orthogonal factorization 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 by its orthogonal factorization.

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 .

integer(kind=int32), intent(inout), optional, target, dimension(:) :: ipvt

An optional input that on input, an N-element array that if IPVT(I) .ne. 0, the I-th column of A is permuted to the front of A * P; if IPVT(I) = 0, the I-th column of A is a free column. On output, if IPVT(I) = K, then the I-th column of A * P was the K-th column of A. If not supplied, memory is allocated internally, and IPVT is set to all zeros such that all columns are treated as free.

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_vec_pvt_cmplx(a, b, ipvt, arnk, work, olwork, rwork, err)

Solves the system of equations using a full orthogonal factorization 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 by its orthogonal factorization.

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 .

integer(kind=int32), intent(inout), optional, target, dimension(:) :: ipvt

An optional input that on input, an N-element array that if IPVT(I) .ne. 0, the I-th column of A is permuted to the front of A * P; if IPVT(I) = 0, the I-th column of A is a free column. On output, if IPVT(I) = K, then the I-th column of A * P was the K-th column of A. If not supplied, memory is allocated internally, and IPVT is set to all zeros such that all columns are treated as free.

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 2 * N.

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

The error object to be updated.