Skip to content

Commit 8ed1fe4

Browse files
committed
Fix: return full Q from *ORGQR
1 parent 364b9ca commit 8ed1fe4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/stdlib_linalg_qr.fypp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,10 @@ submodule (stdlib_linalg) stdlib_linalg_qr
121121
endif
122122
lwork_qr = ceiling(real(work_dummy(1),kind=${rk}$),kind=ilp)
123123

124-
! Ordering space
124+
! Ordering space (for full factorization)
125125
lwork_ord = -1_ilp
126126
call #{if rt.startswith('complex')}# ungqr #{else}# orgqr #{endif}# &
127-
(m,n,k,a,m,tau_dummy,work_dummy,lwork_ord,info)
127+
(m,m,k,a,m,tau_dummy,work_dummy,lwork_ord,info)
128128
call handle_orgqr_info(info,m,n,k,lwork_ord,err0)
129129
if (err0%error()) then
130130
call linalg_error_handling(err0,err)
@@ -241,7 +241,7 @@ submodule (stdlib_linalg) stdlib_linalg_qr
241241

242242
! Convert K elementary reflectors tau(1:k) -> orthogonal matrix Q
243243
call #{if rt.startswith('complex')}# ungqr #{else}# orgqr #{endif}# &
244-
(m,n,k,amat,lda,tau,work,lwork,info)
244+
(q1,q2,k,amat,lda,tau,work,lwork,info)
245245
call handle_orgqr_info(info,m,n,k,lwork,err0)
246246

247247
! Copy result back to Q

0 commit comments

Comments
 (0)