主题:[讨论]关于CVF下的IMSL以及彭国论的《fortran95程序设计》中说明
彭国论的《fortran95程序设计》第16章给出了很多在fortran中直接使用的imsl库函数,
问题在IMSL只带的pdf文件说明中根本就找不到说明,
因为pdf中给出的都是subroutine并非function,
比如我要使用cholesky分解,
书上给出的是chol(A)即可;
但imsl库说明文件MATH.PDF中给出的是:
CALL LCHRG (N, A, LDA, PIVOT, IPVT, FAC, LDFAC)
subroutine比function控制选项多,用起来有时候麻烦,但有其好处
显然彭国论的《fortran95程序设计》给的imsl的库函数在软件的说明中找不到(至少我找了几个是没有的),
那么他书中给出的又是从哪里获得的?并且的确可用,
编书时考虑篇幅是否省略了很多?还有其他的么?
谢谢讨论。
ps:
在用imsl库的cholesky分解的subroutine时:
LCHRG/DLCHRG (Single/Double precision)
Compute the Cholesky decomposition of a symmetric positive semidefinite
matrix with optional column pivoting.
Usage
CALL LCHRG (N, A, LDA, PIVOT, IPVT, FAC, LDFAC)
Arguments
N — Order of the matrix A. (Input)
A — N by N symmetric positive semidefinite matrix to be decomposed. (Input)
Only the upper triangle of A is referenced.
LDA — Leading dimension of A exactly as specified in the dimension statement
of the calling program. (Input)
PIVOT — Logical variable. (Input)
PIVOT = .TRUE. means column pivoting is done. PIVOT = .FALSE. means no
pivoting is done.
IPVT — Integer vector of length N containing information that controls the
selection of the pivot columns. (Input/Output)
On input, if IPVT(K) > 0, then the K-th column of A is an initial column; if
IPVT(K) = 0, then the K-th column of A is a free column; if IPVT(K) < 0, then
the K-th column of A is a final column. See Comments. On output, IPVT(K)
contains the index of the diagonal element of A that was moved into the K-th
position. IPVT is only referenced when PIVOT is equal to .TRUE..
FAC — N by N matrix containing the Cholesky factor of the permuted matrix in
its upper triangle. (Output)
If A is not needed, A and FAC can share the same storage locations.
LDFAC — Leading dimension of FAC exactly as specified in the dimension
statement of the calling program. (Input)
结果我定义了COMPLEX(KIND=8)::S(n,n)
说数据类型不对:
K1.F90(120) : Error: The type of the actual argument differs from the type of the dummy argument. [S]
suhroutine的说明也没说不支持复矩阵的分解!诡异。
问题在IMSL只带的pdf文件说明中根本就找不到说明,
因为pdf中给出的都是subroutine并非function,
比如我要使用cholesky分解,
书上给出的是chol(A)即可;
但imsl库说明文件MATH.PDF中给出的是:
CALL LCHRG (N, A, LDA, PIVOT, IPVT, FAC, LDFAC)
subroutine比function控制选项多,用起来有时候麻烦,但有其好处
显然彭国论的《fortran95程序设计》给的imsl的库函数在软件的说明中找不到(至少我找了几个是没有的),
那么他书中给出的又是从哪里获得的?并且的确可用,
编书时考虑篇幅是否省略了很多?还有其他的么?
谢谢讨论。
ps:
在用imsl库的cholesky分解的subroutine时:
LCHRG/DLCHRG (Single/Double precision)
Compute the Cholesky decomposition of a symmetric positive semidefinite
matrix with optional column pivoting.
Usage
CALL LCHRG (N, A, LDA, PIVOT, IPVT, FAC, LDFAC)
Arguments
N — Order of the matrix A. (Input)
A — N by N symmetric positive semidefinite matrix to be decomposed. (Input)
Only the upper triangle of A is referenced.
LDA — Leading dimension of A exactly as specified in the dimension statement
of the calling program. (Input)
PIVOT — Logical variable. (Input)
PIVOT = .TRUE. means column pivoting is done. PIVOT = .FALSE. means no
pivoting is done.
IPVT — Integer vector of length N containing information that controls the
selection of the pivot columns. (Input/Output)
On input, if IPVT(K) > 0, then the K-th column of A is an initial column; if
IPVT(K) = 0, then the K-th column of A is a free column; if IPVT(K) < 0, then
the K-th column of A is a final column. See Comments. On output, IPVT(K)
contains the index of the diagonal element of A that was moved into the K-th
position. IPVT is only referenced when PIVOT is equal to .TRUE..
FAC — N by N matrix containing the Cholesky factor of the permuted matrix in
its upper triangle. (Output)
If A is not needed, A and FAC can share the same storage locations.
LDFAC — Leading dimension of FAC exactly as specified in the dimension
statement of the calling program. (Input)
结果我定义了COMPLEX(KIND=8)::S(n,n)
说数据类型不对:
K1.F90(120) : Error: The type of the actual argument differs from the type of the dummy argument. [S]
suhroutine的说明也没说不支持复矩阵的分解!诡异。