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

Missing support for erf() in forward2sweep() #16

Closed
joaoleal opened this issue Sep 22, 2016 · 2 comments
Closed

Missing support for erf() in forward2sweep() #16

joaoleal opened this issue Sep 22, 2016 · 2 comments

Comments

@joaoleal
Copy link

Support for the operation type ErfOp is not yet implemented in forward2sweep() which is used, for instance, to determine the sparse Jacobian.

Here is an example showing the issue:

    using CppAD::AD;

    // domain space vector
    size_t n  = 1;
    double x0 = 0.5;
    CPPAD_TESTVECTOR(AD<double>) ax(n);
    ax[0]     = x0;

    // declare independent variables and start tape recording
    CppAD::Independent(ax);

    // range space vector
    size_t m = 1;
    CPPAD_TESTVECTOR(AD<double>) ay(m);
    ay[0] = CppAD::erf(ax[0]);

    // create f: x -> y and stop tape recording
    CppAD::ADFun<double> f(ax, ay); // OK

    // forward computation of first partial w.r.t. x[0]
    CPPAD_TESTVECTOR(double) dx(n);
    CPPAD_TESTVECTOR(double) dy(m);
    dx[0] = 1.;
    dy    = f.Forward(1, dx); // OK

    // reverse computation of derivative of y[0]
    CPPAD_TESTVECTOR(double)  w(m);
    CPPAD_TESTVECTOR(double) dw(n);
    w[0]  = 1.;
    dw    = f.Reverse(1, w); // OK

    // sparse Jacobian
    f.SparseJacobian(dx); // Failure here
@bradbell
Copy link
Contributor

I think I have fixed the problem with the following commit:
96c804b

Please check this and close the bug if this change passes your tests.
Brad

@joaoleal
Copy link
Author

That worked.
Thank you!

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

No branches or pull requests

2 participants