Gradient for a subset of variables
description
It would be great if there was a compile function with the following signature:
Compile(Variable[] variablesForWhichToComputeDerivatives, Variables[] parameters)
one would then call this compiled thing like this, assuming that a,b,c,d,e are all variables:
var compiledTerm= term.Compile(new Variable[] {a,b}, new Variable[] {c,d,e});
var res = compiledTerm.Evaluate(new double[] {3,2}, new double[] {4,5,6});
this would give me back the partial derivatives of the term with respect to a and b, evaluated at a=3, b=2, c=4 etc.
Essentially this would allow me to have constant terms in my function, but I can change the value of these constant terms between calls to evaluate.