@@ -51,6 +51,7 @@ module stdlib_linalg_lapack_aux
5151 public :: handle_geev_info
5252 public :: handle_ggev_info
5353 public :: handle_heev_info
54+ public :: handle_gglse_info
5455
5556 ! SELCTG is a LOGICAL FUNCTION of three DOUBLE PRECISION arguments
5657 ! used to select eigenvalues to sort to the top left of the Schur form.
@@ -1607,4 +1608,27 @@ module stdlib_linalg_lapack_aux
16071608
16081609 end subroutine handle_heev_info
16091610
1611+ elemental subroutine handle_gglse_info(this, info, m, n, p, err)
1612+ character(len=*), intent(in) :: this
1613+ integer(ilp), intent(in) :: info, m, n, p
1614+ type(linalg_state_type), intent(out) :: err
1615+ ! Process output.
1616+ select case (info)
1617+ case(2)
1618+ err = linalg_state_type(this, LINALG_ERROR, "rank([A, B]) < n, the least-squares solution cannot be computed.")
1619+ case(1)
1620+ err = linalg_state_type(this, LINALG_ERROR, "rank(C) < p, the least-squares solution cannot be computed.")
1621+ case(0)
1622+ ! Success.
1623+ case(-1)
1624+ err = linalg_state_type(this, LINALG_VALUE_ERROR, 'Invalid number of rows for A, m=', m)
1625+ case(-2)
1626+ err = linalg_state_type(this, LINALG_VALUE_ERROR, 'Invalid number of columns for A and C, n=', n)
1627+ case(-3)
1628+ err = linalg_state_type(this, LINALG_VALUE_ERROR, 'Invalid number of rows for C, p=', p)
1629+ case default
1630+ err = linalg_state_type(this, LINALG_INTERNAL_ERROR, 'catastrophic error.')
1631+ end select
1632+ end subroutine handle_gglse_info
1633+
16101634end module stdlib_linalg_lapack_aux
0 commit comments