Skip to content
This repository was archived by the owner on Nov 23, 2018. It is now read-only.

Commit 1d10930

Browse files
committed
Refactor if statement
1 parent 802f208 commit 1d10930

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

convex/lp/simplex.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -573,12 +573,12 @@ func findInitialBasic(A mat64.Matrix, b []float64) ([]int, *mat64.Dense, []float
573573
continue
574574
}
575575
newBasic[addedIdx] = i
576-
if set {
577-
mat64.Col(col, i, A)
578-
ab.SetCol(addedIdx, col)
579-
} else {
576+
if !set {
580577
extractColumns(ab, A, newBasic)
581578
set = true
579+
} else {
580+
mat64.Col(col, i, A)
581+
ab.SetCol(addedIdx, col)
582582
}
583583
err := initializeFromBasic(xb, ab, b)
584584
if err == nil {

0 commit comments

Comments
 (0)