commons-issues mailing list archives

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

    [ 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

        

Mime
View raw message