commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <>
Subject Re: [math]
Date Thu, 05 Jul 2012 17:21:46 GMT

> Thanks Giles! I was looking in the wrong place. Any suggestions on examples for these
classes (a math function example would be very nice)? I've found this link (very helpful)
but I don't know what to code in the gradient method. In ParametricUnivariateFunction.value
I just returned my function output with the params as arguments (plus x). For gradient, I'm
in a pitch.

And I'm lacking context (sorry, I deleted your previous email from my

Anyways, the "gradient(double x, double ... parameters)" method should
return the partial derivatives with respect to the _parameters_. So, for
public class ParamFuncExample implements ParametricUnivariateFunction {
  public double value(double x, double ... p) {
    return p[0] * x + p[1];

  public double[] gradient(double x, double ... p) {
    return new double[] { x, 1 };


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message