Skip to content

Commit

Permalink
Uses the indices like in the book.
Browse files Browse the repository at this point in the history
On branch master

modified:   Solvers_Mod/Dense/Lu_Factorization_Doolittle.f90
  • Loading branch information
Niceno committed Feb 18, 2024
1 parent 81f8e0b commit b7d5377
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Solvers_Mod/Dense/Lu_Factorization_Doolittle.f90
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ subroutine Solvers_Mod_Dense_Lu_Factorization_Doolittle(LU, A)
do k = 1, n ! <-A

! Upper triangular
do i = k, min(n, k + bw)
Assert(k <= i) ! =--> (k,i) in U
do j = k, min(n, k + bw)
Assert(k <= j) ! =--> (k,j) in U
sum = 0.0
do s = max(1, k - bw, i - bw), k-1
do s = max(1, k - bw, j - bw), k-1
Assert(k > s) ! =--> (k,s) in L
Assert(s < i) ! =--> (s,i) in U
Assert(s < j) ! =--> (s,j) in U
! Here, (k,s) is travelling horizontally (in row k)
! and (s,i) is travelling vertically (in column i)
sum = sum + L % val(k,s) * U % val(s,i)
call IO % Plot_Dense("dens_lu_doolittle", LU, B=A, src1=(/k,s/), src2=(/s,i/))
! and (s,j) is travelling vertically (in column j)
sum = sum + L % val(k,s) * U % val(s,j)
call IO % Plot_Dense("dens_lu_doolittle", LU, B=A, src1=(/k,s/), src2=(/s,j/))
end do
U % val(k,i) = U % val(k,i) - sum
call IO % Plot_Dense("dens_lu_doolittle", LU, B=A, targ=(/k,i/))
U % val(k,j) = U % val(k,j) - sum
call IO % Plot_Dense("dens_lu_doolittle", LU, B=A, targ=(/k,j/))
end do

! Lower triangular
Expand Down

0 comments on commit b7d5377

Please sign in to comment.