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

Using parameters with atomic functions #34

Closed
joaoleal opened this issue Sep 2, 2018 · 8 comments
Closed

Using parameters with atomic functions #34

joaoleal opened this issue Sep 2, 2018 · 8 comments

Comments

@joaoleal
Copy link

joaoleal commented Sep 2, 2018

Would it be possible to expand the atomic function class to allow the definition of parameters?

@bradbell
Copy link
Contributor

bradbell commented Sep 3, 2018

I am considering defining a new atomic function interface that would be easier to use and have more features. See the heading Atomic on
https://coin-or.github.io/CppAD/doc/wish_list.htm#Atomic

Note that this is currently a collection of thoughts about atomic functions and not as yet a plan.

@joaoleal
Copy link
Author

joaoleal commented Sep 3, 2018

Great! :)
I see that CppAD would potentialy provide the atomic function with the indication that some input variables are parameters through vx.
How about if that atomic function requires them to be parameters?
For instance, an atomic function could wrap an ADFun that requires the use of fun.new_dynamic(dynamic).

@bradbell
Copy link
Contributor

bradbell commented Jan 6, 2019

I think that I have solved this issue; see the headings 01-05 and 01-06 on
http://coin-or.github.io/CppAD/doc/whats_new_19.htm

@joaoleal
Copy link
Author

joaoleal commented Jan 7, 2019 via email

@bradbell
Copy link
Contributor

bradbell commented Jan 8, 2019

I am not sure I understand the question
'will the reverse/forward jac/hess methods (not virtual) be called if I override the jac/hess methods?'

There is an base class definition, that returns false, for all of the virtual functions.
It the calculations require a virtual function that has not be defined, and NDEBUG is not defined, the program should return an error message identifying the required function.

Perhaps it is best to start with the example
http://coin-or.github.io/CppAD/doc/atomic_three_get_started.cpp.htm

As for using dynamic parameters. The following might be another place to get started:
http://coin-or.github.io/CppAD/doc/atomic_three_dynamic.cpp.htm

@bradbell
Copy link
Contributor

There is a problem optimizing with atomic_three functions (which I am fixing); see
https://coin-or.github.io/CppAD/doc/whats_new_19.htm#01-11

@bradbell
Copy link
Contributor

The problem has been fixed; see the heading 01-14 on
https://coin-or.github.io/CppAD/doc/whats_new_19.htm#01-14

@joaoleal
Copy link
Author

Thank you!
I'm still implementing the changes to Cppadcodegen but the new atomic function API appears to be what is required to use parameters.

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