37 integer,
intent(in) :: n
38 real,
dimension(n, n),
intent(inout) :: A
39 real,
dimension(n),
intent(inout) :: b
40 real,
dimension(n),
intent(out) :: x
47 factor = a(i, k)/a(k, k)
48 a(i, k + 1:n) = a(i, k + 1:n) - factor*a(k, k + 1:n)
49 b(i) = b(i) - factor*b(k)
56 x(i) = (b(i) - dot_product(a(i, i + 1:n), x(i + 1:n)))/a(i, i)
subroutine solvelinearsystem(A, b, x, n)