Fortran Coder

标题: 有没有大神用过DEVCRG求解大型矩阵的特征值 [打印本页]

作者: Hover    时间: 2020-2-24 15:43
标题: 有没有大神用过DEVCRG求解大型矩阵的特征值
中间用DEVCRG求特征值时报错,错误信息和程序如下,盼复
>------ 已启动生成: 项目: Console11, 配置: Debug Win32 ------
1>Compiling with Intel(R) Visual Fortran Compiler XE 14.0.1.139 [IA-32]...
1>Source1.f90
1>Linking...
1>Source1.obj : error LNK2019: 无法解析的外部符号 _DEVCRG,该符号在函数 _MAIN__ 中被引用
1>Source1.obj : error LNK2019: 无法解析的外部符号 _DLINCG,该符号在函数 _MAIN__ 中被引用
1>Debug\Console11.exe : fatal error LNK1120: 2 个无法解析的外部命令
1>
1>Build log written to  "file://C:\Users\Administrator\Documents\Visual Studio 2012\Projects\Console11\Console11\Debug\BuildLog.htm"
1>Console11 - 3 error(s), 0 warning(s)
========== 生成: 成功 0 个,失败 1 个,最新 0 个,跳过 0 个 ==========

[Fortran] 纯文本查看 复制代码
program main
include 'link_fnl_shared.h'
include 'link_fnl_static.h'
USE MKL95_PRECISION
USE MKL95_LAPACK

implicit none

integer ii,lda,n

double precision a(3,3)

complex(kind=8) e(3),v(3,3),anv(3,3),v1(3,3),v2(3,3) !特征值与特征向量要声明为复双精度

a(1,1)=1.d0
a(1,2)=2.d0
a(1,3)=0.d0
a(2,1)=0.d0
a(2,2)=3.d0
a(2,3)=0.d0
a(3,1)=2.d0
a(3,2)=-4.d0
a(3,3)=2.d0

call devcrg(3,a,3,e,v,3) !求特征值e与特征向量(矩阵)v

call DLINCG(3,v,3,ANv,3)

v1=matmul(ANV,a)
v2=matmul(v1,v) ! 对角化结果

write(*,*)v2

    end


fortran.PNG (28.68 KB, 下载次数: 226)

fortran.PNG

作者: fcode    时间: 2020-2-25 14:48
你首先要知道你调用的函数,是哪个库里的。
是IMSL还是MKL?
不能弄混了。

比如 devcrg 函数,是 IMSL 里的。那么就不要把 MKL 牵扯进来(除非你同时也使用了MKL中的函数)

关于IMSL的用法,由于每个版本都有不同,你可以看本论坛的视频教程 v.fcode.cn 应用篇之第三方函数库的使用。
http://v.fcode.cn/video-use_library.html

在我这里。用的 IMSL5.5,用以下代码说明即可:
include "link_f90_static.h"
USE evcrg_int




欢迎光临 Fortran Coder (http://bbs.fcode.cn/) Powered by Discuz! X3.2