Vector-valued functions with manual gradients in external C++

I hope my comment was not misunderstood! Your guide was the single most useful write-up I found and perfect as an introduction. And it finally enabled me to successfully implemented a univariate function with custom gradient. Many thanks for that!

It is just specifically with respect to generalising to multivariate functions that an additional pointer or two would have been useful, even just to flag that there are differences. I think simply adding something along the lines of “In the case of a univariate function…” to the bit I quoted would already do the trick.