|
|
关于LAPACK
官方网站:
http://netlib.amss.ac.cn/lapack/index.html
用户手册:
http://netlib.amss.ac.cn/lapack/lug/index.html
http://www.netlib.org/lapack/lawn41/index.html
LAPACK (Linear Algebra PACKage) 是Oak Ridge 国家实验室、加州大学Davis 分校和Illinois 大学等联合开发的线性代数函数库,用于在不同高性能计算环境上高效求解数值线性代数问题[7] 。
LAPACK 采用标准Fortran 77 编写。LAPACK 支持实型和复型数据类型,完全支持单精度和双精度计算。LAPACK 可以在向量机, 高性能超标量工作站,和共享存储多处理机上高效运行,也可以在各种类型的单机(PC, 工作站, 大型机)上获得满意的结果。LAPACK 最新版本为lapack-3.0。
测试文件:Single Precision Example (sgeev):
program test_sgeev
c Purpose: Compute the eigenvalues and, optionally, the left and/or
c right eigenvectors for an n-by-n real nonsymmetric matrix.
c Usage: call sgeev(jobvl, jobvr, n, a, lda, wr, wi, vl, ldvl, vr, ldvr,
c work, lwork, info)
integer nout, n, lda, lwork, ldvr, ldvl
parameter (nout=6, n=3, lda=n, lwork=5*n, ldvl=n, ldvr=n)
integer i, j, info
real a(lda,n), vr(ldvr,n), vl(ldvl,n)
real work(lwork), wi(n), wr(n)
external sgeev
c
data a / 3, 7, -4, 2, 8, -4, -1, -1, 3 /
c
call sgeev('N', 'V', n, a, lda, wr, wi, vl, ldvl, vr, ldvr,
& work, lwork, info)
c
write (*,*)
print*,' *** the real part of the computed eigenvalues ***'
write(nout, 98) (wr(i), i=1,n)
c
write (*,*)
print*,' *** the imaginary part of the computed eigenvalues ***'
write(nout, 98) (wi(i), i=1,n)
c
write (*,*)
print*,' *** the right eigenvectors ***'
do 10 i = 1,ldvr
write(nout, 99) vr(i,1), vr(i,2), vr(i,3)
10 continue
98 format (1x,f10.4)
99 format (1x,3f10.4)
c
end
***** OUTPUT: *****
*** the real part of the computed eigenvalues ***
11.0000
1.0000
2.0000
*** the imaginary part of the computed eigenvalues ***
0.0000
0.0000
0.0000
*** the right eigenvectors ***
-0.2673 -0.7071 -0.3714
-0.8018 0.7071 0.5571
0.5345 0.0000 0.7428
*********************
DGGEV 广义特征值求解,测试程序
implicit none
integer i,info
real(8) :: aa(2,2),bb(2,2),x(2),vl(2,2),vr(2,2)
real(8) :: WORK(16,2),A1(2), A2(2), B1(2)
data bb/10., 0., 0., 10./
data aa/20000, -10000, -10000, 10000/
call DGGEV('N','V',2,AA,2,BB,2,A1,A2,B1,VL,2,VR,2,WORK,16,info)
do i=1,2
x(i)=A1(i)/B1(i)
end do
write(*,*)x
end
解:2628 382
Windows环境编译方法
http://jsy.dyn.dhs.org/maths/for ... dows/#installLAPACK
转自:http://zhousicheng.googlepages.com/a_042 |
|