Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Missing implementation #34

BryanCazabonne opened this issue Apr 10, 2018 · 1 comment

[Feature Request] Missing implementation #34

BryanCazabonne opened this issue Apr 10, 2018 · 1 comment


Copy link

@BryanCazabonne BryanCazabonne commented Apr 10, 2018

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

Copy link

@maisonobe maisonobe commented Apr 10, 2018

[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.

I'll do it in a few minutes.


@maisonobe maisonobe closed this in 1d80695 Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants