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}
8282end
8383
8484function simplelu_solve! (lu:: LUSolver{T} ) where {T}
85- local s:: T
86-
8785 @inbounds for i = 1 : lu. n
8886 lu. x[i] = lu. b[lu. perms[i]]
8987 end
9088
9189 @inbounds for i = 2 : lu. n
92- s = 0
90+ s = zero (T)
9391 for j = 1 : i- 1
9492 s += lu. A[i,j] * lu. x[j]
9593 end
@@ -98,15 +96,15 @@ function simplelu_solve!(lu::LUSolver{T}) where {T}
9896
9997 lu. x[lu. n] /= lu. A[lu. n,lu. n]
10098 @inbounds for i = lu. n- 1 : - 1 : 1
101- s = 0
99+ s = zero (T)
102100 for j = i+ 1 : lu. n
103101 s += lu. A[i,j] * lu. x[j]
104102 end
105103 lu. x[i] -= s
106104 lu. x[i] /= lu. A[i,i]
107105 end
108106
109- lu. b . = lu. x
107+ copyto! ( lu. b, lu. x)
110108
111109 lu. x
112110end
You can’t perform that action at this time.
0 commit comments