Skip to content

Commit ffc0198

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

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
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]

contents/gaussian_elimination/gaussian_elimination.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,13 +383,13 @@ Here it is in code:
383383

384384
{% method %}
385385
{% sample lang="jl" %}
386-
[import:70-96, lang:"julia"](code/julia/gaussian_elimination.jl)
386+
[import:67-93, lang:"julia"](code/julia/gaussian_elimination.jl)
387387
{% sample lang="c" %}
388388
This code does not exist yet in C, so here's Julia code (sorry for the inconvenience)
389-
[import:70-96, lang:"julia"](code/julia/gaussian_elimination.jl)
389+
[import:67-93, lang:"julia"](code/julia/gaussian_elimination.jl)
390390
{% sample lang="rs" %}
391391
This code does not exist yet in rust, so here's Julia code (sorry for the inconvenience)
392-
[import:70-96, lang:"julia"](code/julia/gaussian_elimination.jl)
392+
[import:67-93, lang:"julia"](code/julia/gaussian_elimination.jl)
393393
{% endmethod %}
394394

395395
## Back-substitution

0 commit comments

Comments
 (0)