commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gilles (JIRA)" <j...@apache.org>
Subject [jira] [Created] (MATH-804) Make "CurveFitter" a generic class
Date Sun, 10 Jun 2012 13:28:43 GMT
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

        

Mime
View raw message