Hi Alexander Le 06/08/2014 15:53, Alexander Nozik a écrit : > A DerivativeStructure and UnivariateDifferentiableFunction are great > tools if one needs to investigate the whole function but are not > convenient if one just needs derivative in a given point. > In order to calculate a derivative of function in a given point one > needs something like that: > > public static double calculateDerivative(UnivariateFunction > function, double point, double step) { > FiniteDifferencesDifferentiator diff = new > FiniteDifferencesDifferentiator(numPoints, step); > UnivariateDifferentiableFunction derivative = > diff.differentiate(function); > DerivativeStructure x = new DerivativeStructure(1, 1, 0, point); > DerivativeStructure y = derivative.value(x); > return y.getPartialDerivative(1); > } > > which is not very convenient. Perhaps you could add some helper methods > to FiniteDifferencesDifferentiator or to utility class like > FunctionUtils. Also it would be good to have helper methods to get the > derivatives of UnivariateDifferentiableFunction or > MultivariateDifferentiableFunction as simple Univariate or Multivariate > functions (or vector-functions). In java 8 it could be simply done by > adding some default methods to corresponding interfaces. But since > commons-math does not support java 8 (as far as I can understand), it > should be some utility class.
You are right, helper methods would be good. Could you open a Jira issue with this idea so we don't forget it? best regards, Luc > > With best regards, Alexander Nozik. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@commons.apache.org > For additional commands, e-mail: user-h...@commons.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org