Skip to content

Commit a8873d9

Browse files
committed
Info handling function for gglse.
1 parent 1e02559 commit a8873d9

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/lapack/stdlib_linalg_lapack_aux.fypp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
16101634
end module stdlib_linalg_lapack_aux

0 commit comments

Comments
 (0)