[CppAD] When differential information needs to be recalculated

Norman Goldstein normvcr at telus.net
Wed Mar 20 12:15:18 EDT 2013


Thank you.  That covers the 6 relational operators
<, <=, >, >=, ==, !=
for the types
AD<Base>, Base, int

To rely on CompareChange(), we should avoid using switch statements in f,
or any type of branch other than the 6 mentioned operators?

Also, to be clear, CompareChange() is disabled (always returns 0) if either
-- NDEBUG is defined, or
-- optimize() has been called

It makes sense that the onus is on the programmer for the more complicated
scenarios.  Do you know of any articles that deal with the code design 
issue of
compatibility with CompareChange(), such as replacing a switch statement
with a long "if-elsif-else" statement?



On 03/19/2013 09:36 PM, Brad Bell wrote:
> On 03/19/2013 09:09 PM, Norman Goldstein wrote:
>> Does CppAD recognize when a function's differential information needs 
>> to be recalculated?
>> Does it throw an exception? e.g. when the function being evaluated 
>> follows a different switch
>> statement case?
>>
>> Thank you.
>> _______________________________________________
>> CppAD mailing list
>> CppAD at list.coin-or.org
>> http://list.coin-or.org/mailman/listinfo/cppad
>>
> Perhaps you are looking for
> http://www.coin-or.org/CppAD/Doc/comparechange.xml
>
> _______________________________________________
> CppAD mailing list
> CppAD at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/cppad
>



More information about the CppAD mailing list