Dear all,<br><br>I&#39;m trying to do a gradient descent in my application. It was working well. But as I tried to lower the threshold(which means more iterations are happening), the application just stop rendering and give me a blank screen. Most misterious is, there is no error happens. No memory leak, no access vialation, no nothing. The program just jump out of the loop. I am really confused by this. <br>
<br>Here is my code<br><br>while(abs(CurErr - PreErr) &gt; threshold)<br>    {<br>        PreErr = CurErr;                                                <br>        tPoints-&gt;Delete();<br><br>        for (int i = 0; i&lt;sizeof(para)/sizeof(double); i++)<br>
        {<br>            temp_para[i] = para[i];                                       <br>        }<br><br>        for(int index = 0; index &lt; sizeof(para)/sizeof(double); index++)<br>        {                            <br>
            temp_para[index] = temp_para[index] + temp_para[index]*step;                    <br><br>            tCamera-&gt;DeepCopy(markCamera);<br>            tPoints = GenerateNewPoints(temp_para, count);             <br>
<br>            double err = Dist_2DLandmarks(tPoints, tCamera);            <br>            temp_para[index] = para[index];                                <br>            par_der[index] = (err - CurErr) / temp_para[index]*step;                        <br>
        }<br><br>        for(int i = 0; i &lt; sizeof(para)/sizeof(double); i++)<br>        {<br>            para[i] = para[i] - par_der[i] * step;       <br>        }<br><br>        tPoints = GenerateNewPoints(para, count);<br>
<br>        tCamera-&gt;DeepCopy(markCamera);                  <br><br>        CurErr = Dist_2DLandmarks(tPoints, tCamera);<br>        count ++;<br>    }<br><br>Thank you very much for any suggestions.<br><br>Best regards<br>
Long<br>