You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Gilles (JIRA)" <ji...@apache.org> on 2012/06/10 17:13:42 UTC

[jira] [Commented] (MATH-804) Make "CurveFitter" a generic class

    [ https://issues.apache.org/jira/browse/MATH-804?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13292531#comment-13292531 ] 

Gilles commented on MATH-804:
-----------------------------

Changes committed in revision 1348613.

                
> 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