&nbsp; Hi,<br><br>&nbsp;&nbsp; I&#39;m solving non-linear problems with Line Search, and sometimes I need to change an entire row of the Jacobian together with the corresponding element in the Function, but I only know which rows/elements need to be changed when I&#39;m computing the Jacobian. So, what I&#39;d like to know first is:<br>
<br>&nbsp; 1) Am I allowed to change the Function vector from inside FormJacobian? (I&#39;ve looked inside SNESSolve_LS, and it seems that this is not allowed, because &quot;fnorm&quot; is evaluated before SNESComputeJacobian, and if I change F inside FormJacobian, fnorm would be wrong).<br>
<br>&nbsp; or <br><br>&nbsp; 2) Am I allowed to change the Function vector from PreCheck routine?<br><br>&nbsp; If none of that is allowed, another solution that I thought was to compute the Jacobian while computing the Function. The FAQ says that &quot;You are free to have your &#39;FormFunction&#39; compute as much of the Jacobian at that point as you like, keep the information in the user context (the final argument to FormFunction and FormJacobian) and then retreive the information in your FormJacobian() function&quot;. The problem is that FormFunction is called many times more than FormJacobian, and Jacobian calculation is slow, so:<br>
<br>&nbsp; 3) Is there any way to know when I should really recompute the Jacobian from inside FormFunction? (I don&#39;t think so, but...)<br>&nbsp; <br>&nbsp; Well, is there any way to solve this problem? ;)<br><br>Thanks in advance,<br>
&nbsp; Edson<br><br>