I have a matrix which needs to be changed by hit and trial method, evaluated and the values need to be re-assigned if it does not meet the requirements. I am doing this in a recursive function for chained assumption. Can this be done without creating multiple copies?
Can I restore the matrix while backtracking?
You ask: “Can I restore the matrix while backtracking?” I ask the same question – can you? If the modifications are easily reversible, then sure you can.
If unmodify is not trivial, then you’d be better off with