!-----------------------------------------------------------------
!
! Purpose
! =======
!
! LA_GELS solves overdetermined or underdetermined real linear systems
! involving an m-by-n matrix A, or its transpose, using a QR or LQ
! factorization of A.
It is assumed that A has full rank.
! The following options are provided:
! 1. If TRANS = 'N' and m >= n:
find the least squares solution of
!
an overdetermined system, i.e., solve the least squares problem
!
minimize || B - A*X ||.
! 2. If TRANS = 'N' and m < n:
find the minimum norm solution of
!
an underdetermined system A * X = B.
! 3. If TRANS = 'T' and m >= n:
find the minimum norm solution of
!
an undetermined system A**T * X = B.
! 4. If TRANS = 'T' and m < n:
find the least squares solution of
!
an overdetermined system, i.e., solve the least squares problem
!
minimize || B - A**T * X ||.
! Several right hand side vectors b and solution vectors x can be
! handled in a single call; they are stored as the columns of the
! m-by-nrhs right hand side matrix B and the n-by-nrhs solution
! matrix X.
!
! Arguments
! =========
!
!
SUBROUTINE LA_GELS( A, B, TRANS, INFO )
!
<type>(<wp>), INTENT( INOUT ) :: A( :, : ), <rhs>
!
CHARACTER(LEN=1), INTENT(IN), OPTIONAL :: TRANS
!

#### You've reached the end of your free preview.

Want to read both pages?

- Summer '20