Skip to content

Commit ddc0f0d

Browse files
committed
Bug fix.
1 parent 9582df2 commit ddc0f0d

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/lapack/stdlib_linalg_lapack_aux.fypp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1620,6 +1620,7 @@ module stdlib_linalg_lapack_aux
16201620
err = linalg_state_type(this, LINALG_ERROR, "rank(C) < p, the least-squares solution cannot be computed.")
16211621
case(0)
16221622
! Success.
1623+
err%state = LINALG_SUCCESS
16231624
case(-1)
16241625
err = linalg_state_type(this, LINALG_VALUE_ERROR, 'Invalid number of rows for A, m=', m)
16251626
case(-2)

src/stdlib_linalg_least_squares.fypp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,14 +404,17 @@ submodule (stdlib_linalg) stdlib_linalg_least_squares
404404
${rt}$ :: a_dummy(1, 1), b_dummy(1)
405405
${rt}$ :: c_dummy(1, 1), d_dummy(1)
406406
${rt}$ :: work(1), x(1)
407+
type(linalg_state_type) :: err0
407408
!> Problem dimensions.
408409
m = size(A, 1) ; n = size(A, 2) ; p = size(C, 1)
409410
lwork = -1_ilp
410411
!> Workspace query.
411412
call gglse(m, n, p, a_dummy, m, c_dummy, p, b_dummy, d_dummy, x, work, lwork, info)
412-
call handle_gglse_info(this, info, m, n, p, err)
413+
call handle_gglse_info(this, info, m, n, p, err0)
413414
!> Optimal workspace size.
414415
lwork = ceiling(real(work(1), kind=${rk}$), kind=ilp)
416+
417+
call linalg_error_handling(err0, err)
415418
end subroutine stdlib_linalg_${ri}$_constrained_lstsq_space
416419

417420
! Constrained least-squares solver.

0 commit comments

Comments
 (0)