Sophie

Sophie

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

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/dsdpsetoptions.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">dsdpsetoptions.c</div>  </div>
</div>
<div class="contents">
<a href="dsdpsetoptions_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="l00006"></a>00006 <span class="comment">/*</span>
<a name="l00007"></a>00007 <span class="comment"> static char[] ZGAPTOL=&quot;-gaptol&quot;;</span>
<a name="l00008"></a>00008 <span class="comment"> static char[] ZPRINT=&quot;-print&quot;;</span>
<a name="l00009"></a>00009 <span class="comment"> static char[] ZPENALTY=&quot;-penalty&quot;;</span>
<a name="l00010"></a>00010 <span class="comment"> static char[] ZBIGM=&quot;-bigM&quot;;</span>
<a name="l00011"></a>00011 <span class="comment"> static char[] ZMAXIT=&quot;-maxit&quot;;</span>
<a name="l00012"></a>00012 <span class="comment"> static char[] ZR0=&quot;-r0&quot;;</span>
<a name="l00013"></a>00013 <span class="comment"> static char[] ZZBAR=&quot;-zbar&quot;;</span>
<a name="l00014"></a>00014 <span class="comment"> static char[] ZINFDTOL=&quot;-infdtol&quot;;</span>
<a name="l00015"></a>00015 <span class="comment"> static char[] ZINFPTOL=&quot;-infptol&quot;;</span>
<a name="l00016"></a>00016 <span class="comment"> static char[] ZRHO=&quot;-rho&quot;;</span>
<a name="l00017"></a>00017 <span class="comment"> static char[] ZDRHO=&quot;-drho&quot;;</span>
<a name="l00018"></a>00018 <span class="comment"> static char[] ZBOUNDY=&quot;-boundy&quot;;</span>
<a name="l00019"></a>00019 <span class="comment"> static char[] ZSTEPTOL=&quot;-steptol&quot;;</span>
<a name="l00020"></a>00020 <span class="comment"> static char[] ZREUSE=&quot;-reuse&quot;;</span>
<a name="l00021"></a>00021 <span class="comment"> static char[] ADADD=&quot;-dadd&quot;;</span>
<a name="l00022"></a>00022 <span class="comment"> static char[] ZDBOUND=&quot;-dbound&quot;;</span>
<a name="l00023"></a>00023 <span class="comment"> static char[] ZMU0=&quot;-mu0&quot;;</span>
<a name="l00024"></a>00024 <span class="comment"> static char[] DOBJMIN=&quot;-dobjmin&quot;;</span>
<a name="l00025"></a>00025 <span class="comment">*/</span>
<a name="l00026"></a>00026 
<a name="l00044"></a>00044 <span class="preprocessor">#undef __FUNCT__</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ &quot;DSDPSetOptions&quot;</span>
<a name="l00046"></a><a class="code" href="group__DSDPBasic.html#ga5f1941aaedfa888e940bad968ac0d847">00046</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPBasic.html#ga5f1941aaedfa888e940bad968ac0d847" title="Read command line arguments to set options in DSDP.">DSDPSetOptions</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">char</span> *runargs[],<span class="keywordtype">int</span> nargs){
<a name="l00047"></a>00047 
<a name="l00048"></a>00048   <span class="keywordtype">int</span> kk, info,reuse;
<a name="l00049"></a>00049   <span class="keywordtype">int</span> maxit,rpos,drho,iloginfo;
<a name="l00050"></a>00050   <span class="keywordtype">double</span> penalty,rho,zbar,cc,r0,mu0,gaptol,dbound,dd;
<a name="l00051"></a>00051   <span class="keywordtype">double</span> ylow,yhigh,maxtrust,steptol,inftol,infptol,pnormtol;
<a name="l00052"></a>00052 
<a name="l00053"></a>00053   DSDPFunctionBegin;
<a name="l00054"></a>00054 
<a name="l00055"></a>00055   <span class="keywordflow">for</span> (kk=0; kk&lt;nargs-1; kk++){
<a name="l00056"></a>00056     <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-gaptol&quot;</span>,5)==0){
<a name="l00057"></a>00057       gaptol=atof(runargs[kk+1]);
<a name="l00058"></a>00058       info=<a class="code" href="group__DSDPConverge.html#ga4c0fa6941c40cca7643c2f4a9ae813bf" title="Terminate the solver when the relative duality gap is less than this tolerance.">DSDPSetGapTolerance</a>(dsdp,gaptol);DSDPCHKERR(info);
<a name="l00059"></a>00059     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-penalty&quot;</span>,7)==0){
<a name="l00060"></a>00060       penalty=atof(runargs[kk+1]);
<a name="l00061"></a>00061       info=<a class="code" href="group__DSDPSolver.html#gaaccdf7c94e0296bc83042ba3d4b29c5d" title="Set the penalty parameter Gamma.">DSDPSetPenaltyParameter</a>(dsdp,penalty); DSDPCHKERR(info);
<a name="l00062"></a>00062     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-bigM&quot;</span>,5)==0){
<a name="l00063"></a>00063       rpos=atoi(runargs[kk+1]);
<a name="l00064"></a>00064       info=<a class="code" href="group__DSDPSolver.html#ga0e47c4779c3d4a036e258a5b4aa890b3" title="Use penalty parameter to enforce feasibility.">DSDPUsePenalty</a>(dsdp,rpos); DSDPCHKERR(info);
<a name="l00065"></a>00065     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-maxit&quot;</span>,6)==0){
<a name="l00066"></a>00066       maxit=atoi(runargs[kk+1]);
<a name="l00067"></a>00067       info=<a class="code" href="group__DSDPConverge.html#ga91af478f9316391a35b595b669ad22b3" title="Terminate the solver after this number of iterations.">DSDPSetMaxIts</a>(dsdp,maxit); DSDPCHKERR(info);
<a name="l00068"></a>00068     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-r0&quot;</span>,3)==0){
<a name="l00069"></a>00069       r0=atof(runargs[kk+1]);
<a name="l00070"></a>00070       info=<a class="code" href="group__DSDPSolution.html#ga846e363115b1fba5622306efc2e0ba38" title="Set an initial value for the variable r in (DD)">DSDPSetR0</a>(dsdp,r0); DSDPCHKERR(info);
<a name="l00071"></a>00071     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-zbar&quot;</span>,5)==0){
<a name="l00072"></a>00072       zbar=atof(runargs[kk+1]);
<a name="l00073"></a>00073       info=<a class="code" href="group__DSDPSolver.html#ga2795069b8aaa6551a8c1c248bbb2cb1a" title="Set an upper bound on the objective value at the solution.">DSDPSetZBar</a>(dsdp,zbar);DSDPCHKERR(info);
<a name="l00074"></a>00074     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-infdtol&quot;</span>,7)==0){
<a name="l00075"></a>00075       inftol=atof(runargs[kk+1]);
<a name="l00076"></a>00076       info=<a class="code" href="group__DSDPConverge.html#ga8fa9a4a362aaa64e12538a55f215e8ce" title="Classify (D) as feasible only if the variable r is less than this tolerance.">DSDPSetRTolerance</a>(dsdp,inftol);DSDPCHKERR(info);
<a name="l00077"></a>00077     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-infptol&quot;</span>,7)==0){
<a name="l00078"></a>00078       infptol=atof(runargs[kk+1]);
<a name="l00079"></a>00079       info=<a class="code" href="group__DSDPConverge.html#gad0a3f0df89bd8b3e4b7fb1f6c738d330" title="Classify (P) as feasible only if the infeasibility is less than this tolerance.">DSDPSetPTolerance</a>(dsdp,infptol);DSDPCHKERR(info);
<a name="l00080"></a>00080     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-rho&quot;</span>,4)==0){
<a name="l00081"></a>00081       rho=atof(runargs[kk+1]);
<a name="l00082"></a>00082       info=<a class="code" href="group__DSDPSolver.html#ga5d737fca8ae872f57fd37cc7784feede" title="Set the potential parameter.">DSDPSetPotentialParameter</a>(dsdp,rho); DSDPCHKERR(info);
<a name="l00083"></a>00083     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-drho&quot;</span>,5)==0){
<a name="l00084"></a>00084       drho=atoi(runargs[kk+1]);
<a name="l00085"></a>00085       info=<a class="code" href="group__DSDPSolver.html#gae48a2eaf3ee6a982cb0c45d512216702" title="Use a dynamic strategy to choose parameter rho.">DSDPUseDynamicRho</a>(dsdp,drho);DSDPCHKERR(info);
<a name="l00086"></a>00086     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-mu0&quot;</span>,4)==0){
<a name="l00087"></a>00087       mu0=atof(runargs[kk+1]);
<a name="l00088"></a>00088       info=<a class="code" href="group__DSDPSolver.html#ga4bcfff950e84b1e925ae99202f23282a" title="Set the current barrier parameter.">DSDPSetBarrierParameter</a>(dsdp,mu0);DSDPCHKERR(info);
<a name="l00089"></a>00089     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-maxtrustradius&quot;</span>,7)==0){
<a name="l00090"></a>00090       maxtrust=atof(runargs[kk+1]);
<a name="l00091"></a>00091       info=<a class="code" href="group__DSDPSolver.html#gacc8b2a85ea20d548fcff54f5161bc3d5" title="Set a maximum trust radius on the step direction.">DSDPSetMaxTrustRadius</a>(dsdp,maxtrust); DSDPCHKERR(info);
<a name="l00092"></a>00092     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-boundy&quot;</span>,6)==0){
<a name="l00093"></a>00093       yhigh=fabs(atof(runargs[kk+1]));ylow=-yhigh;
<a name="l00094"></a>00094       info=<a class="code" href="group__DSDPSolver.html#gad73a74d9d294e87b58ad3a7e939a43ad" title="Bound the variables y.">DSDPSetYBounds</a>(dsdp,ylow,yhigh);DSDPCHKERR(info);
<a name="l00095"></a>00095     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-steptol&quot;</span>,7)==0){
<a name="l00096"></a>00096       steptol=fabs(atof(runargs[kk+1]));
<a name="l00097"></a>00097       info=<a class="code" href="group__DSDPConverge.html#ga8ae6cff50eca02c3452fa92ae0fea2ec" title="Terminate the solver if the step length in (DD) is below this tolerance.">DSDPSetStepTolerance</a>(dsdp,steptol); DSDPCHKERR(info);
<a name="l00098"></a>00098     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-pnormtol&quot;</span>,7)==0){
<a name="l00099"></a>00099       pnormtol=fabs(atof(runargs[kk+1]));
<a name="l00100"></a>00100       info=<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>(dsdp,pnormtol); DSDPCHKERR(info);
<a name="l00101"></a>00101     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-reuse&quot;</span>,6)==0){
<a name="l00102"></a>00102       reuse=atoi(runargs[kk+1]);
<a name="l00103"></a>00103       info=<a class="code" href="group__DSDPSolver.html#ga903ff948f2ba766430ba3918b9447ee7" title="Reuse the Hessian of the barrier function multiple times at each DSDP iteration.">DSDPReuseMatrix</a>(dsdp,reuse);DSDPCHKERR(info);
<a name="l00104"></a>00104     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-dadd&quot;</span>,6)==0){
<a name="l00105"></a>00105       cc=atof(runargs[kk+1]);
<a name="l00106"></a>00106       info=<a class="code" href="group__DSDPSolution.html#ga28afa903396794d56ca26eea4b284e85" title="Add a constant to the objective.">DSDPAddObjectiveConstant</a>(dsdp,cc);DSDPCHKERR(info);
<a name="l00107"></a>00107     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-dbound&quot;</span>,6)==0){
<a name="l00108"></a>00108       dbound=atof(runargs[kk+1]);
<a name="l00109"></a>00109       info=<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>(dsdp,dbound);DSDPCHKERR(info);
<a name="l00110"></a>00110     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-fix&quot;</span>,4)==0){
<a name="l00111"></a>00111       info=<a class="code" href="group__DSDPSolver.html#ga4654614850ec5fc42e9350854f560fd1" title="Fix variable y to exact value.">DSDPSetFixedVariable</a>(dsdp,1,atof(runargs[kk+1]));DSDPCHKERR(info);
<a name="l00112"></a>00112     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-dobjmin&quot;</span>,7)==0){
<a name="l00113"></a>00113       dd=atof(runargs[kk+1]);
<a name="l00114"></a>00114       info = DSDPSetDualLowerBound(dsdp,dd);DSDPCHKERR(info);
<a name="l00115"></a>00115     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-dloginfo&quot;</span>,8)==0){
<a name="l00116"></a>00116       iloginfo=atoi(runargs[kk+1]);
<a name="l00117"></a>00117       info=DSDPLogInfoAllow(iloginfo,0);
<a name="l00118"></a>00118     }
<a name="l00119"></a>00119   }
<a name="l00120"></a>00120 
<a name="l00121"></a>00121   <span class="keywordflow">for</span> (kk=0; kk&lt;nargs; kk++){
<a name="l00122"></a>00122     <span class="keywordflow">if</span> (0){
<a name="l00123"></a>00123     } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (strncmp(runargs[kk],<span class="stringliteral">&quot;-help&quot;</span>,5)==0){
<a name="l00124"></a>00124       info=<a class="code" href="group__DSDPSolver.html#gac2a0ebe706b56fd4cf7f9f8b3d205efe" title="Print runtime options;.">DSDPPrintOptions</a>();
<a name="l00125"></a>00125     }
<a name="l00126"></a>00126   }
<a name="l00127"></a>00127   DSDPFunctionReturn(0);
<a name="l00128"></a>00128 }
<a name="l00129"></a>00129 
<a name="l00140"></a>00140 <span class="preprocessor">#define MAXOPTIONS 40</span>
<a name="l00141"></a>00141 <span class="preprocessor"></span><span class="preprocessor">#define STRLENGTH  40</span>
<a name="l00142"></a>00142 <span class="preprocessor"></span><span class="preprocessor">#define BUFFERSIZ 100</span>
<a name="l00143"></a>00143 <span class="preprocessor"></span><span class="preprocessor">#undef __FUNCT__</span>
<a name="l00144"></a>00144 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ &quot;DSDPReadOptions&quot;</span>
<a name="l00145"></a><a class="code" href="group__DSDPSolver.html#gab1340aac2a0c79108be725389f481979">00145</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#gab1340aac2a0c79108be725389f481979" title="Read DSDP parameters from a file.">DSDPReadOptions</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">char</span> filename[]){
<a name="l00146"></a>00146 
<a name="l00147"></a>00147   <span class="keywordtype">int</span> i,info,line=0;
<a name="l00148"></a>00148   <span class="keywordtype">char</span> thisline[BUFFERSIZ]=<span class="stringliteral">&quot;%&quot;</span>,doption[STRLENGTH],dvalue[STRLENGTH];
<a name="l00149"></a>00149   <span class="keywordtype">char</span> fargs[2*MAXOPTIONS][STRLENGTH];
<a name="l00150"></a>00150   <span class="keywordtype">char</span> *fargs2[2*MAXOPTIONS];
<a name="l00151"></a>00151   FILE *fp;
<a name="l00152"></a>00152 
<a name="l00153"></a>00153   DSDPFunctionBegin;
<a name="l00154"></a>00154 
<a name="l00155"></a>00155   <span class="keywordflow">for</span> (i=0;i&lt;2*MAXOPTIONS;i++){fargs2[i]=fargs[i];}
<a name="l00156"></a>00156   
<a name="l00157"></a>00157   fp=fopen(filename,<span class="stringliteral">&quot;r&quot;</span>);
<a name="l00158"></a>00158   <span class="keywordflow">if</span> (fp){
<a name="l00159"></a>00159     <span class="keywordflow">while</span>(!feof(fp) ){
<a name="l00160"></a>00160       <span class="keywordflow">if</span> (line&gt;=MAXOPTIONS) <span class="keywordflow">break</span>;
<a name="l00161"></a>00161       fgets(thisline,BUFFERSIZ,fp);
<a name="l00162"></a>00162       <span class="keywordflow">if</span> (sscanf(thisline,<span class="stringliteral">&quot;%s %s&quot;</span>,doption,dvalue)&gt;=2){
<a name="l00163"></a>00163         <span class="keywordflow">if</span> (doption[0]!=<span class="charliteral">&#39;%&#39;</span>){
<a name="l00164"></a>00164           strncpy(fargs[2*line],doption,STRLENGTH-1);
<a name="l00165"></a>00165           strncpy(fargs[2*line+1],dvalue,STRLENGTH-1);
<a name="l00166"></a>00166           line++;
<a name="l00167"></a>00167         }
<a name="l00168"></a>00168       }
<a name="l00169"></a>00169       thisline[0]=<span class="charliteral">&#39;%&#39;</span>;
<a name="l00170"></a>00170     }
<a name="l00171"></a>00171     
<a name="l00172"></a>00172     info=<a class="code" href="group__DSDPBasic.html#ga5f1941aaedfa888e940bad968ac0d847" title="Read command line arguments to set options in DSDP.">DSDPSetOptions</a>(dsdp,fargs2,2*line);    
<a name="l00173"></a>00173     fclose(fp);
<a name="l00174"></a>00174   }
<a name="l00175"></a>00175   DSDPFunctionReturn(0);
<a name="l00176"></a>00176 }
<a name="l00177"></a>00177 
<a name="l00188"></a>00188 <span class="preprocessor">#undef __FUNCT__</span>
<a name="l00189"></a>00189 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ &quot;DSDPView&quot;</span>
<a name="l00190"></a><a class="code" href="group__DSDPBasic.html#ga79dacb16d2807f1b6819d296e3073aa5">00190</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPBasic.html#ga79dacb16d2807f1b6819d296e3073aa5" title="Print many of the parameters currently set in DSDP.">DSDPView</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp){
<a name="l00191"></a>00191 
<a name="l00192"></a>00192   <span class="keywordtype">int</span> info,reuse,m,maxit;
<a name="l00193"></a>00193   <span class="keywordtype">double</span> penalty,rho,mu0,gaptol,dnorm[3],derror[6],potential,ymax;
<a name="l00194"></a>00194   <span class="keywordtype">double</span> ylow,yhigh,maxtrust,steptol,inftol,infptol,pnormtol,dbound,tracex;
<a name="l00195"></a>00195   <a class="code" href="dsdpbasictypes_8h.html#a7c124046b4ddae3d637157242af2df90" title="Formulations (P) and (D) can be feasible and bounded, feasible and unbounded, or infeasible.">DSDPSolutionType</a> pdfeasible;
<a name="l00196"></a>00196 
<a name="l00197"></a>00197   DSDPFunctionBegin;
<a name="l00198"></a>00198   info=<a class="code" href="group__DSDPConverge.html#gac98359685ab5aad73ed95e335fcb21ab" title="Copy the maximum number of iterations from the solver.">DSDPGetMaxIts</a>(dsdp,&amp;maxit); DSDPCHKERR(info);
<a name="l00199"></a>00199   printf(<span class="stringliteral">&quot;Terminate DSDP after %d iterations.\n&quot;</span>,maxit);
<a name="l00200"></a>00200   info=<a class="code" href="group__DSDPConverge.html#gaa84852abdc5e8f4dcef46748f8c7e4d0" title="Get the termination parameter.">DSDPGetDualBound</a>(dsdp,&amp;dbound); DSDPCHKERR(info);
<a name="l00201"></a>00201   printf(<span class="stringliteral">&quot;Terminate DSDP if dual objective is greater than %8.4e\n&quot;</span>,dbound);
<a name="l00202"></a>00202   info=<a class="code" href="group__DSDPConverge.html#ga876bd5084bfd1b62eb37211d4bcf188e" title="Get the termination tolerance.">DSDPGetGapTolerance</a>(dsdp,&amp;gaptol);DSDPCHKERR(info);
<a name="l00203"></a>00203   printf(<span class="stringliteral">&quot;Terminate DSDP if the relative duality gap is less than %8.4e\n&quot;</span>,gaptol);
<a name="l00204"></a>00204   info=<a class="code" href="group__DSDPConverge.html#gabbef47d1ecf58ee77ac463168aa14afb" title="Get the current tolerance.">DSDPGetStepTolerance</a>(dsdp,&amp;steptol); DSDPCHKERR(info);
<a name="l00205"></a>00205   printf(<span class="stringliteral">&quot;Terminate DSDP if step length in D less than %8.4e\n&quot;</span>,steptol);
<a name="l00206"></a>00206   info=<a class="code" href="group__DSDPConverge.html#ga437edaa1a3a8fce5e9e4bef9452bc8d8" title="Get the termination tolerance.">DSDPGetPNormTolerance</a>(dsdp,&amp;pnormtol); DSDPCHKERR(info);
<a name="l00207"></a>00207   printf(<span class="stringliteral">&quot;Terminate DSDP only if Pnorm less than %8.4e\n&quot;</span>,pnormtol);
<a name="l00208"></a>00208   info=<a class="code" href="group__DSDPSolver.html#ga8fe5ad8ed4d88f70fc9e33a39460d594" title="Copy the current radius of the trust region.">DSDPGetMaxTrustRadius</a>(dsdp,&amp;maxtrust); DSDPCHKERR(info);
<a name="l00209"></a>00209   printf(<span class="stringliteral">&quot;Max Trust Radius is %8.4e\n&quot;</span>,maxtrust); 
<a name="l00210"></a>00210   info=<a class="code" href="group__DSDPSolver.html#gaf45e1f4f8329adb347b476d183d35885" title="Copy this parameter.">DSDPGetReuseMatrix</a>(dsdp,&amp;reuse);DSDPCHKERR(info);
<a name="l00211"></a>00211   printf(<span class="stringliteral">&quot;Reapply Hessian of Barrier up to %d times per iteration.\n&quot;</span>,reuse);
<a name="l00212"></a>00212 
<a name="l00213"></a>00213   info=<a class="code" href="group__DSDPSolution.html#gae103a4b863adc10f37d2eda9f94a982b" title="Copy the norms of the data C, A, and b into an array.">DSDPGetDataNorms</a>(dsdp,dnorm);DSDPCHKERR(info);
<a name="l00214"></a>00214   printf(<span class="stringliteral">&quot;The norms of C: %8.4e, A: %4.4e, and b: %8.4e\n&quot;</span>,dnorm[0],dnorm[1],dnorm[2]);
<a name="l00215"></a>00215   info=<a class="code" href="group__DSDPSolution.html#gae212bb3666f5c021f9d310a49438e94b" title="Copy the number of variables y.">DSDPGetNumberOfVariables</a>(dsdp,&amp;m);DSDPCHKERR(info);
<a name="l00216"></a>00216   printf(<span class="stringliteral">&quot;There are %d y variables:  &quot;</span>,m);
<a name="l00217"></a>00217   info=<a class="code" href="group__DSDPSolution.html#ga1a3be937e209108fe9acd088508feb95" title="Copy the the infinity norm of the variables y.">DSDPGetYMaxNorm</a>(dsdp,&amp;ymax); DSDPCHKERR(info);
<a name="l00218"></a>00218   printf(<span class="stringliteral">&quot;largest is %8.4e, &quot;</span>,ymax);
<a name="l00219"></a>00219   info=<a class="code" href="group__DSDPSolver.html#gaeb2f494ff50c552de67a02bf68f7b47e" title="Copy the bounds on the variables y.">DSDPGetYBounds</a>(dsdp,&amp;ylow,&amp;yhigh);DSDPCHKERR(info);
<a name="l00220"></a>00220   printf(<span class="stringliteral">&quot;bounded below by %8.4e and above by %8.4e. \n&quot;</span>,ylow,yhigh);
<a name="l00221"></a>00221   info=<a class="code" href="group__DSDPSolution.html#ga2580bcdac912b6477f067a8ccbc801bc" title="Copy the trace of the variables X in (P).">DSDPGetTraceX</a>(dsdp,&amp;tracex);DSDPCHKERR(info);
<a name="l00222"></a>00222   printf(<span class="stringliteral">&quot;The X variables have a trace of %8.4e &quot;</span>,tracex);
<a name="l00223"></a>00223   info=<a class="code" href="group__DSDPSolver.html#gae27461735f62031b5fd794672b026b78" title="Copy the penalty parameter Gamma.">DSDPGetPenaltyParameter</a>(dsdp,&amp;penalty); DSDPCHKERR(info);
<a name="l00224"></a>00224   printf(<span class="stringliteral">&quot;bounded by penalty parameter: %8.4e\n&quot;</span>,penalty);
<a name="l00225"></a>00225   info=<a class="code" href="group__DSDPSolver.html#ga05f1269e817495e448ffa8ae3a4012cf" title="Copy the current barrier parameter.">DSDPGetBarrierParameter</a>(dsdp,&amp;mu0);DSDPCHKERR(info);
<a name="l00226"></a>00226   printf(<span class="stringliteral">&quot;Current Barrier Parameter: %8.4e\n&quot;</span>,mu0);
<a name="l00227"></a>00227   info=<a class="code" href="group__DSDPSolver.html#ga0cc2e91620e27338d0a508d60f8761ce" title="Copy the potential parameter.">DSDPGetPotentialParameter</a>(dsdp,&amp;rho); DSDPCHKERR(info);
<a name="l00228"></a>00228   printf(<span class="stringliteral">&quot;Potential Parameter: %8.4e ( times dimension) \n&quot;</span>,rho);
<a name="l00229"></a>00229   info=<a class="code" href="group__DSDPSolution.html#gaed464f68b994d51bf107e08c37ad9c1d" title="Copy the potential of the current solution.">DSDPGetPotential</a>(dsdp,&amp;potential);DSDPCHKERR(info);
<a name="l00230"></a>00230   printf(<span class="stringliteral">&quot;The value of the potential function is %8.4e\n&quot;</span>,potential);
<a name="l00231"></a>00231   info=<a class="code" href="group__DSDPConverge.html#ga48cc08979850c048b38d7f1fd423deec" title="Copy the maximum infeasibility allowed (D).">DSDPGetRTolerance</a>(dsdp,&amp;inftol); DSDPCHKERR(info);
<a name="l00232"></a>00232   printf(<span class="stringliteral">&quot;(D) Feasible only if R &lt; %8.4e\n&quot;</span>,inftol);
<a name="l00233"></a>00233   info=<a class="code" href="group__DSDPConverge.html#ga8c3bf97d823880a151321f7c7c43aaf8" title="Copy the feasibility tolerance.">DSDPGetPTolerance</a>(dsdp,&amp;infptol); DSDPCHKERR(info);
<a name="l00234"></a>00234   printf(<span class="stringliteral">&quot;(P) Feasible only if Pinfeas &lt; %8.4e\n&quot;</span>,infptol);
<a name="l00235"></a>00235   info=<a class="code" href="group__DSDPBasic.html#ga33e05559ab15ea40b1e9b31ecc206b3e" title="Solutions can be bounded, infeasible, or unbounded.">DSDPGetSolutionType</a>(dsdp,&amp;pdfeasible);DSDPCHKERR(info);
<a name="l00236"></a>00236   <span class="keywordflow">if</span> (pdfeasible==<a class="code" href="dsdpbasictypes_8h.html#a7c124046b4ddae3d637157242af2df90a6ebc36bcf5037f059ae5e9014e76cee0">DSDP_PDFEASIBLE</a>){
<a name="l00237"></a>00237     printf(<span class="stringliteral">&quot; DSDP Solutions are both feasible and bounded\n&quot;</span>);
<a name="l00238"></a>00238   } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pdfeasible==<a class="code" href="dsdpbasictypes_8h.html#a7c124046b4ddae3d637157242af2df90a0008f194b20fc02f61eca61fab25ed05">DSDP_UNBOUNDED</a>){
<a name="l00239"></a>00239     printf(<span class="stringliteral">&quot; (D) is unbounded and (P) is infeasible\n&quot;</span>);
<a name="l00240"></a>00240   } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pdfeasible==<a class="code" href="dsdpbasictypes_8h.html#a7c124046b4ddae3d637157242af2df90abb5750f090ec5d7e1d8c1aead6565a52">DSDP_INFEASIBLE</a>){
<a name="l00241"></a>00241     printf(<span class="stringliteral">&quot; (D) is infeasible and (D) is unbounded\n&quot;</span>);
<a name="l00242"></a>00242   } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pdfeasible==<a class="code" href="dsdpbasictypes_8h.html#a7c124046b4ddae3d637157242af2df90a7dfad20f823f952f1442144a8fa5c208">DSDP_PDUNKNOWN</a>){
<a name="l00243"></a>00243     printf(<span class="stringliteral">&quot; Hmm.  Not clear whether either solution is feasible.\n&quot;</span>);
<a name="l00244"></a>00244   }
<a name="l00245"></a>00245   info=<a class="code" href="group__DSDPSolution.html#ga563ea95890673182c1de4252cf3e5309" title="Copy six different error measurements into an array.">DSDPGetFinalErrors</a>(dsdp,derror);DSDPCHKERR(info);
<a name="l00246"></a>00246   printf(<span class="stringliteral">&quot;The errors: %8.4e, %4.4e, %8.4e, &quot;</span>,derror[0],derror[1],derror[2]);
<a name="l00247"></a>00247   printf(<span class="stringliteral">&quot;%8.4e, %4.4e, %8.4e\n&quot;</span>,derror[3],derror[4],derror[5]);
<a name="l00248"></a>00248   DSDPFunctionReturn(0);
<a name="l00249"></a>00249 }
<a name="l00250"></a>00250 
<a name="l00251"></a>00251 
<a name="l00252"></a>00252 <span class="keyword">static</span> <span class="keywordtype">char</span> dsdpoptions[]=<span class="stringliteral">&quot;\</span>
<a name="l00253"></a>00253 <span class="stringliteral">                  -gaptol &lt;1e-6&gt; stop when relative duality gap less than  \n\</span>
<a name="l00254"></a>00254 <span class="stringliteral">                  -r0 &lt;-1&gt; if nonnegative, initialize S by adding this multiple of the identity matrix \n\</span>
<a name="l00255"></a>00255 <span class="stringliteral">                  -penalty &lt;1e10&gt;&lt; penalize dual infeasibility \n\</span>
<a name="l00256"></a>00256 <span class="stringliteral">                  -boundy &lt;1e7&gt; bound for variables y \n\</span>
<a name="l00257"></a>00257 <span class="stringliteral">                  -maxit &lt;200&gt; set maximum iterates \n\</span>
<a name="l00258"></a>00258 <span class="stringliteral">                  -zbar &lt;1e10&gt; Upper bound for dual solution \n\</span>
<a name="l00259"></a>00259 <span class="stringliteral">                  -mu0 &lt;-1&gt; if positive, set initial barrier parameter \n\</span>
<a name="l00260"></a>00260 <span class="stringliteral">                  -rho &lt;3&gt; Potential parameter as multiple of dimension \n\</span>
<a name="l00261"></a>00261 <span class="stringliteral">                  -drho &lt;1&gt; Use dynamic rho strategy \n\</span>
<a name="l00262"></a>00262 <span class="stringliteral">                  -pnormtol &lt;1e30&gt; stop only if pnorm less than \n\</span>
<a name="l00263"></a>00263 <span class="stringliteral">                  -reuse &lt;4&gt; Reuse the Schur Matrix this many times\n\</span>
<a name="l00264"></a>00264 <span class="stringliteral">                  -dobjmin &lt;&gt; apply a known lower bound for the objective at solution as a constraint. \n\</span>
<a name="l00265"></a>00265 <span class="stringliteral">                  -bigM &lt;0&gt; if positive, modify algorithm to make dual \n\</span>
<a name="l00266"></a>00266 <span class="stringliteral">                     infeasibility positive with a large associated cost \n\</span>
<a name="l00267"></a>00267 <span class="stringliteral">                  -dloginfo &lt;0&gt; - print more information for higher numbers \n\</span>
<a name="l00268"></a>00268 <span class="stringliteral">                  -params &lt;filename&gt; to read selected options from a file \n\</span>
<a name="l00269"></a>00269 <span class="stringliteral">                  -help  for this help message\n&quot;</span>;
<a name="l00270"></a>00270 
<a name="l00279"></a><a class="code" href="group__DSDPSolver.html#gac2a0ebe706b56fd4cf7f9f8b3d205efe">00279</a> <span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#gac2a0ebe706b56fd4cf7f9f8b3d205efe" title="Print runtime options;.">DSDPPrintOptions</a>(){
<a name="l00280"></a>00280   DSDPFunctionBegin;
<a name="l00281"></a>00281   printf(<span class="stringliteral">&quot;%s&quot;</span>,dsdpoptions); 
<a name="l00282"></a>00282   DSDPFunctionReturn(0);
<a name="l00283"></a>00283 }
</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>