为 ARPACK 中的数组 ipntr 赋值

发布于 2024-12-02 08:37:18 字数 1759 浏览 1 评论 0原文

我试图弄清楚如何将值分配给 ARPACK 中名为 ipntr 的数组,该数组存储指针。我对 Fortran 比较陌生,我无法弄清楚这个数组的值最初是如何设置的。我正在查看的代码是与 ARPACK 一起分发的不对称驱动程序示例 dndrv1.f ,我不理解的部分如下

      program dndrv1 

      integer           maxn, maxnev, maxncv, ldv
      parameter         (maxn=256, maxnev=12, maxncv=30, ldv=maxn)
c
c     %--------------%
c     | Local Arrays |
c     %--------------%
c
      integer           iparam(11), ipntr(14)
      logical           select(maxncv)
      Double precision
     &                  ax(maxn), d(maxncv,3), resid(maxn), 
     &                  v(ldv,maxncv), workd(3*maxn), 
     &                  workev(3*maxncv), 
     &                  workl(3*maxncv*maxncv+6*maxncv)
c
c     %---------------%
c     | Local Scalars |
c     %---------------%
c
      character         bmat*1, which*2
      integer           ido, n, nx, nev, ncv, lworkl, info, j,
     &                  ierr, nconv, maxitr, ishfts, mode
      Double precision
     &                  tol, sigmar, sigmai
      logical           first, rvec
c
c     %------------%
c     | Parameters |
c     %------------%
c
      Double precision
     &                  zero
      parameter         (zero = 0.0D+0)
c
c     %-----------------------------%
c     | BLAS & LAPACK routines used |
c     %-----------------------------%
c
      Double precision
     &                  dlapy2, dnrm2
      external          dlapy2, dnrm2, daxpy
c
c     %--------------------%
c     | Intrinsic function |
c     %--------------------%
c
      intrinsic         abs

      write(*,*) ipntr

写入语句的结果是:

1606679396 32767 1606696480 32767 1606918048 32767 0 0 0 0 0 0 0 0

显然没有什么比ipntr(1) = 1606679396 那么这些值是如何分配的呢?

谢谢

I am trying to figure out how values are assigned to the array called ipntr, which stores pointers, in ARPACK. I am relatively new to fortran and I can't figure out exactly how the values of this array are initially set. The code I am looking at is an unsymmetric driver example dndrv1.f distributed with ARPACK and the portion I am not understanding is as follows

      program dndrv1 

      integer           maxn, maxnev, maxncv, ldv
      parameter         (maxn=256, maxnev=12, maxncv=30, ldv=maxn)
c
c     %--------------%
c     | Local Arrays |
c     %--------------%
c
      integer           iparam(11), ipntr(14)
      logical           select(maxncv)
      Double precision
     &                  ax(maxn), d(maxncv,3), resid(maxn), 
     &                  v(ldv,maxncv), workd(3*maxn), 
     &                  workev(3*maxncv), 
     &                  workl(3*maxncv*maxncv+6*maxncv)
c
c     %---------------%
c     | Local Scalars |
c     %---------------%
c
      character         bmat*1, which*2
      integer           ido, n, nx, nev, ncv, lworkl, info, j,
     &                  ierr, nconv, maxitr, ishfts, mode
      Double precision
     &                  tol, sigmar, sigmai
      logical           first, rvec
c
c     %------------%
c     | Parameters |
c     %------------%
c
      Double precision
     &                  zero
      parameter         (zero = 0.0D+0)
c
c     %-----------------------------%
c     | BLAS & LAPACK routines used |
c     %-----------------------------%
c
      Double precision
     &                  dlapy2, dnrm2
      external          dlapy2, dnrm2, daxpy
c
c     %--------------------%
c     | Intrinsic function |
c     %--------------------%
c
      intrinsic         abs

      write(*,*) ipntr

The result of the write statement is:

1606679396 32767 1606696480 32767 1606918048 32767 0 0 0 0 0 0 0 0

Obviously there is nothing like ipntr(1) = 1606679396 so how have these values been assigned?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉薄对峙 2024-12-09 08:37:18

如果变量没有分配到任何地方,那么它们的值将由内存中恰好驻留的任何随机字节序列决定。您应该看到重新运行该程序将产生不同的输出序列。

If the variables aren't assigned anywhere, then their values will be determined by whatever random byte sequence happens to reside in memory. You should see that re-running the program will produce a different output sequence.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文