CalculiX  2.13
A Free Software Three-Dimensional Structural Finite Element Program
linpack.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine dpofa (a, lda, n, info)
 
subroutine dtrsl (t, ldt, n, b, job, info)
 

Function/Subroutine Documentation

◆ dpofa()

subroutine dpofa ( double precision, dimension(lda,*)  a,
integer  lda,
integer  n,
integer  info 
)
7  integer lda,n,info
8  double precision a(lda,*)
9 c
10 c dpofa factors a double precision symmetric positive definite
11 c matrix.
12 c
13 c dpofa is usually called by dpoco, but it can be called
14 c directly with a saving in time if rcond is not needed.
15 c (time for dpoco) = (1 + 18/n)*(time for dpofa) .
16 c
17 c on entry
18 c
19 c a double precision(lda, n)
20 c the symmetric matrix to be factored. only the
21 c diagonal and upper triangle are used.
22 c
23 c lda integer
24 c the leading dimension of the array a .
25 c
26 c n integer
27 c the order of the matrix a .
28 c
29 c on return
30 c
31 c a an upper triangular matrix r so that a = trans(r)*r
32 c where trans(r) is the transpose.
33 c the strict lower triangle is unaltered.
34 c if info .ne. 0 , the factorization is not complete.
35 c
36 c info integer
37 c = 0 for normal return.
38 c = k signals an error condition. the leading minor
39 c of order k is not positive definite.
40 c
41 c linpack. this version dated 08/14/78 .
42 c cleve moler, university of new mexico, argonne national lab.
43 c
44 c subroutines and functions
45 c
46 c blas ddot
47 c fortran sqrt
48 c
49 c internal variables
50 c
51  double precision ddot,t
52  double precision s
53  integer j,jm1,k
54 c begin block with ...exits to 40
55 c
56 c
57  do 30 j = 1, n
58  info = j
59  s = 0.0d0
60  jm1 = j - 1
61  if (jm1 .lt. 1) go to 20
62  do 10 k = 1, jm1
63  t = a(k,j) - ddot(k-1,a(1,k),1,a(1,j),1)
64  t = t/a(k,k)
65  a(k,j) = t
66  s = s + t*t
67  10 continue
68  20 continue
69  s = a(j,j) - s
70 c ......exit
71  if (s .le. 0.0d0) go to 40
72  a(j,j) = sqrt(s)
73  30 continue
74  info = 0
75  40 continue
76  return
double precision function ddot(N, DX, INCX, DY, INCY)
Definition: dgmres.f:2469

◆ dtrsl()

subroutine dtrsl ( double precision, dimension(ldt,*)  t,
integer  ldt,
integer  n,
double precision, dimension(*)  b,
integer  job,
integer  info 
)
82  integer ldt,n,job,info
83  double precision t(ldt,*),b(*)
84 c
85 c
86 c dtrsl solves systems of the form
87 c
88 c t * x = b
89 c or
90 c trans(t) * x = b
91 c
92 c where t is a triangular matrix of order n. here trans(t)
93 c denotes the transpose of the matrix t.
94 c
95 c on entry
96 c
97 c t double precision(ldt,n)
98 c t contains the matrix of the system. the zero
99 c elements of the matrix are not referenced, and
100 c the corresponding elements of the array can be
101 c used to store other information.
102 c
103 c ldt integer
104 c ldt is the leading dimension of the array t.
105 c
106 c n integer
107 c n is the order of the system.
108 c
109 c b double precision(n).
110 c b contains the right hand side of the system.
111 c
112 c job integer
113 c job specifies what kind of system is to be solved.
114 c if job is
115 c
116 c 00 solve t*x=b, t lower triangular,
117 c 01 solve t*x=b, t upper triangular,
118 c 10 solve trans(t)*x=b, t lower triangular,
119 c 11 solve trans(t)*x=b, t upper triangular.
120 c
121 c on return
122 c
123 c b b contains the solution, if info .eq. 0.
124 c otherwise b is unaltered.
125 c
126 c info integer
127 c info contains zero if the system is nonsingular.
128 c otherwise info contains the index of
129 c the first zero diagonal element of t.
130 c
131 c linpack. this version dated 08/14/78 .
132 c g. w. stewart, university of maryland, argonne national lab.
133 c
134 c subroutines and functions
135 c
136 c blas daxpy,ddot
137 c fortran mod
138 c
139 c internal variables
140 c
141  double precision ddot,temp
142  integer case,j,jj
143 c
144 c begin block permitting ...exits to 150
145 c
146 c check for zero diagonal elements.
147 c
148  do 10 info = 1, n
149 c ......exit
150  if (t(info,info) .eq. 0.0d0) go to 150
151  10 continue
152  info = 0
153 c
154 c determine the task and go to it.
155 c
156  case = 1
157  if (mod(job,10) .ne. 0) case = 2
158  if (mod(job,100)/10 .ne. 0) case = case + 2
159  go to (20,50,80,110), case
160 c
161 c solve t*x=b for t lower triangular
162 c
163  20 continue
164  b(1) = b(1)/t(1,1)
165  if (n .lt. 2) go to 40
166  do 30 j = 2, n
167  temp = -b(j-1)
168  call daxpy(n-j+1,temp,t(j,j-1),1,b(j),1)
169  b(j) = b(j)/t(j,j)
170  30 continue
171  40 continue
172  go to 140
173 c
174 c solve t*x=b for t upper triangular.
175 c
176  50 continue
177  b(n) = b(n)/t(n,n)
178  if (n .lt. 2) go to 70
179  do 60 jj = 2, n
180  j = n - jj + 1
181  temp = -b(j+1)
182  call daxpy(j,temp,t(1,j+1),1,b(1),1)
183  b(j) = b(j)/t(j,j)
184  60 continue
185  70 continue
186  go to 140
187 c
188 c solve trans(t)*x=b for t lower triangular.
189 c
190  80 continue
191  b(n) = b(n)/t(n,n)
192  if (n .lt. 2) go to 100
193  do 90 jj = 2, n
194  j = n - jj + 1
195  b(j) = b(j) - ddot(jj-1,t(j+1,j),1,b(j+1),1)
196  b(j) = b(j)/t(j,j)
197  90 continue
198  100 continue
199  go to 140
200 c
201 c solve trans(t)*x=b for t upper triangular.
202 c
203  110 continue
204  b(1) = b(1)/t(1,1)
205  if (n .lt. 2) go to 130
206  do 120 j = 2, n
207  b(j) = b(j) - ddot(j-1,t(1,j),1,b(1),1)
208  b(j) = b(j)/t(j,j)
209  120 continue
210  130 continue
211  140 continue
212  150 continue
213  return
subroutine daxpy(N, DA, DX, INCX, DY, INCY)
Definition: dgmres.f:1276
double precision function ddot(N, DX, INCX, DY, INCY)
Definition: dgmres.f:2469
Hosted by OpenAircraft.com, (Michigan UAV, LLC)