Skip to content

How to add self defined functions to AD<Base>? #151

Answered by bradbell
xuruilong100 asked this question in Q&A
Discussion options

You must be logged in to vote

The operation sequence will depend on the results of all the if branches in your program; see
https://coin-or.github.io/CppAD/doc/compare_change.htm

It is more complicated to create a gamma function where you never have to retape. For an example see the atan2 example
https://coin-or.github.io/CppAD/doc/condexp.htm#Atan2

It is even more complicated, but more efficient, to create an atomic gamma function; see
https://coin-or.github.io/CppAD/doc/atomic_four_get_started.cpp.htm
Note that to use this in derivative calculations, you will have to define the derivatives of the gamma function.

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by xuruilong100
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #147 on June 21, 2022 05:30.