Skip to content

Commit

Permalink
chore: update arpack to arpack-ng 3.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
szhorvat committed Nov 10, 2024
1 parent 2eb8d8a commit 9a7ba0a
Show file tree
Hide file tree
Showing 31 changed files with 2,131 additions and 2,576 deletions.
2 changes: 1 addition & 1 deletion src/sources.mk

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions src/vendor/arpack/debug.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
c
c\SCCS Information: @(#)
c FILE: debug.h SID: 2.3 DATE OF SID: 11/16/95 RELEASE: 2
c
c %---------------------------------%
c | See debug.doc for documentation |
c %---------------------------------%
integer logfil, ndigit, mgetv0,
!
!\SCCS Information: @(#)
! FILE: debug.h SID: 2.3 DATE OF SID: 11/16/95 RELEASE: 2
!
! %---------------------------------%
! | See debug.doc for documentation |
! %---------------------------------%
integer logfil, ndigit, mgetv0,
& msaupd, msaup2, msaitr, mseigt, msapps, msgets, mseupd,
& mnaupd, mnaup2, mnaitr, mneigh, mnapps, mngets, mneupd,
& mcaupd, mcaup2, mcaitr, mceigh, mcapps, mcgets, mceupd
common /debug/
& logfil, ndigit, mgetv0,
common /debug/
& logfil, ndigit, mgetv0,
& msaupd, msaup2, msaitr, mseigt, msapps, msgets, mseupd,
& mnaupd, mnaup2, mnaitr, mneigh, mnapps, mngets, mneupd,
& mcaupd, mcaup2, mcaitr, mceigh, mcapps, mcgets, mceupd
102 changes: 52 additions & 50 deletions src/vendor/arpack/dgetv0.f
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
c
c\Name: igraphdgetv0
c
c\Description:
c\Description:
c Generate a random initial residual vector for the Arnoldi process.
c Force the residual vector to be in the range of the operator OP.
c Force the residual vector to be in the range of the operator OP.
c
c\Usage:
c call igraphdgetv0
c ( IDO, BMAT, ITRY, INITV, N, J, V, LDV, RESID, RNORM,
c ( IDO, BMAT, ITRY, INITV, N, J, V, LDV, RESID, RNORM,
c IPNTR, WORKD, IERR )
c
c\Arguments
Expand All @@ -36,7 +36,7 @@
c B = 'G' -> generalized eigenvalue problem A*x = lambda*B*x
c
c ITRY Integer. (INPUT)
c ITRY counts the number of times that igraphdgetv0 is called.
c ITRY counts the number of times that igraphdgetv0 is called.
c It should be set to 1 on the initial call to igraphdgetv0.
c
c INITV Logical variable. (INPUT)
Expand All @@ -55,11 +55,11 @@
c if this is a "restart".
c
c LDV Integer. (INPUT)
c Leading dimension of V exactly as declared in the calling
c Leading dimension of V exactly as declared in the calling
c program.
c
c RESID Double precision array of length N. (INPUT/OUTPUT)
c Initial residual vector to be generated. If RESID is
c Initial residual vector to be generated. If RESID is
c provided, force RESID into the range of the operator OP.
c
c RNORM Double precision scalar. (OUTPUT)
Expand Down Expand Up @@ -88,38 +88,38 @@
c 1. D.C. Sorensen, "Implicit Application of Polynomial Filters in
c a k-Step Arnoldi Method", SIAM J. Matr. Anal. Apps., 13 (1992),
c pp 357-385.
c 2. R.B. Lehoucq, "Analysis and Implementation of an Implicitly
c 2. R.B. Lehoucq, "Analysis and Implementation of an Implicitly
c Restarted Arnoldi Iteration", Rice University Technical Report
c TR95-13, Department of Computational and Applied Mathematics.
c
c\Routines called:
c igraphsecond ARPACK utility routine for timing.
c igrapharscnd ARPACK utility routine for timing.
c igraphdvout ARPACK utility routine for vector output.
c dlarnv LAPACK routine for generating a random vector.
c dgemv Level 2 BLAS routine for matrix vector multiplication.
c dcopy Level 1 BLAS that copies one vector to another.
c ddot Level 1 BLAS that computes the scalar product of two vectors.
c ddot Level 1 BLAS that computes the scalar product of two vectors.
c dnrm2 Level 1 BLAS that computes the norm of a vector.
c
c\Author
c Danny Sorensen Phuong Vu
c Richard Lehoucq CRPC / Rice University
c Dept. of Computational & Houston, Texas
c Applied Mathematics
c Rice University
c Houston, Texas
c Rice University
c Houston, Texas
c
c\SCCS Information: @(#)
c FILE: getv0.F SID: 2.6 DATE OF SID: 8/27/96 RELEASE: 2
c\SCCS Information: @(#)
c FILE: getv0.F SID: 2.7 DATE OF SID: 04/07/99 RELEASE: 2
c
c\EndLib
c
c-----------------------------------------------------------------------
c
subroutine igraphdgetv0
& ( ido, bmat, itry, initv, n, j, v, ldv, resid, rnorm,
subroutine igraphdgetv0
& ( ido, bmat, itry, initv, n, j, v, ldv, resid, rnorm,
& ipntr, workd, ierr )
c
c
c %----------------------------------------------------%
c | Include files for debugging and timing information |
c %----------------------------------------------------%
Expand Down Expand Up @@ -167,7 +167,7 @@ subroutine igraphdgetv0
c | External Subroutines |
c %----------------------%
c
external dlarnv, igraphdvout, dcopy, dgemv, igraphsecond
external dlarnv, igraphdvout, dcopy, dgemv, igrapharscnd
c
c %--------------------%
c | External Functions |
Expand Down Expand Up @@ -208,15 +208,15 @@ subroutine igraphdgetv0
end if
c
if (ido .eq. 0) then
c
c
c %-------------------------------%
c | Initialize timing statistics |
c | & message level for debugging |
c %-------------------------------%
c
call igraphsecond (t0)
call igrapharscnd (t0)
msglvl = mgetv0
c
c
ierr = 0
iter = 0
first = .FALSE.
Expand All @@ -235,65 +235,67 @@ subroutine igraphdgetv0
idist = 2
call dlarnv (idist, iseed, n, resid)
end if
c
c
c %----------------------------------------------------------%
c | Force the starting vector into the range of OP to handle |
c | the generalized problem when B is possibly (singular). |
c %----------------------------------------------------------%
c
call igraphsecond (t2)
if (bmat .eq. 'G') then
call igrapharscnd (t2)
if (itry .eq. 1) then
nopx = nopx + 1
ipntr(1) = 1
ipntr(2) = n + 1
call dcopy (n, resid, 1, workd, 1)
ido = -1
go to 9000
else if (itry .gt. 1 .and. bmat .eq. 'G') then
call dcopy (n, resid, 1, workd(n + 1), 1)
end if
end if
c
c
c %-----------------------------------------%
c | Back from computing OP*(initial-vector) |
c %-----------------------------------------%
c
if (first) go to 20
c
c %-----------------------------------------------%
c | Back from computing B*(orthogonalized-vector) |
c | Back from computing OP*(orthogonalized-vector) |
c %-----------------------------------------------%
c
if (orth) go to 40
c
c
if (bmat .eq. 'G') then
call igraphsecond (t3)
call igrapharscnd (t3)
tmvopx = tmvopx + (t3 - t2)
end if
c
c
c %------------------------------------------------------%
c | Starting vector is now in the range of OP; r = OP*r; |
c | Compute B-norm of starting vector. |
c %------------------------------------------------------%
c
call igraphsecond (t2)
call igrapharscnd (t2)
first = .TRUE.
if (itry .eq. 1) call dcopy (n, workd(n + 1), 1, resid, 1)
if (bmat .eq. 'G') then
nbx = nbx + 1
call dcopy (n, workd(n+1), 1, resid, 1)
ipntr(1) = n + 1
ipntr(2) = 1
ido = 2
go to 9000
else if (bmat .eq. 'I') then
call dcopy (n, resid, 1, workd, 1)
end if
c
c
20 continue
c
if (bmat .eq. 'G') then
call igraphsecond (t3)
call igrapharscnd (t3)
tmvbx = tmvbx + (t3 - t2)
end if
c
c
first = .FALSE.
if (bmat .eq. 'G') then
rnorm0 = ddot (n, resid, 1, workd, 1)
Expand All @@ -308,7 +310,7 @@ subroutine igraphdgetv0
c %---------------------------------------------%
c
if (j .eq. 1) go to 50
c
c
c %----------------------------------------------------------------
c | Otherwise need to B-orthogonalize the starting vector against |
c | the current Arnoldi basis using Gram-Schmidt with iter. ref. |
Expand All @@ -324,16 +326,16 @@ subroutine igraphdgetv0
orth = .TRUE.
30 continue
c
call dgemv ('T', n, j-1, one, v, ldv, workd, 1,
call dgemv ('T', n, j-1, one, v, ldv, workd, 1,
& zero, workd(n+1), 1)
call dgemv ('N', n, j-1, -one, v, ldv, workd(n+1), 1,
call dgemv ('N', n, j-1, -one, v, ldv, workd(n+1), 1,
& one, resid, 1)
c
c
c %----------------------------------------------------------%
c | Compute the B-norm of the orthogonalized starting vector |
c %----------------------------------------------------------%
c
call igraphsecond (t2)
call igrapharscnd (t2)
if (bmat .eq. 'G') then
nbx = nbx + 1
call dcopy (n, resid, 1, workd(n+1), 1)
Expand All @@ -344,14 +346,14 @@ subroutine igraphdgetv0
else if (bmat .eq. 'I') then
call dcopy (n, resid, 1, workd, 1)
end if
c
c
40 continue
c
if (bmat .eq. 'G') then
call igraphsecond (t3)
call igrapharscnd (t3)
tmvbx = tmvbx + (t3 - t2)
end if
c
c
if (bmat .eq. 'G') then
rnorm = ddot (n, resid, 1, workd, 1)
rnorm = sqrt(abs(rnorm))
Expand All @@ -364,16 +366,16 @@ subroutine igraphdgetv0
c %--------------------------------------%
c
if (msglvl .gt. 2) then
call igraphdvout (logfil, 1, [rnorm0], ndigit,
call igraphdvout (logfil, 1, [rnorm0], ndigit,
& '_getv0: re-orthonalization ; rnorm0 is')
call igraphdvout (logfil, 1, [rnorm], ndigit,
call igraphdvout (logfil, 1, [rnorm], ndigit,
& '_getv0: re-orthonalization ; rnorm is')
end if
c
if (rnorm .gt. 0.717*rnorm0) go to 50
c
c
iter = iter + 1
if (iter .le. 1) then
if (iter .le. 5) then
c
c %-----------------------------------%
c | Perform iterative refinement step |
Expand All @@ -393,22 +395,22 @@ subroutine igraphdgetv0
rnorm = zero
ierr = -1
end if
c
c
50 continue
c
if (msglvl .gt. 0) then
call igraphdvout (logfil, 1, [rnorm], ndigit,
& '_getv0: B-norm of initial / restarted starting vector')
end if
if (msglvl .gt. 2) then
if (msglvl .gt. 3) then
call igraphdvout (logfil, n, resid, ndigit,
& '_getv0: initial / restarted starting vector')
end if
ido = 99
c
call igraphsecond (t1)
c
call igrapharscnd (t1)
tgetv0 = tgetv0 + (t1 - t0)
c
c
9000 continue
return
c
Expand Down
Loading

0 comments on commit 9a7ba0a

Please sign in to comment.