Skip to content

Commit aa40851

Browse files
committed
Simplify
1 parent 44d32e9 commit aa40851

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

src/linalg.f90

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ subroutine deigh_generalized(Am, Bm, lam, c)
2525
! lapack variables
2626
integer :: lwork, liwork, info
2727
integer, allocatable :: iwork(:), ifail(:)
28-
real(dp), allocatable :: Bmt(:,:), work(:), Z(:,:)
28+
real(dp), allocatable :: Bmt(:,:), work(:), Z(:,:), Amt(:,:)
2929
integer :: il, iu, M
3030
real(dp) :: abstol
3131

@@ -37,19 +37,18 @@ subroutine deigh_generalized(Am, Bm, lam, c)
3737
lwork = 1 + 6*n + 2*n**2
3838
liwork = 3 + 5*n
3939
allocate(Bmt(n,n), work(lwork), iwork(liwork))
40+
allocate(Amt(n,n))
4041
allocate(ifail(n))
41-
c = Am; Bmt = Bm ! Bmt temporaries overwritten by dsygvd
42+
Amt = Am; Bmt = Bm ! Bmt temporaries overwritten by dsygvd
4243
!call dsygvd(1,'V','L',n,c,n,Bmt,n,lam,work,lwork,iwork,liwork,info)
4344
il = 1
4445
iu = 7
4546
M = iu-il+1
4647
allocate(z(n,M))
47-
abstol = 1e-8_dp
48-
call dsygvx(1,'V','I','L',n,c,n,Bmt,n, &
49-
0._dp, 0._dp, 1, 7, abstol, M, lam, z, n, work, &
48+
abstol = 1e-4_dp
49+
call dsygvx(1,'V','I','L',n,Amt,n,Bmt,n, &
50+
0._dp, 0._dp, 1, 7, abstol, M, lam, c, n, work, &
5051
lwork, iwork, ifail, info)
51-
c = 0
52-
c(:,:M) = z
5352
!SUBROUTINE DSYGVD( ITYPE, JOBZ, UPLO, N, A, LDA, B, LDB, W, WORK, &
5453
! LWORK, IWORK, LIWORK, INFO )
5554
!SUBROUTINE DSYGVX( ITYPE, JOBZ, RANGE, UPLO, N, A, LDA, B, LDB, &

0 commit comments

Comments
 (0)