f77_main.f.old

来自「LU矩阵分解单机版最新版本」· OLD 代码 · 共 49 行

OLD
49
字号
      program f77_main      integer maxn, maxnz      parameter ( maxn = 10000, maxnz = 100000 )      integer rowind(maxnz), colptr(maxn)      real*8  values(maxnz), b(maxn)      integer n, nnz, nrhs, ldb, info      integer factors(8), iopt*      call hbcode1(n, n, nnz, values, rowind, colptr)*      nrhs = 1      ldb = n      do i = 1, n         b(i) = 1      enddo** First, factorize the matrix. The factors are stored in factor() handle.      iopt = 1      call c_fortran_dgssv( iopt, n, nnz, nrhs, values, rowind, colptr,      $                      b, ldb, factors, info )*      if (info .eq. 0) then         write (*,*) 'Factorization succeeded'      else         write(*,*) 'INFO from factorization = ', info      endif** Second, solve the system using the existing factors.      iopt = 2      call c_fortran_dgssv( iopt, n, nnz, nrhs, values, rowind, colptr,      $                      b, ldb, factors, info )*      if (info .eq. 0) then         write (*,*) 'Solve succeeded'         write (*,*) (b(i), i=1, 10)      else         write(*,*) 'INFO from triangular solve = ', info      endif* Last, free the storage allocated inside SuperLU      iopt = 3      call c_fortran_dgssv( iopt, n, nnz, nrhs, values, rowind, colptr,      $                      b, ldb, factors, info )*      stop      end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?