Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > df736a3bc446df5b16150bebb7296274 > files > 82

DSDP-devel-5.8-2.fc14.i686.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>DSDP: src/solver/dsdpconverge.c Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.7.4 -->
<div id="top">
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">DSDP</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="dir_23046874d7fed141927c769a66d8e3a5.html">src</a>      </li>
      <li class="navelem"><a class="el" href="dir_03c647d51c93e018646ff83aa2eeb169.html">solver</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">dsdpconverge.c</div>  </div>
</div>
<div class="contents">
<a href="dsdpconverge_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#include &quot;<a class="code" href="dsdp5_8h.html" title="The API to DSDP for those applications using DSDP as a subroutine library.">dsdp5.h</a>&quot;</span>
<a name="l00002"></a>00002 <span class="preprocessor">#include &quot;<a class="code" href="dsdpconverge_8h.html" title="Detect convergence of the solver from the duality gap and step sizes.">dsdpconverge.h</a>&quot;</span>
<a name="l00009"></a>00009 <span class="keyword">extern</span> <span class="keywordtype">int</span> <a class="code" href="dsdp_8h.html#a04dd4c7875c4c1d140093767c1f2a6f2" title="Get the structure containing convergence parameters.">DSDPGetConvergenceMonitor</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a>, ConvergenceMonitor**);
<a name="l00010"></a>00010 
<a name="l00024"></a>00024 <span class="preprocessor">#undef __FUNCT__  </span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ &quot;DSDPCheckConvergence&quot;</span>
<a name="l00026"></a><a class="code" href="group__DSDPConverge.html#ga0ec9106b132f46ce0a4109e1d9f3e3ff">00026</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPConverge.html#ga0ec9106b132f46ce0a4109e1d9f3e3ff" title="Check for Convergence.">DSDPDefaultConvergence</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">void</span> *ctx){
<a name="l00027"></a>00027 
<a name="l00028"></a>00028   ConvergenceMonitor *conv=(ConvergenceMonitor*)ctx;
<a name="l00029"></a>00029   <span class="keywordtype">int</span> info,i,iter;
<a name="l00030"></a>00030   <span class="keywordtype">double</span> mu,mu2;
<a name="l00031"></a>00031   <span class="keywordtype">double</span> rgap,rgap2,rgaptol=conv-&gt;rgaptol;
<a name="l00032"></a>00032   <span class="keywordtype">double</span> infeastol=0;
<a name="l00033"></a>00033   <span class="keywordtype">double</span> pnorm,dstep,pstep,steptol=conv-&gt;steptol,pnormtol=conv-&gt;pnormtol;
<a name="l00034"></a>00034   <span class="keywordtype">double</span> ppobj,ddobj, gap, dualbound=conv-&gt;dualbound;
<a name="l00035"></a>00035   <span class="keywordtype">double</span> res,np;
<a name="l00036"></a>00036   <a class="code" href="dsdpbasictypes_8h.html#a2a68c4cccb1289043bf9b59a58f55b3a" title="There are many reasons to terminate the solver.">DSDPTerminationReason</a> reason;
<a name="l00037"></a>00037   
<a name="l00038"></a>00038   DSDPFunctionBegin;
<a name="l00039"></a>00039   info = <a class="code" href="group__DSDPSolution.html#gadf4655c90ede45912f2e4ce7f4475cad" title="Copy the step sizes in the current iteration.">DSDPGetStepLengths</a>(dsdp,&amp;pstep,&amp;dstep); DSDPCHKERR(info);
<a name="l00040"></a>00040   info = <a class="code" href="group__DSDPSolution.html#gaaa2bb03bf7a025936b1d2cd619327a49" title="Copy the proximity of the solution to the central path.">DSDPGetPnorm</a>(dsdp,&amp;pnorm); DSDPCHKERR(info);
<a name="l00041"></a>00041   info = <a class="code" href="group__DSDPConverge.html#gaaeaa2ec0c50c43f4499aaffea692ede8" title="Copy the current iteration number.">DSDPGetIts</a>(dsdp,&amp;iter); DSDPCHKERR(info);
<a name="l00042"></a>00042   info = <a class="code" href="group__DSDPSolution.html#gadb9e055ef8b2194ae67ed14ca06f1d01" title="Copy the objective value (DD).">DSDPGetDDObjective</a>(dsdp,&amp;ddobj);  DSDPCHKERR(info);
<a name="l00043"></a>00043   info = <a class="code" href="group__DSDPSolution.html#gad603533b7e28587f5b2ee824eee58eb3" title="Copy the objective value (PP).">DSDPGetPPObjective</a>(dsdp,&amp;ppobj); DSDPCHKERR(info);
<a name="l00044"></a>00044   info = <a class="code" href="group__DSDPSolution.html#gacfa8e29ecd7eaaeb6a4e31eb07961de3" title="Copy the infeasibility in (D), or the variable r in (DD).">DSDPGetR</a>(dsdp,&amp;res); DSDPCHKERR(info);
<a name="l00045"></a>00045   info = <a class="code" href="group__DSDPSolver.html#ga05f1269e817495e448ffa8ae3a4012cf" title="Copy the current barrier parameter.">DSDPGetBarrierParameter</a>(dsdp,&amp;mu); DSDPCHKERR(info);
<a name="l00046"></a>00046   info = <a class="code" href="group__DSDPSolution.html#ga23662df5aded65ab570523c7b810af4e" title="Copy the dimension of the cones, or the number of constraints in (D).">DSDPGetDimension</a>(dsdp,&amp;np); DSDPCHKERR(info);
<a name="l00047"></a>00047   info = <a class="code" href="group__DSDPConverge.html#ga637bf541e030c5aef4d436a9792714a2" title="Copy the reason why the solver terminated.">DSDPStopReason</a>(dsdp,&amp;reason); DSDPCHKERR(info);
<a name="l00048"></a>00048   info = <a class="code" href="group__DSDPConverge.html#ga48cc08979850c048b38d7f1fd423deec" title="Copy the maximum infeasibility allowed (D).">DSDPGetRTolerance</a>(dsdp,&amp;infeastol); DSDPCHKERR(info);
<a name="l00049"></a>00049   info = <a class="code" href="group__DSDPSolution.html#gaf22c2d4d0e8172b9c48fde5c1c53abbc" title="Copy the difference between the objective values.">DSDPGetDualityGap</a>(dsdp,&amp;gap); DSDPCHKERR(info);
<a name="l00050"></a>00050   rgap=(gap)/(1.0+fabs(ddobj)/2+fabs(ppobj)/2);
<a name="l00051"></a>00051   rgap2=(mu*np)/(1.0+fabs(ddobj)/2+fabs(ppobj)/2);
<a name="l00052"></a>00052   <span class="keywordflow">if</span> (iter==0){
<a name="l00053"></a>00053     conv-&gt;history = DSDPHistory;
<a name="l00054"></a>00054     <span class="keywordflow">for</span> (i=0; i&lt;DSDPHistory; i++){
<a name="l00055"></a>00055       conv-&gt;alpha[i] = 0.0;
<a name="l00056"></a>00056       conv-&gt;gaphist[i] = 0.0;
<a name="l00057"></a>00057       conv-&gt;infhist[i] = 0.0;
<a name="l00058"></a>00058     }
<a name="l00059"></a>00059   }
<a name="l00060"></a>00060   <span class="keywordflow">if</span> (iter&lt;conv-&gt;history &amp;&amp; iter&gt;0){
<a name="l00061"></a>00061     conv-&gt;gaphist[iter-1]=(ppobj-ddobj);
<a name="l00062"></a>00062     conv-&gt;infhist[iter-1]=res;
<a name="l00063"></a>00063   }
<a name="l00064"></a>00064 
<a name="l00065"></a>00065   <span class="keywordflow">if</span> ( 0==1 ){
<a name="l00066"></a>00066     
<a name="l00067"></a>00067   } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( ddobj!=ddobj || pnorm &lt; 0){
<a name="l00068"></a>00068     reason = <a class="code" href="dsdpbasictypes_8h.html#a2a68c4cccb1289043bf9b59a58f55b3aafd547daf59da4b0986d7894d38d3d269">DSDP_NUMERICAL_ERROR</a>;
<a name="l00069"></a>00069     DSDPLogInfo(0,2,<span class="stringliteral">&quot;Stop due to Numerical Error\n&quot;</span>);
<a name="l00070"></a>00070   } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( rgap &lt;=rgaptol/1.01 &amp;&amp; res&lt;=infeastol ){
<a name="l00071"></a>00071     <span class="keywordflow">if</span> (pnorm&gt;pnormtol){
<a name="l00072"></a>00072       mu2=gap/np;
<a name="l00073"></a>00073       info = <a class="code" href="group__DSDPSolver.html#ga4bcfff950e84b1e925ae99202f23282a" title="Set the current barrier parameter.">DSDPSetBarrierParameter</a>(dsdp,mu2); DSDPCHKERR(info);
<a name="l00074"></a>00074     } <span class="keywordflow">else</span> {
<a name="l00075"></a>00075       reason = <a class="code" href="dsdpbasictypes_8h.html#a2a68c4cccb1289043bf9b59a58f55b3aa9d1d9628ba1a342cc5403338bc84ae6b">DSDP_CONVERGED</a>;
<a name="l00076"></a>00076       DSDPLogInfo(0,2,<span class="stringliteral">&quot;DSDP Converged:  Relative Duality Gap %4.2e &lt; %4.2e, Primal Feasible, Dual Infeasiblity %4.2e &lt; %4.2e \n&quot;</span>,rgap,rgaptol,res,infeastol);
<a name="l00077"></a>00077     }
<a name="l00078"></a>00078   } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( rgap2 &lt;=rgaptol/100 &amp;&amp; rgap&lt;0.01){
<a name="l00079"></a>00079     reason = <a class="code" href="dsdpbasictypes_8h.html#a2a68c4cccb1289043bf9b59a58f55b3aa9d1d9628ba1a342cc5403338bc84ae6b">DSDP_CONVERGED</a>;
<a name="l00080"></a>00080     DSDPLogInfo(0,2,<span class="stringliteral">&quot;DSDP Converged:  Relative Duality Gap %4.2e &lt; %4.2e. Check Feasiblity \n&quot;</span>,rgap,rgaptol);
<a name="l00081"></a>00081   } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( ddobj &gt; dualbound &amp;&amp; res&lt;=infeastol){
<a name="l00082"></a>00082     reason = <a class="code" href="dsdpbasictypes_8h.html#a2a68c4cccb1289043bf9b59a58f55b3aa3cf44a69251d45275e6c6564f08b3e08">DSDP_UPPERBOUND</a>;
<a name="l00083"></a>00083     DSDPLogInfo(0,2,<span class="stringliteral">&quot;DSDP Converged: Dual Objective: %4.2e &gt; upper bound %4.2e\n&quot;</span>,pnorm,dualbound);
<a name="l00084"></a>00084   } <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( iter &gt; 5 &amp;&amp; dstep&lt;steptol &amp;&amp; dstep*pnorm&lt; steptol &amp;&amp; rgap &lt;= 1.0e-3 ) {
<a name="l00085"></a>00085     reason = <a class="code" href="dsdpbasictypes_8h.html#a2a68c4cccb1289043bf9b59a58f55b3aaaae024f404b3e21b95c40583917f1c5f">DSDP_SMALL_STEPS</a>;
<a name="l00086"></a>00086     DSDPLogInfo(0,2,<span class="stringliteral">&quot;DSDP Terminated:  Small relative gap and small steps detected (3)\n&quot;</span>);
<a name="l00087"></a>00087   }
<a name="l00088"></a>00088 
<a name="l00089"></a>00089   info=<a class="code" href="group__DSDPConverge.html#ga1293e76a2fb57bd963713c3df7e88221" title="Monitor each iteration of the solver.">DSDPSetConvergenceFlag</a>(dsdp,reason); DSDPCHKERR(info); 
<a name="l00090"></a>00090 
<a name="l00091"></a>00091   DSDPFunctionReturn(0);
<a name="l00092"></a>00092 }
<a name="l00093"></a>00093 
<a name="l00108"></a>00108 <span class="preprocessor">#undef __FUNCT__  </span>
<a name="l00109"></a>00109 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ &quot;DSDPSetGapTolerance&quot;</span>
<a name="l00110"></a><a class="code" href="group__DSDPConverge.html#ga4c0fa6941c40cca7643c2f4a9ae813bf">00110</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPConverge.html#ga4c0fa6941c40cca7643c2f4a9ae813bf" title="Terminate the solver when the relative duality gap is less than this tolerance.">DSDPSetGapTolerance</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> gaptol){ 
<a name="l00111"></a>00111   <span class="keywordtype">int</span> info;
<a name="l00112"></a>00112   ConvergenceMonitor *conv;
<a name="l00113"></a>00113   DSDPFunctionBegin;
<a name="l00114"></a>00114   info=<a class="code" href="dsdp_8h.html#a04dd4c7875c4c1d140093767c1f2a6f2" title="Get the structure containing convergence parameters.">DSDPGetConvergenceMonitor</a>(dsdp,&amp;conv); DSDPCHKERR(info);
<a name="l00115"></a>00115   <span class="keywordflow">if</span> (gaptol &gt; 0) conv-&gt;rgaptol  = gaptol;
<a name="l00116"></a>00116   DSDPLogInfo(0,2,<span class="stringliteral">&quot;Set Relative Gap Tolerance: %4.4e\n&quot;</span>,gaptol);
<a name="l00117"></a>00117   DSDPFunctionReturn(0);
<a name="l00118"></a>00118 }
<a name="l00119"></a>00119 
<a name="l00130"></a>00130 <span class="preprocessor">#undef __FUNCT__  </span>
<a name="l00131"></a>00131 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ &quot;DSDPGetGapTolerance&quot;</span>
<a name="l00132"></a><a class="code" href="group__DSDPConverge.html#ga876bd5084bfd1b62eb37211d4bcf188e">00132</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPConverge.html#ga876bd5084bfd1b62eb37211d4bcf188e" title="Get the termination tolerance.">DSDPGetGapTolerance</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> *gaptol){ 
<a name="l00133"></a>00133   <span class="keywordtype">int</span> info;
<a name="l00134"></a>00134   ConvergenceMonitor *conv;
<a name="l00135"></a>00135   DSDPFunctionBegin;
<a name="l00136"></a>00136   info=<a class="code" href="dsdp_8h.html#a04dd4c7875c4c1d140093767c1f2a6f2" title="Get the structure containing convergence parameters.">DSDPGetConvergenceMonitor</a>(dsdp,&amp;conv); DSDPCHKERR(info);
<a name="l00137"></a>00137   DSDPFunctionBegin;
<a name="l00138"></a>00138   *gaptol=conv-&gt;rgaptol;
<a name="l00139"></a>00139   DSDPFunctionReturn(0);
<a name="l00140"></a>00140 }
<a name="l00141"></a>00141 
<a name="l00156"></a>00156 <span class="preprocessor">#undef __FUNCT__  </span>
<a name="l00157"></a>00157 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ &quot;DSDPSetPNormTolerance&quot;</span>
<a name="l00158"></a><a class="code" href="group__DSDPConverge.html#ga56d725fd1a7e14c5294cb292c998193e">00158</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPConverge.html#ga56d725fd1a7e14c5294cb292c998193e" title="Terminate the solver when the relative duality gap is suffiently small and the PNorm is less than thi...">DSDPSetPNormTolerance</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> ptol){ 
<a name="l00159"></a>00159   <span class="keywordtype">int</span> info;
<a name="l00160"></a>00160   ConvergenceMonitor *conv;
<a name="l00161"></a>00161   DSDPFunctionBegin;
<a name="l00162"></a>00162   info=<a class="code" href="dsdp_8h.html#a04dd4c7875c4c1d140093767c1f2a6f2" title="Get the structure containing convergence parameters.">DSDPGetConvergenceMonitor</a>(dsdp,&amp;conv); DSDPCHKERR(info);
<a name="l00163"></a>00163   <span class="keywordflow">if</span> (ptol &gt; 0) conv-&gt;pnormtol  = ptol;
<a name="l00164"></a>00164   DSDPLogInfo(0,2,<span class="stringliteral">&quot;Set Relative PNorm Tolerance: %4.4e\n&quot;</span>,ptol);
<a name="l00165"></a>00165   DSDPFunctionReturn(0);
<a name="l00166"></a>00166 }
<a name="l00167"></a>00167 
<a name="l00178"></a>00178 <span class="preprocessor">#undef __FUNCT__  </span>
<a name="l00179"></a>00179 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ &quot;DSDPGetPNormTolerance&quot;</span>
<a name="l00180"></a><a class="code" href="group__DSDPConverge.html#ga437edaa1a3a8fce5e9e4bef9452bc8d8">00180</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPConverge.html#ga437edaa1a3a8fce5e9e4bef9452bc8d8" title="Get the termination tolerance.">DSDPGetPNormTolerance</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> *ptol){ 
<a name="l00181"></a>00181   <span class="keywordtype">int</span> info;
<a name="l00182"></a>00182   ConvergenceMonitor *conv;
<a name="l00183"></a>00183   DSDPFunctionBegin;
<a name="l00184"></a>00184   info=<a class="code" href="dsdp_8h.html#a04dd4c7875c4c1d140093767c1f2a6f2" title="Get the structure containing convergence parameters.">DSDPGetConvergenceMonitor</a>(dsdp,&amp;conv); DSDPCHKERR(info);
<a name="l00185"></a>00185   DSDPFunctionBegin;
<a name="l00186"></a>00186   *ptol=conv-&gt;pnormtol;
<a name="l00187"></a>00187   DSDPFunctionReturn(0);
<a name="l00188"></a>00188 }
<a name="l00189"></a>00189 
<a name="l00203"></a>00203 <span class="preprocessor">#undef __FUNCT__  </span>
<a name="l00204"></a>00204 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ &quot;DSDPSetDualBound&quot;</span>
<a name="l00205"></a><a class="code" href="group__DSDPConverge.html#ga94030b5b04c4ad178282245deb609f78">00205</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPConverge.html#ga94030b5b04c4ad178282245deb609f78" title="Terminate the solver if the objective value in (DD) is greater than this tolerance.">DSDPSetDualBound</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> dbound){ 
<a name="l00206"></a>00206   <span class="keywordtype">int</span> info;
<a name="l00207"></a>00207   ConvergenceMonitor *conv;
<a name="l00208"></a>00208   DSDPFunctionBegin;
<a name="l00209"></a>00209   info=<a class="code" href="dsdp_8h.html#a04dd4c7875c4c1d140093767c1f2a6f2" title="Get the structure containing convergence parameters.">DSDPGetConvergenceMonitor</a>(dsdp,&amp;conv); DSDPCHKERR(info);
<a name="l00210"></a>00210   conv-&gt;dualbound=dbound;
<a name="l00211"></a>00211   DSDPLogInfo(0,2,<span class="stringliteral">&quot;Set DualBound of %4.4e \n&quot;</span>,dbound);
<a name="l00212"></a>00212   DSDPFunctionReturn(0);
<a name="l00213"></a>00213 }
<a name="l00214"></a>00214 
<a name="l00225"></a>00225 <span class="preprocessor">#undef __FUNCT__  </span>
<a name="l00226"></a>00226 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ &quot;DSDPGetDualBound&quot;</span>
<a name="l00227"></a><a class="code" href="group__DSDPConverge.html#gaa84852abdc5e8f4dcef46748f8c7e4d0">00227</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPConverge.html#gaa84852abdc5e8f4dcef46748f8c7e4d0" title="Get the termination parameter.">DSDPGetDualBound</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> *dbound){ 
<a name="l00228"></a>00228   <span class="keywordtype">int</span> info;
<a name="l00229"></a>00229   ConvergenceMonitor *conv;
<a name="l00230"></a>00230   DSDPFunctionBegin;
<a name="l00231"></a>00231   info=<a class="code" href="dsdp_8h.html#a04dd4c7875c4c1d140093767c1f2a6f2" title="Get the structure containing convergence parameters.">DSDPGetConvergenceMonitor</a>(dsdp,&amp;conv); DSDPCHKERR(info);
<a name="l00232"></a>00232   *dbound=conv-&gt;dualbound;
<a name="l00233"></a>00233   DSDPFunctionReturn(0);
<a name="l00234"></a>00234 }
<a name="l00235"></a>00235 
<a name="l00250"></a>00250 <span class="preprocessor">#undef __FUNCT__  </span>
<a name="l00251"></a>00251 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ &quot;DSDPSetStepTolerance&quot;</span>
<a name="l00252"></a><a class="code" href="group__DSDPConverge.html#ga8ae6cff50eca02c3452fa92ae0fea2ec">00252</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPConverge.html#ga8ae6cff50eca02c3452fa92ae0fea2ec" title="Terminate the solver if the step length in (DD) is below this tolerance.">DSDPSetStepTolerance</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> steptol){ 
<a name="l00253"></a>00253   <span class="keywordtype">int</span> info;
<a name="l00254"></a>00254   ConvergenceMonitor *conv;
<a name="l00255"></a>00255   DSDPFunctionBegin;
<a name="l00256"></a>00256   info=<a class="code" href="dsdp_8h.html#a04dd4c7875c4c1d140093767c1f2a6f2" title="Get the structure containing convergence parameters.">DSDPGetConvergenceMonitor</a>(dsdp,&amp;conv); DSDPCHKERR(info);
<a name="l00257"></a>00257   <span class="keywordflow">if</span> (steptol &gt; 0) conv-&gt;steptol   = steptol;
<a name="l00258"></a>00258   DSDPFunctionReturn(0);
<a name="l00259"></a>00259 }
<a name="l00260"></a>00260 
<a name="l00271"></a>00271 <span class="preprocessor">#undef __FUNCT__  </span>
<a name="l00272"></a>00272 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ &quot;DSDPGetStepTolerance&quot;</span>
<a name="l00273"></a><a class="code" href="group__DSDPConverge.html#gabbef47d1ecf58ee77ac463168aa14afb">00273</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPConverge.html#gabbef47d1ecf58ee77ac463168aa14afb" title="Get the current tolerance.">DSDPGetStepTolerance</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> *steptol){ 
<a name="l00274"></a>00274   <span class="keywordtype">int</span> info;
<a name="l00275"></a>00275   ConvergenceMonitor *conv;
<a name="l00276"></a>00276   DSDPFunctionBegin;
<a name="l00277"></a>00277   info=<a class="code" href="dsdp_8h.html#a04dd4c7875c4c1d140093767c1f2a6f2" title="Get the structure containing convergence parameters.">DSDPGetConvergenceMonitor</a>(dsdp,&amp;conv); DSDPCHKERR(info);
<a name="l00278"></a>00278   *steptol=conv-&gt;steptol;
<a name="l00279"></a>00279   DSDPFunctionReturn(0);
<a name="l00280"></a>00280 }
<a name="l00281"></a>00281 
<a name="l00296"></a>00296 <span class="preprocessor">#undef __FUNCT__  </span>
<a name="l00297"></a>00297 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ &quot;DSDPGetRHistory&quot;</span>
<a name="l00298"></a><a class="code" href="group__DSDPConverge.html#ga00cf375a40281f6f8a1b9bdfee7a6ff1">00298</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPConverge.html#ga00cf375a40281f6f8a1b9bdfee7a6ff1" title="Copy a history of the infeasibility in (D) into an array.">DSDPGetRHistory</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">double</span> hist[], <span class="keywordtype">int</span> length){ 
<a name="l00299"></a>00299   <span class="keywordtype">int</span> i,info;
<a name="l00300"></a>00300   ConvergenceMonitor *conv;
<a name="l00301"></a>00301   DSDPFunctionBegin;
<a name="l00302"></a>00302   info=<a class="code" href="dsdp_8h.html#a04dd4c7875c4c1d140093767c1f2a6f2" title="Get the structure containing convergence parameters.">DSDPGetConvergenceMonitor</a>(dsdp,&amp;conv); DSDPCHKERR(info);
<a name="l00303"></a>00303   <span class="keywordflow">for</span> (i=0;i&lt;length;i++) hist[i]=0.0;
<a name="l00304"></a>00304   <span class="keywordflow">for</span> (i=0;i&lt;DSDPMin(length,DSDPHistory);i++) hist[i]=conv-&gt;infhist[i];
<a name="l00305"></a>00305   DSDPFunctionReturn(0);
<a name="l00306"></a>00306 }
<a name="l00307"></a>00307 
<a name="l00319"></a>00319 <span class="preprocessor">#undef __FUNCT__  </span>
<a name="l00320"></a>00320 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ &quot;DSDPGetGapHistory&quot;</span>
<a name="l00321"></a><a class="code" href="group__DSDPConverge.html#ga7c5018d2263675ce962dedc787155ed1">00321</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPConverge.html#ga7c5018d2263675ce962dedc787155ed1" title="Copy a history of the duality gap into an array.">DSDPGetGapHistory</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">double</span> hist[], <span class="keywordtype">int</span> length){ 
<a name="l00322"></a>00322   <span class="keywordtype">int</span> i,info;
<a name="l00323"></a>00323   ConvergenceMonitor *conv;
<a name="l00324"></a>00324   DSDPFunctionBegin;
<a name="l00325"></a>00325   info=<a class="code" href="dsdp_8h.html#a04dd4c7875c4c1d140093767c1f2a6f2" title="Get the structure containing convergence parameters.">DSDPGetConvergenceMonitor</a>(dsdp,&amp;conv); DSDPCHKERR(info);
<a name="l00326"></a>00326   <span class="keywordflow">for</span> (i=0;i&lt;length;i++) hist[i]=0.0;
<a name="l00327"></a>00327   <span class="keywordflow">for</span> (i=0;i&lt;DSDPMin(length,DSDPHistory);i++) hist[i]=conv-&gt;gaphist[i];
<a name="l00328"></a>00328   DSDPFunctionReturn(0);
<a name="l00329"></a>00329 }
<a name="l00330"></a>00330 
</pre></div></div>
</div>
<hr class="footer"/><address class="footer"><small>Generated on Wed Jun 8 2011 for DSDP by&#160;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address>
</body>
</html>