Hi team, the back substitution is giving me errors, I am not sure where I did wrong…
{mentor edit: code removed}
Please don’t post your code on the forum. That’s not allowed by the Code of Conduct.
Hint: Where you used “row-2”, that’s undoubtedly an error.
I tried row -1 is still the same, this is to get the third row if there are 4 rows right?
The error is
An exception was thrown while running your function: index 7 is out of bounds for axis 0 with size 3.
Input matrix:
[[1 0 0 5]
[0 1 0 6]
[0 0 1 7]]
NVM found the error,
The index = get_index_first_non_zero_value_from_row(M,row) I was passing the whole row array into the integer parameter.
Also I was misunderstand the process, on paper I normally work from bottom row’s non- zero column which is above a pivot to the top. In here we did it from r0 not r4 so we j=should use
# mentor edit: code removed
1 Like