Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Parameters 伪参数是列,而实际参数是矩阵_Parameters_Fortran_Parameter Passing_Fortran77 - Fatal编程技术网

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

Parameters 伪参数是列,而实际参数是矩阵,parameters,fortran,parameter-passing,fortran77,Parameters,Fortran,Parameter Passing,Fortran77,我对中函数参数的声明感到困惑: 为什么开发人员决定将a声明为列向量,而语义上它是一个矩阵(参见代码注释)?类似地,ipvt被声明为一个单元素数组,而实际上它是一个大小为n的数组 LINPACK很有名,我不怀疑开发者的资格。我相信,他们是有想法的。最有可能的是表演 背景:当使用gfortran-fcheck=bounds编译代码时,我遇到了一个运行时错误。这也至少适用于和。正如在回答和使用1的数组范围时所解释的那样,是一种表示“某个未知大小”的老式方式。您可以按照注释中的提示,将实际大小放入参数声

我对中函数参数的声明感到困惑:

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

LINPACK很有名,我不怀疑开发者的资格。我相信,他们是有想法的。最有可能的是表演


背景:当使用
gfortran-fcheck=bounds
编译代码时,我遇到了一个运行时错误。这也至少适用于和。

正如在回答和使用
1的数组范围时所解释的那样,
是一种表示“某个未知大小”的老式方式。您可以按照注释中的提示,将实际大小放入参数声明中,以支持边界检查。最初的作者可能使用了一些编译器,对大小1进行了特殊处理。
      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.