Skip to content

Commit b1e31a5

Browse files
committed
Minor improvement in Gaussian Elimination in Julia
- Remove extraneous assignment
1 parent f76495a commit b1e31a5

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

contents/gaussian_elimination/code/julia/gaussian_elimination.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ function back_substitution(A::Array{Float64,2})
5252
# Creating the solution Vector
5353
soln = Vector{Float64}(rows)
5454

55-
# initialize the final element
56-
soln[rows] = A[rows, cols] / A[rows, cols-1]
57-
58-
for i = (rows - 1):-1:1
55+
for i = rows:-1:1
5956
sum = 0.0
6057
for j = rows:-1:i
6158
sum += soln[j]*A[i,j]

0 commit comments

Comments
 (0)