Skip to content

Commit 18ca59b

Browse files
committed
Merge branch 'kr/feature/gonum-bug1' of github.com:MatProGo-dev/simplex into kr/feature/gonum-bug1
2 parents 16d1b2a + 4ea1230 commit 18ca59b

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

algorithms/tableau/state.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func (state *TableauAlgorithmState) CalculateOptimalSolution() (mat.VecDense, er
289289
// - The non-basic variables set to zero
290290
A, b := state.A(), state.B()
291291
numConstraints, _ := A.Dims()
292-
numNonBasic := state.Tableau.NumberOfNonBasicVariables() //state.NumberOfVariables() - state.NumberOfConstraints()
292+
numNonBasic := state.Tableau.NumberOfNonBasicVariables()
293293

294294
// Augment the A and b matrices with the non-basic variable constraints
295295
AAugmented := mat.NewDense(numConstraints+numNonBasic, numVars, nil)

solution/simplex_solution.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ package simplex_solution
22

33
import solution_status "github.com/MatProGo-dev/MatProInterface.go/solution/status"
44

5+
// SimplexSolution represents the result of solving a linear program using the simplex method.
6+
// It contains the values of the decision variables, the objective value, and the solution status.
57
type SimplexSolution struct {
8+
// VariableValues maps variable IDs (as uint64) to their solution values.
9+
// The uint64 key typically represents the unique identifier or index of a variable in the model.
610
VariableValues map[uint64]float64
11+
// Objective is the value of the objective function at the solution.
712
Objective float64
13+
// Status indicates the status of the solution (e.g., optimal, infeasible).
814
Status solution_status.SolutionStatus
915
Iterations int
1016
}

0 commit comments

Comments
 (0)