<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Courier;
        panose-1:2 7 4 9 2 2 5 2 4 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EstiloCorreo17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=ES link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Hello everybody,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>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 matrix:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Courier><span lang=EN-GB style='font-size:
10.0pt;font-family:Courier'>for (...){<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Courier><span lang=EN-GB style='font-size:
10.0pt;font-family:Courier'>&nbsp;&nbsp;&nbsp;&nbsp; if (...){<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Courier><span lang=EN-GB style='font-size:
10.0pt;font-family:Courier'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
...;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Courier><span lang=EN-GB style='font-size:
10.0pt;font-family:Courier'>&nbsp;&nbsp;&nbsp;&nbsp; }else if (...){<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Courier><span lang=EN-GB style='font-size:
10.0pt;font-family:Courier'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
...;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Courier><span lang=EN-GB style='font-size:
10.0pt;font-family:Courier'>&nbsp;&nbsp;&nbsp;&nbsp; }else{<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Courier><span lang=EN-GB style='font-size:
10.0pt;font-family:Courier'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
...;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Courier><span lang=EN-GB style='font-size:
10.0pt;font-family:Courier'>&nbsp;&nbsp;&nbsp;&nbsp; }<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Courier><span lang=EN-GB style='font-size:
10.0pt;font-family:Courier'>}<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>This loop has to do with the (constant) system
topology, so the &#8220;decisions&#8221; made by the &#8216;if&#8217; condition
will be different in every step of the &#8216;for&#8217; 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 &#8216;if&#8217;
condition into a &#8216;condassign&#8217; sentence. Am I right?<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>The point is that I don&#8217;t know how ADOL-C
stores the sequence of operations when there is a &#8216;for&#8217; loop. If
the different steps of the &#8216;for&#8217; loop are stored one after another sequentially
in the tape, all the different &#8220;decisions&#8221; of the &#8216;if&#8217; condition
will be stored correctly (as long as the progress of the system doesn&#8217;t
change its &#8220;decisions&#8221;).<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Thank you in advance.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Kind regards,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span lang=EN-GB style='font-size:
10.0pt;font-family:Arial'>Alfonso<o:p></o:p></span></font></p>

</div>

</body>

</html>