3 #include "sll_memory.h"
4 #include "sll_working_precision.h"
19 sll_real64,
dimension(:, :)::a
20 sll_int32,
intent(in) ::n
21 sll_int32,
intent(out) ::l1, l2
22 sll_int32,
dimension(n) ::b1, b2
23 sll_int32::i, j, ll1, ll2
32 if (abs(a(i, j)) > 1d-16)
then
45 if (b1(i) > l1) l1 = b1(i)
46 if (b2(i) > l2) l2 = b2(i)
57 sll_real64,
dimension(:, :),
intent(in)::a
58 sll_real64,
dimension(:, :),
intent(out)::l, u
59 sll_int32,
intent(in)::n, l1, l2
60 sll_int32::i, j, k, ll1, ll2
76 l(i, k) = u(i, k)/u(k, k)
80 u(i, j) = u(i, j) - l(i, k)*u(k, j)
100 sll_real64,
dimension(:, :),
intent(in)::a
101 sll_real64,
dimension(:, :),
intent(out)::l, u
102 sll_int32,
intent(in)::n, l1, l2
103 sll_int32::i, j, k, ll1, band, ki, ji, ll1i
119 if (abs(u(ki, ll1i)) > 1d-16)
then
120 l(ki, ll1i) = u(ki, ll1i)/u(k, ll1)
124 if (ji <= band) u(ki, j) = u(ki, j) - l(ki, ll1i)*u(k, ji)
137 sll_real64,
dimension(:, :),
intent(in)::l, u
138 sll_real64,
dimension(:),
intent(in)::b
139 sll_int32,
intent(in)::l1, l2
140 sll_real64,
dimension(:),
intent(inout)::x
141 sll_int32,
intent(in)::n
142 sll_int32 ::i, j, ll1, ll2
154 x(i) = (b(i) - s)/l(i, i)
166 x(i) = (x(i) - s)/u(i, i)
175 sll_real64,
dimension(:, :),
intent(in)::l, u
176 sll_real64,
dimension(:),
intent(in)::b
177 sll_int32,
intent(in)::l1, l2
178 sll_real64,
dimension(:),
intent(inout)::x
179 sll_int32,
intent(in)::n
180 sll_int32 ::i, j, ll1, lll1, ll1j, ij
184 x(1) = b(1)/l(1, lll1)
191 if (ll1j > 0) s = s + l(i, j)*x(ll1j)
193 x(i) = (b(i) - s)/l(i, lll1)
196 x(n) = x(n)/u(n, lll1)
202 if (ij <= n) s = s + u(i, lll1 + j)*x(ij)
204 x(i) = (x(i) - s)/u(i, lll1)
212 sll_real64,
dimension(:, :),
intent(in) :: a
213 sll_real64,
dimension(:),
intent(out):: x
214 sll_real64,
dimension(:),
intent(in):: b
215 sll_int32,
intent(in) :: n
216 sll_real64,
dimension(:),
allocatable :: x_k, x_k1
217 sll_real64 :: error_l2, s1, s2
220 allocate (x_k(n), x_k1(n))
227 do while (error_l2 > 1d-12)
234 s1 = s1 + a(i, j)*x_k1(j)
238 s2 = s2 + a(i, j)*x_k(j)
241 x_k1(i) = (b(i) - s1 - s2)/a(i, i)
245 call residue(a, x_k1, b, n, error_l2)
252 deallocate (x_k, x_k1)
257 sll_real64,
dimension(:, :),
intent(in) :: a
258 sll_real64,
dimension(:),
intent(in) :: x
259 sll_real64,
dimension(:),
intent(in) :: b
260 sll_int32,
intent(in) :: n
261 sll_real64,
intent(out) :: error_l2
274 error_l2 = error_l2 + (s - b(i))**2
277 error_l2 = sqrt(error_l2)
282 sll_real64,
dimension(:, :),
intent(in) :: a
283 sll_real64,
dimension(:),
intent(out):: x
284 sll_real64,
dimension(:),
intent(in):: b
285 sll_int32,
intent(in) :: n
286 sll_real64,
dimension(:),
allocatable :: x_k, x_k1
287 sll_real64 :: error_l2, s1, s2
288 sll_int32,
intent(in) :: l1, l2
289 sll_int32 :: i, j, k, l_tot
291 allocate (x_k(n), x_k1(n))
299 do while (error_l2 > 1d-12)
308 if (k + j > 0) s1 = s1 + a(i, j)*x_k1(k + j)
312 if (k + j <= n) s2 = s2 + a(i, j)*x_k(k + j)
315 x_k1(i) = (b(i) - s1 - s2)/a(i, 1 + l1)
326 deallocate (x_k, x_k1)
331 sll_real64,
dimension(:, :),
intent(in) :: a
332 sll_real64,
dimension(:),
intent(in) :: x
333 sll_real64,
dimension(:),
intent(in) :: b
334 sll_int32,
intent(in) :: n
335 sll_int32,
intent(in) :: l1, l2
336 sll_real64,
intent(out) :: error_l2
338 sll_int32 :: i, j, k, l_tot, kj
351 if (kj > 0 .and. kj <= n) s = s + a(i, j)*x(kj)
353 error_l2 = error_l2 + (s - b(i))**2
356 error_l2 = sqrt(error_l2)
subroutine searchband(a, n, l1, l2)
subroutine residue(a, x, b, n, error_l2)
subroutine, public sll_s_solvlub_bande(l, u, x, b, n, l1, l2)
subroutine, public sll_s_factolub_bande(a, l, u, n, l1, l2)
subroutine gauss_seidel_bande(a, x, b, l1, l2, n)
subroutine solvlub(l, u, x, b, n, l1, l2)
subroutine gauss_seidel(a, x, b, n)
subroutine, public sll_s_residue_bande(a, x, b, l1, l2, n, error_l2)
subroutine factolub(a, l, u, n, l1, l2)