[ADOL-C] conditional assignment inside a 'for' loop

Alfonso Callejo alcallejo at gmail.com
Thu Nov 26 11:34:13 EST 2009

Hello everybody,


I have a doubt about the use of conditional assignments. Imagine the
following loop in the function of which I want to calculate the Jacobian


for (...){

     if (...){


     }else if (...){







This loop has to do with the (constant) system topology, so the "decisions"
made by the 'if' condition will be different in every step of the 'for' loop
but they will be globally the same in every evaluation of the function
(independently of the time integration or the movement of the system). If
this is true (and this is the matter of my question), I think there is no
need to transform the 'if' condition into a 'condassign' sentence. Am I

The point is that I don't know how ADOL-C stores the sequence of operations
when there is a 'for' loop. If the different steps of the 'for' loop are
stored one after another sequentially in the tape, all the different
"decisions" of the 'if' condition will be stored correctly (as long as the
progress of the system doesn't change its "decisions").


Thank you in advance.

Kind regards,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/adol-c/attachments/20091126/368688c2/attachment.html 

More information about the ADOL-C mailing list