伪参数是列,而实际参数是矩阵

时间:2017-07-12 13:01:26

标签: parameters fortran parameter-passing fortran77

我对zgefa()LINPACK函数参数的声明感到困惑:

      subroutine zgefa(a,lda,n,ipvt,info)
      integer lda,n,ipvt(1),info
      complex*16 a(lda,1)
c
c     ...
c
c        a       complex*16(lda, n)
c                the matrix to be factored.
c
c        lda     integer
c                the leading dimension of the array  a .
c
c        n       integer
c                the order of the matrix  a .
c
c     ...
c
c        ipvt    integer(n)
c                an integer vector of pivot indices.

为什么开发人员决定将a声明为列向量,而在语义上它是一个矩阵(参见代码注释)?类似地,ipvt被声明为单元素数组,而实际上它是一个大小为n的数组。

LINPACK很有名,我不怀疑开发人员的资格。我相信,他们有一些想法。最有可能的是表现。

背景:我在使用gfortran -fcheck=bounds编译代码时遇到了运行时错误。这也适用于至少zgeco()zgedi()

0 个答案:

没有答案
相关问题