draffensperger / golp

Go bindings for LPSolve, a Mixed Integer Linear Programming (MILP) solver
MIT License
78 stars 21 forks source link

Fix Duals() to retrive correct length of duals array #21

Closed alexykot closed 3 months ago

alexykot commented 3 months ago

This PR fixes a bug I introduced earlier in PR #18 in the Duals() function.

In that PR I confused len(rows) and len(cols) and was retrieving duals from resulting array for the length of columns, while in fact duals are produced for rows.

This fixes the tests as well. By accident the test that should have been validating this had equal rows and cols, so didn't throw an error. This PR fixes that as well.