云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 不完全cholesky分解实现

不完全cholesky分解实现

  • 62 次阅读
  • 3 次下载
  • 2025/5/2 10:22:01

go to 10 15 continue

if( ja(kj) .gt. ja(j) ) go to 20 a(j) = a(j) - a(ik)*a(kj) 20 continue 25 continue 30 continue 40 continue return 50 continue

cc write(6,*)' value of k and a(k,k)',k,a(l2) cc write(6,*)' error zero on diagonal'

cc write(6,*)' matrix probably specified incorrectly or'

cc write(6,*)' incomplete factorization produces a singular matrix' return end

subroutine mmult(a,n,ia,ja,b,x,job) c

integer n,ia(1),ja(1),job real a(1),b(1),x(1) c

c this routine performs matrix vector multiple c for a sparse matrix structure c

c job has the following input meanings: c job = 1 matrix vector multiple

c = -1 matrix transpose vector multiple c = 2 unit lower matrix vector multiple

c = -2 unit lower matrix transpose vector multiple c = 3 upper matrix vector multiple

c = -3 upper matrix transpose vector multiple real dot c

c a*x c

if( job .ne. 1 ) go to 15 do 10 i = 1,n

b(i) = dot(a,n,ia,ja,i,1,n,x) 10 continue c

c trans(a)*x c

15 continue

if( job .ne. -1 ) go to 35

do 20 i = 1,n b(i) = 0.0e0 20 continue

do 30 i = 1,n

call axpy(a,n,ia,ja,i,1,n,x(i),b) 30 continue c

c l*x when l is unit lower c

35 continue

if( job .ne. 2 ) go to 45 do 40 i = 1,n

b(i) = x(i) + dot(a,n,ia,ja,i,1,i-1,x) 40 continue c

c trans(l)*x when l is unit lower c

45 continue

if( job .ne. -2 ) go to 55 do 49 i = 1,n b(i) = x(i) 49 continue

do 50 i = 1,n

call axpy(a,n,ia,ja,i,i,n,x(i),b) 50 continue c

c u*x c

55 continue

if( job .ne. 3 ) go to 65 do 60 i = 1,n

b(i) = dot(a,n,ia,ja,i,i,n,x) 60 continue c

c trans(u)*x c

65 continue

if( job .ne. -3 ) go to 85 do 70 i = 1,n b(i) = 0.0e0 70 continue

do 80 i = 1,n

call axpy(a,n,ia,ja,i,1,i,x(i),b) 80 continue

85 continue return end

subroutine put(t,a,n,ia,ja,i,j) c

integer n,ia(1),ja(1),i,j real t,a(1) c

c this routine will insert an element into the sparse matrix c structure. c

is = ia(i)

ie = ia(i+1) - 1

cc write(6,100)i,j,ia(i),ia(i+1)

100 format(' *** from put i,j,ia(i),ia(i+1) ',4i7) c

c row i is from is to ie in array a. c

do 10 k = is,ie

if( j .gt. ja(k) ) go to 10 if( j .ne. ja(k) ) go to 5 a(k) = t go to 20 5 continue

if( j .ge. ja(k) ) go to 12

call insert(t,a,n,ia,ja,i,j,k) go to 20 12 continue 10 continue c

c get here if should be at the end of a row. c

k = ie + 1

call insert(t,a,n,ia,ja,i,j,k) go to 30 20 continue 30 continue return end

subroutine cgres(a,n,ia,ja,x,b,r) c

integer n,ia(1),ja(1) real a(1),x(1),b(1),r(1) c

c this routine computes a residual for a*x=b where c a is in a sparse structure c

real dot

do 10 i = 1,n

r(i) = b(i) - dot(a,n,ia,ja,i,1,n,x) 10 continue return end

subroutine ssol(a,n,ia,ja,b,job) c

integer n,ia(1),ja(1),job real a(1),b(1) c

c this routine solves a system of equations based on a sparse c matrix date structure.

c the array b contains the right hand side on input c and on output has the solution c

c job has the value 1 if l*x = b is to be solved.

c job has the value -1 if trans(l)*x = b is to be solved. c job has the value 2 if u*x = b is to be solved.

c job has the value -2 if trans(u)*x = b is to be solved. c

logical locate real t real dot c

c job = 1 solve l*x = b c

if( job .ne. 1 ) go to 15 c

c solve l*y=b c

do 10 i = 2,n

b(i) = b(i) - dot(a,n,ia,ja,i,1,i-1,b) 10 continue 15 continue

if( job .ne. 2 ) go to 25 c

c solve u*x=y c

do 20 ib = 1,n i = n - ib + 1

搜索更多关于: 不完全cholesky分解实现 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

go to 10 15 continue if( ja(kj) .gt. ja(j) ) go to 20 a(j) = a(j) - a(ik)*a(kj) 20 continue 25 continue 30 continue 40 continue return 50 continue cc write(6,*)' value of k and a(k,k)',k,a(l2) cc write(6,*)' error zero on diagonal' cc write(6

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com