1. What is the calling function of the inverse matrix in Fortran?
In Fortran, you can use the LAPACK library function to calculate the inverse of a matrix. The following are the general steps for calling LAPACK to calculate the inverse matrix:
EXTERNAL
Statement to import subroutines in LAPACK. EXTERNAL DGETRF, DGETRI
DGETRF
Perform LU decomposition and then use DGETRI
to calculate the inverse matrix. CALL DGETRF(N, N, A, LDA, IPIV, INFO) CALL DGETRI(N, A, LDA, IPIV, WORK, LWORK, INFO)
N
: The order of the matrix. A
: Input matrix. LDA
: The size of the first dimension of matrix A
. IPIV
: Stores the intermediate results of LU decomposition. WORK
: work array. LWORK
: The size of the working array. INFO
: Returns the operation status. #2. Fortran programming questions to solve linear equations?
To solve a system of linear equations, you can use the functions in LAPACK. The following are the general steps:
EXTERNAL DGESV
DGESV
Solve systems of linear equations. CALL DGESV(N, NRHS, A, LDA, IPIV, B, LDB, INFO)
N
: The order of the matrix. NRHS
: The number of columns of the right matrix. A
: coefficient matrix. LDA
: The size of the first dimension of matrix A
. IPIV
: Stores the intermediate results of LU decomposition. B
: Right matrix. LDB
: The size of the first dimension of matrix B
. INFO
: Returns the operation status. 3. Fortran95 subroutine naming expert helps to correct mistakes and get high scores?
In Fortran95, the naming rules for subroutines are relatively free, but some common rules include:
SUBROUTINE SolveLinearSystem
_
Connect words. SUBROUTINE Matrix_Multiplication
SUBROUTINE MySum
Summary
The above is the detailed content of What functions can be called in Fortran to solve the inverse matrix?. For more information, please follow other related articles on the PHP Chinese website!