gonum/diff

fd: guard against function modification

Closed this issue · 1 comments

Gradient at the moment will fail if the function modifies the input slice. We could say the function is not allowed to, but there's no good reason to not protectively copy

That could be a lot of copying, len(formula.Stencil) * len(x).