File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -82,14 +82,12 @@ function simplelu_factorize!(lu::LUSolver{T}, pivot=true) where {T}
82
82
end
83
83
84
84
function simplelu_solve! (lu:: LUSolver{T} ) where {T}
85
- local s:: T
86
-
87
85
@inbounds for i = 1 : lu. n
88
86
lu. x[i] = lu. b[lu. perms[i]]
89
87
end
90
88
91
89
@inbounds for i = 2 : lu. n
92
- s = 0
90
+ s = zero (T)
93
91
for j = 1 : i- 1
94
92
s += lu. A[i,j] * lu. x[j]
95
93
end
@@ -98,15 +96,15 @@ function simplelu_solve!(lu::LUSolver{T}) where {T}
98
96
99
97
lu. x[lu. n] /= lu. A[lu. n,lu. n]
100
98
@inbounds for i = lu. n- 1 : - 1 : 1
101
- s = 0
99
+ s = zero (T)
102
100
for j = i+ 1 : lu. n
103
101
s += lu. A[i,j] * lu. x[j]
104
102
end
105
103
lu. x[i] -= s
106
104
lu. x[i] /= lu. A[i,i]
107
105
end
108
106
109
- lu. b . = lu. x
107
+ copyto! ( lu. b, lu. x)
110
108
111
109
lu. x
112
110
end
You can’t perform that action at this time.
0 commit comments