Gilles created MATH-804:
---------------------------

             Summary: Make "CurveFitter" a generic class
                 Key: MATH-804
                 URL: https://issues.apache.org/jira/browse/MATH-804
             Project: Commons Math
          Issue Type: Improvement
            Reporter: Gilles
            Assignee: Gilles
            Priority: Trivial
             Fix For: 3.1


In order to enhance compile-time robustness, it is proposed to parameterize the 
"CurveFitter" class with the type of the function to be used for the fit, i.e.:
{code}
public class CurveFitter<T extends ParametricUnivariateFunction> {
    // ...

    public double[] fit(T f, final double[] initialGuess) {
        // ...
    }

}
{code}

Thus enforcing that instances of subclasses like "PolynomialFitter" defined as
{code}
public class PolynomialFitter extends 
CurveFitter<PolynomialFunction.Parametric> {
    // ...
}
{code}
cannot call the "fit" method with a different function argument.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to