Closed Domi04151309 closed 1 year ago
I propose to add the following function to Table.php
/** @return array */
function getBasis()
{
return array_map(fn ($value) => $value->getVar(), $this->rows);
}
@Domi04151309 Thanks, the basis was already present in $basis
variable, so I just added a getter.
I suggested the above function because the basis variable does not get reset after each iteration. See the below image for the difference: It uses the example from the README.
@Domi04151309 You're absolutely right. The basis was not being reset on each solution step. I fixed it and also added a test that uses the example task (as you mentioned). Could you please test it now?
On a side note: This is an issue that is connected to my poor design decision that I've made at the very beginning of this project and has to do with mutable objects. I'm currently working on version 2 of this library that deals with all these bottlenecks and will hopefully be much easier to use and hopefully bring big performance boost in the calculation. If everything goes well, also basis cycling detection will be implemented :-)
Stay tuned!
Thanks for the fix! Works as intended now.
It would be nice to allow access to the
basis
variable in theTable
class by implementing a getter.