This adds to pull request #4685. The problem happens if some artificial variable(s) remain basic at the end of Phase 1. PR #4685 solved the problem if the row in T associated with the artificial variable was zero (for all columns in T that correspond to a non-artificial variable). When there are non-zero elements in that row, then one of the non-zero elements is picked for pivot, and the artificial variable is replaced in the basis by the non-artificial variable. This is done until there are no more artificial variables in the basis that have non-zero rows in T.
…s provided The bug appeared at the beginning of Phase 2, if Phase 1 successfully terminated with some of the artificial variables as pivots. These artificial variables were zero because the corresponding element in the last column of T was zero, which allowed all artificial variables to be eliminated and Phase 1 to terminate successfully. However, basis[:m] contained elements that were greater than the length of solution, which resulted in IndexError at solution[basis[:m]]. The remaining true (non-artificial) variables that are not included in basis[:m] are also zero. Therefore simply setting the length of solution to be large enough solves the problem.
script. Also use Cython 0.22 in the benchmark suite.