You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The class PolynomialFunction implements the interface UnivariateDifferentiableFunction, it can be interesting if this class implements also the interface RealFieldUnivariateFunction
The same remark can be done also with PolynomialFunctionNewtonForm and PolynomialSplineFunction
Thanks
The text was updated successfully, but these errors were encountered:
[disclaimer: Bryan is my intern, so I know what the underlying problem is]
Having PolynomialFunction implement RealFieldUnivariateFunction would indeed not be general
enough as RealFieldUnivariateFunction is a generic interface which imposes to select the field type T at class level. So we would need to have something like:
public class PolynomialFunction
implements UnivariateDifferentiableFunction, RealFieldUnivariateFunction<some field>
What we need is to have the generic type T appear at the level of the value() method, not
at the level of the interface/class.
So we need to introduce a new interface, lets call it FieldUnivariateFunction, where the interface
is not generic, but the value method is.
Unfortunately, we can neither say that FieldUnivariateFunction extends RealFieldUnivariateFunction nor the opposite. Both interfaces are independent of each other. What we can do, however, is have
a default method in one interface that convert an instance into the other type by "fixing" the type T.
The class PolynomialFunction implements the interface UnivariateDifferentiableFunction, it can be interesting if this class implements also the interface RealFieldUnivariateFunction
The same remark can be done also with PolynomialFunctionNewtonForm and PolynomialSplineFunction
Thanks
The text was updated successfully, but these errors were encountered: