@@ -32,17 +32,17 @@ contains
32
32
end do
33
33
end subroutine
34
34
35
- module subroutine solve_backward_triangular_dense_${s}$(U ,b,x)
36
- ${t}$, intent(in) :: U (:,:)
35
+ module subroutine solve_backward_triangular_dense_${s}$(Lt ,b,x)
36
+ ${t}$, intent(in) :: Lt (:,:)
37
37
${t}$, intent(in) :: b(:)
38
38
${t}$, intent(inout) :: x(:)
39
39
40
40
integer(ilp) :: i, j, m
41
41
42
- do j = size(U ,dim=2), 1, -1
42
+ do j = size(Lt ,dim=2), 1, -1
43
43
x(j) = b(j)
44
44
do i = 1, j-1
45
- x(i) = x(i) - U(i,j )*x(j)
45
+ x(i) = x(i) - Lt(j,i )*x(j)
46
46
end do
47
47
end do
48
48
end subroutine
@@ -88,8 +88,8 @@ contains
88
88
end select
89
89
end subroutine
90
90
91
- module subroutine solve_backward_triangular_csr_${s}$(U ,b,x)
92
- type(CSR_${s}$_type), intent(in) :: U
91
+ module subroutine solve_backward_triangular_csr_${s}$(Lt ,b,x)
92
+ type(CSR_${s}$_type), intent(in) :: Lt
93
93
${t}$, intent(in) :: b(:)
94
94
${t}$, intent(inout) :: x(:)
95
95
${t}$ :: aux
@@ -98,30 +98,30 @@ contains
98
98
integer(ilp) :: i, j, m
99
99
100
100
baux = zero_${s}$
101
- select case (U %storage)
101
+ select case (Lt %storage)
102
102
case(sparse_full)
103
- do i = U %nrows, 1, -1
103
+ do i = Lt %nrows, 1, -1
104
104
x(i) = b(i) - baux(i)
105
- do m = U %rowptr(i), U %rowptr(i+1)-1
106
- j = U %col(m)
105
+ do m = Lt %rowptr(i), Lt %rowptr(i+1)-1
106
+ j = Lt %col(m)
107
107
if(j<i) cycle !> skip lower part of the matrix
108
- baux(j) = baux(j) + U %data(m)*x(i)
108
+ baux(j) = baux(j) + Lt %data(m)*x(i)
109
109
end do
110
110
end do
111
111
case(sparse_lower)
112
- do i = U %nrows, 1, -1
112
+ do i = Lt %nrows, 1, -1
113
113
x(i) = b(i) - baux(i)
114
- do m = U %rowptr(i), U %rowptr(i+1)-2
115
- j = U %col(m)
116
- baux(j) = baux(j) + U %data(m)*x(i)
114
+ do m = Lt %rowptr(i), Lt %rowptr(i+1)-2
115
+ j = Lt %col(m)
116
+ baux(j) = baux(j) + Lt %data(m)*x(i)
117
117
end do
118
118
end do
119
119
case(sparse_upper)
120
- do i = U %nrows, 1, -1
120
+ do i = Lt %nrows, 1, -1
121
121
x(i) = b(i)
122
- do m = U %rowptr(i)+1, U %rowptr(i+1)-1
123
- j = U %col(m)
124
- x(i) = x(i) - U %data(m)*x(j)
122
+ do m = Lt %rowptr(i)+1, Lt %rowptr(i+1)-1
123
+ j = Lt %col(m)
124
+ x(i) = x(i) - Lt %data(m)*x(j)
125
125
end do
126
126
end do
127
127
end select
0 commit comments