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

generated condition uses value with type inconsistent with the parameter type #65

Closed
bjkeller opened this issue Feb 1, 2017 · 1 comment
Assignees
Labels

Comments

@bjkeller
Copy link

bjkeller commented Feb 1, 2017

The condition for
org.apache.commons.math3.analysis.differentiation.DerivativeStructure org.apache.commons.math3.analysis.differentiation.DerivativeStructure.divide(org.apache.commons.math3.analysis.differentiation.DerivativeStructure a)
assumes that zero translates to the corresponding int value.
However, the class has a zero object that is different from the int, and may be difficult to figure out from the class.

This is the generated condition method:

// org.apache.commons.math3.analysis.differentiation.DerivativeStructure org.apache.commons.math3.analysis.differentiation.DerivativeStructure.divide(org.apache.commons.math3.analysis.differentiation.DerivativeStructure a)
    public static boolean m22_t2(org.apache.commons.math3.analysis.differentiation.DerivativeStructure receiver22_t2, org.apache.commons.math3.analysis.differentiation.DerivativeStructure a) {
        // @throws org.apache.commons.math3.exception.MathArithmeticException if a is zero ==> args[0]==0
        return a == 0;
    }
@bjkeller
Copy link
Author

bjkeller commented Feb 1, 2017

With Apache Commons Math there is a general problem of badly typed conditions some more like the example above and some like issue #66.

Others where type has a "zero":
org.apache.commons.math3.analysis.differentiation.SparseGradient.divide(org.apache.commons.math3.analysis.differentiation.SparseGradient a)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants