Skip to content

Commit

Permalink
Minor fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
loiseaujc committed Jan 31, 2025
1 parent 684777d commit f1b114f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions src/IterativeSolvers/EIGHS/eighs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ end function eigenvalue_residual_cdp
tol = optval(tolerance, rtol_sp)

! Allocate working variables.
allocate(Xwrk(kdim_+1), source=X(1)) ; call zero_basis(Xwrk)
allocate(Xwrk(kdim_+1), mold=X(1)) ; call zero_basis(Xwrk)
if (present(x0)) then
call copy(Xwrk(1), x0)
x0_norm = x0%norm(); call Xwrk(1)%scal(one_rsp/x0_norm)
Expand Down Expand Up @@ -123,8 +123,8 @@ end function eigenvalue_residual_cdp
block
integer :: indices(kdim_)
call sort_index(eigvals_wrk, indices, reverse=.true.)
!eigvals_wrk = eigvals_wrk(indices) ;
eigvecs_wrk = eigvecs_wrk(:, indices)
residuals_wrk = residuals_wrk(indices)
! Store converged eigenvalues.
eigvals = eigvals_wrk(:nev) ; residuals = residuals_wrk(:nev)
end block
Expand Down Expand Up @@ -172,7 +172,7 @@ end function eigenvalue_residual_cdp
tol = optval(tolerance, rtol_dp)

! Allocate working variables.
allocate(Xwrk(kdim_+1), source=X(1)) ; call zero_basis(Xwrk)
allocate(Xwrk(kdim_+1), mold=X(1)) ; call zero_basis(Xwrk)
if (present(x0)) then
call copy(Xwrk(1), x0)
x0_norm = x0%norm(); call Xwrk(1)%scal(one_rdp/x0_norm)
Expand Down Expand Up @@ -213,8 +213,8 @@ end function eigenvalue_residual_cdp
block
integer :: indices(kdim_)
call sort_index(eigvals_wrk, indices, reverse=.true.)
!eigvals_wrk = eigvals_wrk(indices) ;
eigvecs_wrk = eigvecs_wrk(:, indices)
residuals_wrk = residuals_wrk(indices)
! Store converged eigenvalues.
eigvals = eigvals_wrk(:nev) ; residuals = residuals_wrk(:nev)
end block
Expand Down Expand Up @@ -262,7 +262,7 @@ end function eigenvalue_residual_cdp
tol = optval(tolerance, rtol_sp)

! Allocate working variables.
allocate(Xwrk(kdim_+1), source=X(1)) ; call zero_basis(Xwrk)
allocate(Xwrk(kdim_+1), mold=X(1)) ; call zero_basis(Xwrk)
if (present(x0)) then
call copy(Xwrk(1), x0)
x0_norm = x0%norm(); call Xwrk(1)%scal(one_csp/x0_norm)
Expand Down Expand Up @@ -303,8 +303,8 @@ end function eigenvalue_residual_cdp
block
integer :: indices(kdim_)
call sort_index(eigvals_wrk, indices, reverse=.true.)
!eigvals_wrk = eigvals_wrk(indices) ;
eigvecs_wrk = eigvecs_wrk(:, indices)
residuals_wrk = residuals_wrk(indices)
! Store converged eigenvalues.
eigvals = eigvals_wrk(:nev) ; residuals = residuals_wrk(:nev)
end block
Expand Down Expand Up @@ -352,7 +352,7 @@ end function eigenvalue_residual_cdp
tol = optval(tolerance, rtol_dp)

! Allocate working variables.
allocate(Xwrk(kdim_+1), source=X(1)) ; call zero_basis(Xwrk)
allocate(Xwrk(kdim_+1), mold=X(1)) ; call zero_basis(Xwrk)
if (present(x0)) then
call copy(Xwrk(1), x0)
x0_norm = x0%norm(); call Xwrk(1)%scal(one_cdp/x0_norm)
Expand Down Expand Up @@ -393,8 +393,8 @@ end function eigenvalue_residual_cdp
block
integer :: indices(kdim_)
call sort_index(eigvals_wrk, indices, reverse=.true.)
!eigvals_wrk = eigvals_wrk(indices) ;
eigvecs_wrk = eigvecs_wrk(:, indices)
residuals_wrk = residuals_wrk(indices)
! Store converged eigenvalues.
eigvals = eigvals_wrk(:nev) ; residuals = residuals_wrk(:nev)
end block
Expand Down
4 changes: 2 additions & 2 deletions src/IterativeSolvers/EIGHS/eighs.fypp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ contains
call check_info(info, 'lanczos', module=this_module, procedure='eighs_${type[0]}$${kind}$')

! Spectral decomposition of the k x k tridiagonal matrix.
! eigvals_wrk = 0.0_${kind}$ ; eigvecs_wrk = zero_${type[0]}$${kind}$
eigvals_wrk = 0.0_${kind}$ ; eigvecs_wrk = zero_${type[0]}$${kind}$
call eigh(T(:k, :k), eigvals_wrk(:k), vectors=eigvecs_wrk(:k, :k))

! Compute residuals.
Expand All @@ -95,8 +95,8 @@ contains
block
integer :: indices(kdim_)
call sort_index(eigvals_wrk, indices, reverse=.true.)
!eigvals_wrk = eigvals_wrk(indices) ;
eigvecs_wrk = eigvecs_wrk(:, indices)
residuals_wrk = residuals_wrk(indices)
! Store converged eigenvalues.
eigvals = eigvals_wrk(:nev) ; residuals = residuals_wrk(:nev)
end block
Expand Down

0 comments on commit f1b114f

Please sign in to comment.