Skip to content

Commit a9ce4b2

Browse files
committed
Do not copy matrices
1 parent 3284be8 commit a9ce4b2

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/linalg.f90

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,15 @@ subroutine deigh_generalized(Am, Bm, lam, c)
3636
call assert_shape(c, [n, n], "eigh", "c")
3737
lwork = 1 + 6*n + 2*n**2
3838
liwork = 3 + 5*n
39-
allocate(Bmt(n,n), work(lwork), iwork(liwork))
40-
allocate(Amt(n,n))
39+
allocate(work(lwork), iwork(liwork))
4140
allocate(ifail(n))
42-
Amt = Am; Bmt = Bm ! Bmt temporaries overwritten by dsygvd
4341
!call dsygvd(1,'V','L',n,c,n,Bmt,n,lam,work,lwork,iwork,liwork,info)
4442
il = 1
4543
iu = 7
4644
M = iu-il+1
4745
allocate(z(n,M))
4846
abstol = 1e-4_dp
49-
call dsygvx(1,'V','I','L',n,Amt,n,Bmt,n, &
47+
call dsygvx(1,'V','I','L',n,Am,n,Bm,n, &
5048
0._dp, 0._dp, 1, 7, abstol, M, lam, c, n, work, &
5149
lwork, iwork, ifail, info)
5250
!SUBROUTINE DSYGVD( ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK, &

0 commit comments

Comments
 (0)