<!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/dsdpsetdata.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 Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="modules.html"><span>Modules</span></a></li> <li><a href="annotated.html"><span>Data 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 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">dsdpsetdata.c</div> </div> </div> <div class="contents"> <a href="dsdpsetdata_8c.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00006"></a>00006 <span class="preprocessor">#include "<a class="code" href="dsdp_8h.html" title="Internal data structure for the DSDP solver.">dsdp.h</a>"</span> <a name="l00007"></a>00007 <span class="preprocessor">#include "<a class="code" href="dsdp5_8h.html" title="The API to DSDP for those applications using DSDP as a subroutine library.">dsdp5.h</a>"</span> <a name="l00008"></a>00008 <span class="preprocessor">#include "<a class="code" href="dsdpsys_8h.html" title="Error handling, printing, and profiling.">dsdpsys.h</a>"</span> <a name="l00009"></a>00009 <a name="l00023"></a>00023 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPSetDualObjective"</span> <a name="l00025"></a><a class="code" href="group__DSDPBasic.html#ga7e1b78dc7d7407fcf84e05b9c42fc72c">00025</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPBasic.html#ga7e1b78dc7d7407fcf84e05b9c42fc72c" title="Set the objective vector b in (D).">DSDPSetDualObjective</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">int</span> i, <span class="keywordtype">double</span> bi){ <a name="l00026"></a>00026 <span class="keywordtype">int</span> info; <a name="l00027"></a>00027 DSDPFunctionBegin; <a name="l00028"></a>00028 DSDPValid(dsdp); <a name="l00029"></a>00029 <span class="keywordflow">if</span> (i>dsdp->m || i<=0){ <a name="l00030"></a>00030 DSDPSETERR2(1,<span class="stringliteral">"Invalid variable number: Is 1 <= %d <= %d?\n"</span>,i,dsdp->m);} <a name="l00031"></a>00031 info=DSDPVecSetElement(dsdp->b,i,bi);DSDPCHKERR(info); <a name="l00032"></a>00032 DSDPFunctionReturn(0); <a name="l00033"></a>00033 } <a name="l00034"></a>00034 <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__ "DSDPCopyB"</span> <a name="l00046"></a><a class="code" href="group__DSDPSolution.html#gace8935e125caba22d3f4d28b045dadb6">00046</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolution.html#gace8935e125caba22d3f4d28b045dadb6" title="Copies the variables b from solver into an array.">DSDPCopyB</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> bb[], <span class="keywordtype">int</span> m){ <a name="l00047"></a>00047 <span class="keywordtype">int</span> i,info; <a name="l00048"></a>00048 <span class="keywordtype">double</span> *b; <a name="l00049"></a>00049 DSDPFunctionBegin; <a name="l00050"></a>00050 DSDPValid(dsdp); <a name="l00051"></a>00051 <span class="keywordflow">if</span> (dsdp->m < m) DSDPFunctionReturn(1); <a name="l00052"></a>00052 info=DSDPVecGetArray(dsdp->b,&b);DSDPCHKERR(info); <a name="l00053"></a>00053 <span class="keywordflow">for</span> (i=0;i<m;i++) bb[i]=b[i+1]; <a name="l00054"></a>00054 info=DSDPVecRestoreArray(dsdp->b,&b);DSDPCHKERR(info); <a name="l00055"></a>00055 DSDPFunctionReturn(0); <a name="l00056"></a>00056 } <a name="l00057"></a>00057 <a name="l00058"></a>00058 <a name="l00075"></a>00075 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00076"></a>00076 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPSetY0"</span> <a name="l00077"></a><a class="code" href="group__DSDPSolution.html#gacf5a2bd7ecb03b319caa22e545ef8e01">00077</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolution.html#gacf5a2bd7ecb03b319caa22e545ef8e01" title="Set the initial values of variables y in (D).">DSDPSetY0</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">int</span> i, <span class="keywordtype">double</span> yi0){ <a name="l00078"></a>00078 <span class="keywordtype">int</span> info;<span class="keywordtype">double</span> scale; <a name="l00079"></a>00079 DSDPFunctionBegin; <a name="l00080"></a>00080 DSDPValid(dsdp); <a name="l00081"></a>00081 <span class="keywordflow">if</span> (i>dsdp->m || i<=0){ <a name="l00082"></a>00082 DSDPSETERR2(1,<span class="stringliteral">"Invalid variable number: Is 1<= %d <= %d\n"</span>,i,dsdp->m);} <a name="l00083"></a>00083 info=<a class="code" href="group__DSDPSolver.html#ga89e093b87698c2524d27fd97a8cbd3f6" title="Copy the internal scaling factor from the solver.">DSDPGetScale</a>(dsdp,&scale);DSDPCHKERR(info); <a name="l00084"></a>00084 info=DSDPVecSetElement(dsdp->y,i,scale*yi0);DSDPCHKERR(info); <a name="l00085"></a>00085 DSDPFunctionReturn(0); <a name="l00086"></a>00086 } <a name="l00087"></a>00087 <a name="l00098"></a>00098 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00099"></a>00099 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetY"</span> <a name="l00100"></a><a class="code" href="group__DSDPBasic.html#ga816a784dde863f6a35a2f5d8786a3441">00100</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPBasic.html#ga816a784dde863f6a35a2f5d8786a3441" title="Copies the variables y into an array.">DSDPGetY</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> y[], <span class="keywordtype">int</span> m){ <a name="l00101"></a>00101 <span class="keywordtype">int</span> i,info; <a name="l00102"></a>00102 <span class="keywordtype">double</span> scale,*yy; <a name="l00103"></a>00103 DSDPFunctionBegin; <a name="l00104"></a>00104 DSDPValid(dsdp); <a name="l00105"></a>00105 <span class="keywordflow">if</span> (dsdp->m < m-1) DSDPFunctionReturn(1); <a name="l00106"></a>00106 <span class="keywordflow">if</span> (dsdp->m > m) DSDPFunctionReturn(1); <a name="l00107"></a>00107 info=DSDPVecCopy(dsdp->xmaker[0].y,dsdp->ytemp); DSDPCHKERR(info); <a name="l00108"></a>00108 info=<a class="code" href="group__DSDPSolver.html#ga89e093b87698c2524d27fd97a8cbd3f6" title="Copy the internal scaling factor from the solver.">DSDPGetScale</a>(dsdp,&scale);DSDPCHKERR(info); <a name="l00109"></a>00109 info=DSDPVecGetArray(dsdp->ytemp,&yy);DSDPCHKERR(info); <a name="l00110"></a>00110 <span class="keywordflow">for</span> (i=0;i<m;i++) y[i]=yy[i+1]/scale; <a name="l00111"></a>00111 info=DSDPVecRestoreArray(dsdp->ytemp,&yy);DSDPCHKERR(info); <a name="l00112"></a>00112 DSDPFunctionReturn(0); <a name="l00113"></a>00113 } <a name="l00114"></a>00114 <a name="l00115"></a>00115 <a name="l00116"></a>00116 <a name="l00126"></a>00126 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00127"></a>00127 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetScale"</span> <a name="l00128"></a><a class="code" href="group__DSDPSolver.html#ga89e093b87698c2524d27fd97a8cbd3f6">00128</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#ga89e093b87698c2524d27fd97a8cbd3f6" title="Copy the internal scaling factor from the solver.">DSDPGetScale</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> *scale){ <a name="l00129"></a>00129 <span class="keywordtype">int</span> info;<span class="keywordtype">double</span> sscale; <a name="l00130"></a>00130 DSDPFunctionBegin; <a name="l00131"></a>00131 DSDPValid(dsdp); <a name="l00132"></a>00132 info=DSDPVecGetC(dsdp->y,&sscale);DSDPCHKERR(info); <a name="l00133"></a>00133 *scale=fabs(sscale); <a name="l00134"></a>00134 <span class="keywordflow">if</span> (sscale==0) *scale=1.0; <a name="l00135"></a>00135 DSDPFunctionReturn(0); <a name="l00136"></a>00136 } <a name="l00137"></a>00137 <a name="l00151"></a>00151 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00152"></a>00152 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPSetScale"</span> <a name="l00153"></a><a class="code" href="group__DSDPSolver.html#gabac4aee240be8605d2d5b21bf2f0650f">00153</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#gabac4aee240be8605d2d5b21bf2f0650f" title="Set the internal scaling factor.">DSDPSetScale</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> scale){ <a name="l00154"></a>00154 <span class="keywordtype">int</span> info;<span class="keywordtype">double</span> sscale; <a name="l00155"></a>00155 DSDPFunctionBegin; <a name="l00156"></a>00156 DSDPValid(dsdp); <a name="l00157"></a>00157 scale=fabs(scale); <a name="l00158"></a>00158 <span class="keywordflow">if</span> (scale==0) scale=1.0; <a name="l00159"></a>00159 info=<a class="code" href="group__DSDPSolver.html#ga89e093b87698c2524d27fd97a8cbd3f6" title="Copy the internal scaling factor from the solver.">DSDPGetScale</a>(dsdp,&sscale);DSDPCHKERR(info); <a name="l00160"></a>00160 sscale=scale/sscale; <a name="l00161"></a>00161 info=DSDPVecScale(sscale,dsdp->y); <a name="l00162"></a>00162 dsdp->mutarget*=sscale; <a name="l00163"></a>00163 dsdp->pobj*=sscale; <a name="l00164"></a>00164 dsdp->dobj*=sscale; <a name="l00165"></a>00165 dsdp->ppobj*=sscale; <a name="l00166"></a>00166 dsdp->ddobj*=sscale; <a name="l00167"></a>00167 dsdp->mu*=sscale; <a name="l00168"></a>00168 DSDPLogInfo(0,2,<span class="stringliteral">"Set DSDP C Scaling: %4.4e\n"</span>,scale); <a name="l00169"></a>00169 DSDPFunctionReturn(0); <a name="l00170"></a>00170 } <a name="l00171"></a>00171 <a name="l00183"></a>00183 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00184"></a>00184 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPAddObjectiveConstant"</span> <a name="l00185"></a><a class="code" href="group__DSDPSolution.html#ga28afa903396794d56ca26eea4b284e85">00185</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolution.html#ga28afa903396794d56ca26eea4b284e85" title="Add a constant to the objective.">DSDPAddObjectiveConstant</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> c){ <a name="l00186"></a>00186 <span class="keywordtype">int</span> info; <a name="l00187"></a>00187 DSDPFunctionBegin; <a name="l00188"></a>00188 DSDPValid(dsdp); <a name="l00189"></a>00189 info=DSDPVecSetC(dsdp->b,-c);DSDPCHKERR(info); <a name="l00190"></a>00190 DSDPLogInfo(0,2,<span class="stringliteral">"Add Objective Constant: %4.4e\n"</span>,c); <a name="l00191"></a>00191 DSDPFunctionReturn(0); <a name="l00192"></a>00192 } <a name="l00193"></a>00193 <a name="l00204"></a>00204 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00205"></a>00205 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPSetMaxIts"</span> <a name="l00206"></a><a class="code" href="group__DSDPConverge.html#ga91af478f9316391a35b595b669ad22b3">00206</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPConverge.html#ga91af478f9316391a35b595b669ad22b3" title="Terminate the solver after this number of iterations.">DSDPSetMaxIts</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">int</span> its){ <a name="l00207"></a>00207 DSDPFunctionBegin; <a name="l00208"></a>00208 DSDPValid(dsdp); <a name="l00209"></a>00209 <span class="keywordflow">if</span> (its >= 0) dsdp->maxiter = its; <a name="l00210"></a>00210 DSDPLogInfo(0,2,<span class="stringliteral">"Set Maximum Iterates: %4d\n"</span>,its); <a name="l00211"></a>00211 DSDPFunctionReturn(0); <a name="l00212"></a>00212 } <a name="l00213"></a>00213 <a name="l00223"></a>00223 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00224"></a>00224 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetMaxIts"</span> <a name="l00225"></a><a class="code" href="group__DSDPConverge.html#gac98359685ab5aad73ed95e335fcb21ab">00225</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPConverge.html#gac98359685ab5aad73ed95e335fcb21ab" title="Copy the maximum number of iterations from the solver.">DSDPGetMaxIts</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">int</span> *its){ <a name="l00226"></a>00226 DSDPFunctionBegin; <a name="l00227"></a>00227 DSDPValid(dsdp); <a name="l00228"></a>00228 *its=dsdp->maxiter; <a name="l00229"></a>00229 DSDPFunctionReturn(0); <a name="l00230"></a>00230 } <a name="l00231"></a>00231 <a name="l00232"></a>00232 <a name="l00244"></a>00244 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00245"></a>00245 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPSetMaxTrustRadius"</span> <a name="l00246"></a><a class="code" href="group__DSDPSolver.html#gacc8b2a85ea20d548fcff54f5161bc3d5">00246</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#gacc8b2a85ea20d548fcff54f5161bc3d5" title="Set a maximum trust radius on the step direction.">DSDPSetMaxTrustRadius</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> rad){ <a name="l00247"></a>00247 DSDPFunctionBegin; <a name="l00248"></a>00248 DSDPValid(dsdp); <a name="l00249"></a>00249 <span class="keywordflow">if</span> (rad > 0) dsdp->maxtrustradius = rad; <a name="l00250"></a>00250 DSDPLogInfo(0,2,<span class="stringliteral">"Set Maximum Trust Radius: %4.4e\n"</span>,rad); <a name="l00251"></a>00251 DSDPFunctionReturn(0); <a name="l00252"></a>00252 } <a name="l00253"></a>00253 <a name="l00263"></a>00263 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00264"></a>00264 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetMaxTrustRadius"</span> <a name="l00265"></a><a class="code" href="group__DSDPSolver.html#ga8fe5ad8ed4d88f70fc9e33a39460d594">00265</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#ga8fe5ad8ed4d88f70fc9e33a39460d594" title="Copy the current radius of the trust region.">DSDPGetMaxTrustRadius</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> *rad){ <a name="l00266"></a>00266 DSDPFunctionBegin; <a name="l00267"></a>00267 DSDPValid(dsdp); <a name="l00268"></a>00268 *rad=dsdp->maxtrustradius; <a name="l00269"></a>00269 DSDPFunctionReturn(0); <a name="l00270"></a>00270 } <a name="l00271"></a>00271 <a name="l00281"></a>00281 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00282"></a>00282 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPSetZBar"</span> <a name="l00283"></a><a class="code" href="group__DSDPSolver.html#ga2795069b8aaa6551a8c1c248bbb2cb1a">00283</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#ga2795069b8aaa6551a8c1c248bbb2cb1a" title="Set an upper bound on the objective value at the solution.">DSDPSetZBar</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> ppobj){ <a name="l00284"></a>00284 <span class="keywordtype">int</span> info; <a name="l00285"></a>00285 <span class="keywordtype">double</span> scale; <a name="l00286"></a>00286 DSDPFunctionBegin; <a name="l00287"></a>00287 DSDPValid(dsdp); <a name="l00288"></a>00288 info=<a class="code" href="group__DSDPSolver.html#ga89e093b87698c2524d27fd97a8cbd3f6" title="Copy the internal scaling factor from the solver.">DSDPGetScale</a>(dsdp,&scale);DSDPCHKERR(info); <a name="l00289"></a>00289 dsdp->ppobj=ppobj*scale; <a name="l00290"></a>00290 DSDPLogInfo(0,2,<span class="stringliteral">"Set Primal Objective and Upper bound on solution: %4.4e. \n"</span>,ppobj); <a name="l00291"></a>00291 DSDPFunctionReturn(0); <a name="l00292"></a>00292 } <a name="l00293"></a>00293 <a name="l00309"></a>00309 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00310"></a>00310 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPSetR0"</span> <a name="l00311"></a><a class="code" href="group__DSDPSolution.html#ga846e363115b1fba5622306efc2e0ba38">00311</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolution.html#ga846e363115b1fba5622306efc2e0ba38" title="Set an initial value for the variable r in (DD)">DSDPSetR0</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> res){ <a name="l00312"></a>00312 <span class="keywordtype">int</span> info; <a name="l00313"></a>00313 <span class="keywordtype">double</span> scale; <a name="l00314"></a>00314 DSDPFunctionBegin; <a name="l00315"></a>00315 DSDPValid(dsdp); <a name="l00316"></a>00316 info=<a class="code" href="group__DSDPSolver.html#ga89e093b87698c2524d27fd97a8cbd3f6" title="Copy the internal scaling factor from the solver.">DSDPGetScale</a>(dsdp,&scale);DSDPCHKERR(info); <a name="l00317"></a>00317 info=<a class="code" href="dsdp_8h.html#a0f6f666ce8aa2c5a80a8ccfe105c6558" title="Set variable r.">DSDPSetRR</a>(dsdp,scale*res); DSDPCHKERR(info); <a name="l00318"></a>00318 <span class="keywordflow">if</span> (res>=0)dsdp->goty0=<a class="code" href="dsdpbasictypes_8h.html#ae667f2bff3ab5ab0bc109fa76dc4ed65ae6b2e53e51e94a5fa7204ceac78f824f">DSDP_TRUE</a>; <a name="l00319"></a>00319 DSDPLogInfo(0,2,<span class="stringliteral">"Set Dual Initial Infeasibility to %4.4e times Identity Matrix. \n"</span>,res); <a name="l00320"></a>00320 DSDPFunctionReturn(0); <a name="l00321"></a>00321 } <a name="l00322"></a>00322 <a name="l00338"></a>00338 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00339"></a>00339 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPSetBarrierParameter"</span> <a name="l00340"></a><a class="code" href="group__DSDPSolver.html#ga4bcfff950e84b1e925ae99202f23282a">00340</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#ga4bcfff950e84b1e925ae99202f23282a" title="Set the current barrier parameter.">DSDPSetBarrierParameter</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> mu){ <a name="l00341"></a>00341 <span class="keywordtype">int</span> info;<span class="keywordtype">double</span> scale; <a name="l00342"></a>00342 DSDPFunctionBegin; <a name="l00343"></a>00343 DSDPValid(dsdp); <a name="l00344"></a>00344 info=<a class="code" href="group__DSDPSolver.html#ga89e093b87698c2524d27fd97a8cbd3f6" title="Copy the internal scaling factor from the solver.">DSDPGetScale</a>(dsdp,&scale);DSDPCHKERR(info); <a name="l00345"></a>00345 dsdp->mutarget = mu*scale; <a name="l00346"></a>00346 DSDPLogInfo(0,2,<span class="stringliteral">"Set InitialBarrierParameter: %4.4e \n"</span>,mu); <a name="l00347"></a>00347 DSDPFunctionReturn(0); <a name="l00348"></a>00348 } <a name="l00349"></a>00349 <a name="l00362"></a>00362 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00363"></a>00363 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetBarrierParameter"</span> <a name="l00364"></a><a class="code" href="group__DSDPSolver.html#ga05f1269e817495e448ffa8ae3a4012cf">00364</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#ga05f1269e817495e448ffa8ae3a4012cf" title="Copy the current barrier parameter.">DSDPGetBarrierParameter</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">double</span> *mu){ <a name="l00365"></a>00365 <span class="keywordtype">int</span> info;<span class="keywordtype">double</span> scale; <a name="l00366"></a>00366 DSDPFunctionBegin; <a name="l00367"></a>00367 info=<a class="code" href="group__DSDPSolver.html#ga89e093b87698c2524d27fd97a8cbd3f6" title="Copy the internal scaling factor from the solver.">DSDPGetScale</a>(dsdp,&scale);DSDPCHKERR(info); <a name="l00368"></a>00368 *mu=dsdp->mutarget/scale; <a name="l00369"></a>00369 DSDPFunctionReturn(0); <a name="l00370"></a>00370 } <a name="l00371"></a>00371 <a name="l00372"></a>00372 <a name="l00381"></a>00381 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00382"></a>00382 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPUsePenalty"</span> <a name="l00383"></a><a class="code" href="group__DSDPSolver.html#ga0e47c4779c3d4a036e258a5b4aa890b3">00383</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#ga0e47c4779c3d4a036e258a5b4aa890b3" title="Use penalty parameter to enforce feasibility.">DSDPUsePenalty</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">int</span> yesorno){ <a name="l00384"></a>00384 DSDPPenalty UsePenalty; <a name="l00385"></a>00385 <span class="keywordtype">int</span> info; <a name="l00386"></a>00386 DSDPFunctionBegin; <a name="l00387"></a>00387 DSDPValid(dsdp); <a name="l00388"></a>00388 <span class="keywordflow">if</span> (yesorno>0){ <a name="l00389"></a>00389 UsePenalty=DSDPAlways; <a name="l00390"></a>00390 } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (yesorno<0){ <a name="l00391"></a>00391 UsePenalty=DSDPNever; <a name="l00392"></a>00392 } <span class="keywordflow">else</span> { <a name="l00393"></a>00393 UsePenalty=DSDPInfeasible; <a name="l00394"></a>00394 } <a name="l00395"></a>00395 dsdp->UsePenalty=UsePenalty; <a name="l00396"></a>00396 info=RConeSetType(dsdp->rcone,UsePenalty);DSDPCHKERR(info); <a name="l00397"></a>00397 DSDPLogInfo(0,2,<span class="stringliteral">"Set UsePenalty: %d \n"</span>,yesorno); <a name="l00398"></a>00398 DSDPFunctionReturn(0); <a name="l00399"></a>00399 } <a name="l00400"></a>00400 <a name="l00416"></a>00416 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00417"></a>00417 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPSetPenaltyParameter"</span> <a name="l00418"></a><a class="code" href="group__DSDPSolver.html#gaaccdf7c94e0296bc83042ba3d4b29c5d">00418</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#gaaccdf7c94e0296bc83042ba3d4b29c5d" title="Set the penalty parameter Gamma.">DSDPSetPenaltyParameter</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> Gamma){ <a name="l00419"></a>00419 <span class="keywordtype">int</span> info; <a name="l00420"></a>00420 <span class="keywordtype">double</span> scale,ppenalty; <a name="l00421"></a>00421 DSDPFunctionBegin; <a name="l00422"></a>00422 DSDPValid(dsdp); <a name="l00423"></a>00423 info=<a class="code" href="group__DSDPSolver.html#ga89e093b87698c2524d27fd97a8cbd3f6" title="Copy the internal scaling factor from the solver.">DSDPGetScale</a>(dsdp,&scale);DSDPCHKERR(info); <a name="l00424"></a>00424 ppenalty=fabs(Gamma*scale); <a name="l00425"></a>00425 info=DSDPVecSetR(dsdp->b,ppenalty);DSDPCHKERR(info); <a name="l00426"></a>00426 DSDPLogInfo(0,2,<span class="stringliteral">"Set Penalty Parameter: %4.4e\n"</span>,Gamma); <a name="l00427"></a>00427 DSDPFunctionReturn(0); <a name="l00428"></a>00428 } <a name="l00429"></a>00429 <a name="l00441"></a>00441 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00442"></a>00442 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetPenaltyParameter"</span> <a name="l00443"></a><a class="code" href="group__DSDPSolver.html#gae27461735f62031b5fd794672b026b78">00443</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#gae27461735f62031b5fd794672b026b78" title="Copy the penalty parameter Gamma.">DSDPGetPenaltyParameter</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> *Gamma){ <a name="l00444"></a>00444 <span class="keywordtype">int</span> info; <a name="l00445"></a>00445 <span class="keywordtype">double</span> ppenalty; <a name="l00446"></a>00446 DSDPFunctionBegin; <a name="l00447"></a>00447 DSDPValid(dsdp); <a name="l00448"></a>00448 info=DSDPVecGetR(dsdp->b,&ppenalty);DSDPCHKERR(info); <a name="l00449"></a>00449 *Gamma=fabs(ppenalty); <a name="l00450"></a>00450 DSDPFunctionReturn(0); <a name="l00451"></a>00451 } <a name="l00452"></a>00452 <a name="l00453"></a>00453 <span class="comment">/* Not current; not documented</span> <a name="l00454"></a>00454 <span class="comment">*/</span> <a name="l00455"></a>00455 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00456"></a>00456 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetPenalty"</span> <a name="l00457"></a>00457 <span class="preprocessor"></span><span class="keywordtype">int</span> DSDPGetPenalty(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> *penalty){ <a name="l00458"></a>00458 <span class="keywordtype">int</span> info;<span class="keywordtype">double</span> ppenalty; <a name="l00459"></a>00459 DSDPFunctionBegin; <a name="l00460"></a>00460 DSDPValid(dsdp); <a name="l00461"></a>00461 info=DSDPVecGetR(dsdp->b,&ppenalty);DSDPCHKERR(info); <a name="l00462"></a>00462 *penalty=fabs(ppenalty); <a name="l00463"></a>00463 DSDPFunctionReturn(0); <a name="l00464"></a>00464 } <a name="l00465"></a>00465 <a name="l00466"></a>00466 <a name="l00467"></a>00467 <a name="l00477"></a>00477 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00478"></a>00478 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetPPObjective"</span> <a name="l00479"></a><a class="code" href="group__DSDPSolution.html#gad603533b7e28587f5b2ee824eee58eb3">00479</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolution.html#gad603533b7e28587f5b2ee824eee58eb3" title="Copy the objective value (PP).">DSDPGetPPObjective</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> *ppobj){ <a name="l00480"></a>00480 <span class="keywordtype">int</span> info; <a name="l00481"></a>00481 <span class="keywordtype">double</span> scale; <a name="l00482"></a>00482 DSDPFunctionBegin; <a name="l00483"></a>00483 DSDPValid(dsdp); <a name="l00484"></a>00484 info=<a class="code" href="group__DSDPSolver.html#ga89e093b87698c2524d27fd97a8cbd3f6" title="Copy the internal scaling factor from the solver.">DSDPGetScale</a>(dsdp,&scale);DSDPCHKERR(info); <a name="l00485"></a>00485 *ppobj=(dsdp->ppobj)/scale; <a name="l00486"></a>00486 <span class="keywordflow">if</span> (dsdp->cnorm==0) *ppobj=0; <a name="l00487"></a>00487 DSDPFunctionReturn(0); <a name="l00488"></a>00488 } <a name="l00489"></a>00489 <a name="l00500"></a>00500 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00501"></a>00501 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetDObjective"</span> <a name="l00502"></a><a class="code" href="group__DSDPSolution.html#ga2752cf39e1774945b484bddf7c2a5ef2">00502</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolution.html#ga2752cf39e1774945b484bddf7c2a5ef2" title="Copy the objective value (D).">DSDPGetDObjective</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> *dobj){ <a name="l00503"></a>00503 <span class="keywordtype">int</span> info; <span class="keywordtype">double</span> scale; <a name="l00504"></a>00504 DSDPFunctionBegin; <a name="l00505"></a>00505 DSDPValid(dsdp); <a name="l00506"></a>00506 info=<a class="code" href="group__DSDPSolver.html#ga89e093b87698c2524d27fd97a8cbd3f6" title="Copy the internal scaling factor from the solver.">DSDPGetScale</a>(dsdp,&scale);DSDPCHKERR(info); <a name="l00507"></a>00507 *dobj = (dsdp->dobj)/scale; <a name="l00508"></a>00508 <span class="keywordflow">if</span> (dsdp->cnorm==0) *dobj=-fabs(*dobj); <a name="l00509"></a>00509 DSDPFunctionReturn(0); <a name="l00510"></a>00510 } <a name="l00521"></a>00521 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00522"></a>00522 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetDDObjective"</span> <a name="l00523"></a><a class="code" href="group__DSDPSolution.html#gadb9e055ef8b2194ae67ed14ca06f1d01">00523</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolution.html#gadb9e055ef8b2194ae67ed14ca06f1d01" title="Copy the objective value (DD).">DSDPGetDDObjective</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> *ddobj){ <a name="l00524"></a>00524 <span class="keywordtype">int</span> info; <span class="keywordtype">double</span> scale; <a name="l00525"></a>00525 DSDPFunctionBegin; <a name="l00526"></a>00526 DSDPValid(dsdp); <a name="l00527"></a>00527 info=<a class="code" href="group__DSDPSolver.html#ga89e093b87698c2524d27fd97a8cbd3f6" title="Copy the internal scaling factor from the solver.">DSDPGetScale</a>(dsdp,&scale);DSDPCHKERR(info); <a name="l00528"></a>00528 *ddobj = (dsdp->ddobj)/scale; <a name="l00529"></a>00529 <span class="keywordflow">if</span> (dsdp->cnorm==0) *ddobj=-fabs(*ddobj); <a name="l00530"></a>00530 DSDPFunctionReturn(0); <a name="l00531"></a>00531 } <a name="l00532"></a>00532 <a name="l00543"></a>00543 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00544"></a>00544 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetDualityGap"</span> <a name="l00545"></a><a class="code" href="group__DSDPSolution.html#gaf22c2d4d0e8172b9c48fde5c1c53abbc">00545</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolution.html#gaf22c2d4d0e8172b9c48fde5c1c53abbc" title="Copy the difference between the objective values.">DSDPGetDualityGap</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> *dgap){ <a name="l00546"></a>00546 <span class="keywordtype">int</span> info; <span class="keywordtype">double</span> scale; <a name="l00547"></a>00547 DSDPFunctionBegin; <a name="l00548"></a>00548 DSDPValid(dsdp); <a name="l00549"></a>00549 info=<a class="code" href="group__DSDPSolver.html#ga89e093b87698c2524d27fd97a8cbd3f6" title="Copy the internal scaling factor from the solver.">DSDPGetScale</a>(dsdp,&scale);DSDPCHKERR(info); <a name="l00550"></a>00550 *dgap = (dsdp->dualitygap)/scale; <a name="l00551"></a>00551 DSDPFunctionReturn(0); <a name="l00552"></a>00552 } <a name="l00553"></a>00553 <a name="l00562"></a>00562 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00563"></a>00563 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetIts"</span> <a name="l00564"></a><a class="code" href="group__DSDPConverge.html#gaaeaa2ec0c50c43f4499aaffea692ede8">00564</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPConverge.html#gaaeaa2ec0c50c43f4499aaffea692ede8" title="Copy the current iteration number.">DSDPGetIts</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">int</span> *its){ <a name="l00565"></a>00565 DSDPFunctionBegin; <a name="l00566"></a>00566 DSDPValid(dsdp); <a name="l00567"></a>00567 *its=dsdp->itnow; <a name="l00568"></a>00568 DSDPFunctionReturn(0); <a name="l00569"></a>00569 } <a name="l00570"></a>00570 <a name="l00580"></a>00580 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00581"></a>00581 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPStopReason"</span> <a name="l00582"></a><a class="code" href="group__DSDPConverge.html#ga637bf541e030c5aef4d436a9792714a2">00582</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPConverge.html#ga637bf541e030c5aef4d436a9792714a2" title="Copy the reason why the solver terminated.">DSDPStopReason</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<a class="code" href="dsdpbasictypes_8h.html#a2a68c4cccb1289043bf9b59a58f55b3a" title="There are many reasons to terminate the solver.">DSDPTerminationReason</a> *reason){ <a name="l00583"></a>00583 DSDPFunctionBegin; <a name="l00584"></a>00584 DSDPValid(dsdp); <a name="l00585"></a>00585 *reason=dsdp->reason; <a name="l00586"></a>00586 DSDPFunctionReturn(0); <a name="l00587"></a>00587 } <a name="l00588"></a>00588 <a name="l00589"></a>00589 <a name="l00599"></a>00599 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00600"></a>00600 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetR"</span> <a name="l00601"></a><a class="code" href="group__DSDPSolution.html#gacfa8e29ecd7eaaeb6a4e31eb07961de3">00601</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolution.html#gacfa8e29ecd7eaaeb6a4e31eb07961de3" title="Copy the infeasibility in (D), or the variable r in (DD).">DSDPGetR</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">double</span> *res){ <a name="l00602"></a>00602 <span class="keywordtype">int</span> info;<span class="keywordtype">double</span> rr,scale; <a name="l00603"></a>00603 DSDPFunctionBegin; <a name="l00604"></a>00604 DSDPValid(dsdp); <a name="l00605"></a>00605 info=<a class="code" href="dsdp_8h.html#af433c52034d6fcfdafe637e66851808c" title="Get variable r.">DSDPGetRR</a>(dsdp,&rr);DSDPCHKERR(info); <a name="l00606"></a>00606 info=<a class="code" href="group__DSDPSolver.html#ga89e093b87698c2524d27fd97a8cbd3f6" title="Copy the internal scaling factor from the solver.">DSDPGetScale</a>(dsdp,&scale);DSDPCHKERR(info); <a name="l00607"></a>00607 *res=rr/scale; <a name="l00608"></a>00608 DSDPFunctionReturn(0); <a name="l00609"></a>00609 } <a name="l00610"></a>00610 <a name="l00619"></a>00619 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00620"></a>00620 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetDataNorms"</span> <a name="l00621"></a><a class="code" href="group__DSDPSolution.html#gae103a4b863adc10f37d2eda9f94a982b">00621</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolution.html#gae103a4b863adc10f37d2eda9f94a982b" title="Copy the norms of the data C, A, and b into an array.">DSDPGetDataNorms</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">double</span> dnorm[3]){ <a name="l00622"></a>00622 <span class="keywordtype">int</span> info; <a name="l00623"></a>00623 DSDPFunctionBegin; <a name="l00624"></a>00624 DSDPValid(dsdp); <a name="l00625"></a>00625 <span class="keywordflow">if</span> (dsdp->setupcalled==<a class="code" href="dsdpbasictypes_8h.html#ae667f2bff3ab5ab0bc109fa76dc4ed65a74385569aa7a59059a8847e2d39b754c">DSDP_FALSE</a>){ <a name="l00626"></a>00626 info=<a class="code" href="dsdp_8h.html#aa4a55b45b5eed1dcf620f6b30b422ce8" title="Compute norms of A,C, and b.">DSDPComputeDataNorms</a>(dsdp);DSDPCHKERR(info); <a name="l00627"></a>00627 } <a name="l00628"></a>00628 dnorm[0]=dsdp->cnorm; <a name="l00629"></a>00629 dnorm[1]=dsdp->anorm; <a name="l00630"></a>00630 dnorm[2]=dsdp->bnorm; <a name="l00631"></a>00631 DSDPFunctionReturn(0); <a name="l00632"></a>00632 } <a name="l00633"></a>00633 <a name="l00634"></a>00634 <a name="l00643"></a>00643 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00644"></a>00644 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetMaxYElement"</span> <a name="l00645"></a><a class="code" href="group__DSDPSolution.html#gae2e8b2a5e1b71d699d753a045de95add">00645</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolution.html#gae2e8b2a5e1b71d699d753a045de95add" title="Copy the the infinity norm of the variables y.">DSDPGetMaxYElement</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span>* ymax){ <a name="l00646"></a>00646 <span class="keywordtype">int</span> info; <a name="l00647"></a>00647 DSDPFunctionBegin; <a name="l00648"></a>00648 info=<a class="code" href="group__DSDPSolution.html#ga1a3be937e209108fe9acd088508feb95" title="Copy the the infinity norm of the variables y.">DSDPGetYMaxNorm</a>(dsdp,ymax);DSDPCHKERR(info); <a name="l00649"></a>00649 DSDPFunctionReturn(0); <a name="l00650"></a>00650 } <a name="l00651"></a>00651 <a name="l00652"></a>00652 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00653"></a>00653 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetDimension"</span> <a name="l00654"></a>00654 <span class="preprocessor"></span> <a name="l00661"></a><a class="code" href="group__DSDPSolution.html#ga23662df5aded65ab570523c7b810af4e">00661</a> <span class="keywordtype">int</span> <a class="code" href="group__DSDPSolution.html#ga23662df5aded65ab570523c7b810af4e" title="Copy the dimension of the cones, or the number of constraints in (D).">DSDPGetDimension</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">double</span> *n){ <a name="l00662"></a>00662 <span class="keywordtype">int</span> info; <a name="l00663"></a>00663 DSDPFunctionBegin; <a name="l00664"></a>00664 info=<a class="code" href="dsdp_8h.html#ad36ddc31c51eafafc6bf915e54492259" title="Get the total dimension of the cones.">DSDPGetConicDimension</a>(dsdp,n);DSDPCHKERR(info); <a name="l00665"></a>00665 DSDPFunctionReturn(0); <a name="l00666"></a>00666 } <a name="l00667"></a>00667 <a name="l00676"></a>00676 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00677"></a>00677 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetYMaxNorm"</span> <a name="l00678"></a><a class="code" href="group__DSDPSolution.html#ga1a3be937e209108fe9acd088508feb95">00678</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolution.html#ga1a3be937e209108fe9acd088508feb95" title="Copy the the infinity norm of the variables y.">DSDPGetYMaxNorm</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">double</span> *ynorm){ <a name="l00679"></a>00679 <span class="keywordtype">int</span> info; <a name="l00680"></a>00680 <span class="keywordtype">double</span> cc,rr,yy; <a name="l00681"></a>00681 DSDPFunctionBegin; <a name="l00682"></a>00682 DSDPValid(dsdp); <a name="l00683"></a>00683 info=DSDPVecGetC(dsdp->y,&cc);DSDPCHKERR(info); <a name="l00684"></a>00684 info=DSDPVecGetR(dsdp->y,&rr);DSDPCHKERR(info); <a name="l00685"></a>00685 info=DSDPVecSetC(dsdp->y,0);DSDPCHKERR(info); <a name="l00686"></a>00686 info=DSDPVecSetR(dsdp->y,0);DSDPCHKERR(info); <a name="l00687"></a>00687 info=DSDPVecNormInfinity(dsdp->y,&yy);DSDPCHKERR(info); <a name="l00688"></a>00688 info=DSDPVecSetC(dsdp->y,cc);DSDPCHKERR(info); <a name="l00689"></a>00689 info=DSDPVecSetR(dsdp->y,rr);DSDPCHKERR(info); <a name="l00690"></a>00690 <span class="keywordflow">if</span> (cc) yy/=fabs(cc); <a name="l00691"></a>00691 <span class="keywordflow">if</span> (ynorm) *ynorm=yy; <a name="l00692"></a>00692 DSDPFunctionReturn(0); <a name="l00693"></a>00693 } <a name="l00694"></a>00694 <a name="l00705"></a>00705 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00706"></a>00706 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetNumberOfVariables"</span> <a name="l00707"></a><a class="code" href="group__DSDPSolution.html#gae212bb3666f5c021f9d310a49438e94b">00707</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolution.html#gae212bb3666f5c021f9d310a49438e94b" title="Copy the number of variables y.">DSDPGetNumberOfVariables</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">int</span> *m){ <a name="l00708"></a>00708 DSDPFunctionBegin; <a name="l00709"></a>00709 DSDPValid(dsdp); <a name="l00710"></a>00710 *m=dsdp->m; <a name="l00711"></a>00711 DSDPFunctionReturn(0); <a name="l00712"></a>00712 } <a name="l00713"></a>00713 <a name="l00722"></a>00722 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00723"></a>00723 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetPnorm"</span> <a name="l00724"></a><a class="code" href="group__DSDPSolution.html#gaaa2bb03bf7a025936b1d2cd619327a49">00724</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolution.html#gaaa2bb03bf7a025936b1d2cd619327a49" title="Copy the proximity of the solution to the central path.">DSDPGetPnorm</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">double</span> *pnorm){ <a name="l00725"></a>00725 DSDPFunctionBegin; <a name="l00726"></a>00726 DSDPValid(dsdp); <a name="l00727"></a>00727 *pnorm=dsdp->pnorm; <a name="l00728"></a>00728 DSDPFunctionReturn(0); <a name="l00729"></a>00729 } <a name="l00730"></a>00730 <a name="l00740"></a>00740 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00741"></a>00741 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetStepLengths"</span> <a name="l00742"></a><a class="code" href="group__DSDPSolution.html#gadf4655c90ede45912f2e4ce7f4475cad">00742</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolution.html#gadf4655c90ede45912f2e4ce7f4475cad" title="Copy the step sizes in the current iteration.">DSDPGetStepLengths</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">double</span> *pstep, <span class="keywordtype">double</span> *dstep){ <a name="l00743"></a>00743 DSDPFunctionBegin; <a name="l00744"></a>00744 DSDPValid(dsdp); <a name="l00745"></a>00745 *dstep=dsdp->dstep; <a name="l00746"></a>00746 *pstep=dsdp->pstep; <a name="l00747"></a>00747 DSDPFunctionReturn(0); <a name="l00748"></a>00748 } <a name="l00749"></a>00749 <a name="l00763"></a>00763 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00764"></a>00764 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPSetPotentialParameter"</span> <a name="l00765"></a><a class="code" href="group__DSDPSolver.html#ga5d737fca8ae872f57fd37cc7784feede">00765</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#ga5d737fca8ae872f57fd37cc7784feede" title="Set the potential parameter.">DSDPSetPotentialParameter</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">double</span> rho){ <a name="l00766"></a>00766 DSDPFunctionBegin; <a name="l00767"></a>00767 DSDPValid(dsdp); <a name="l00768"></a>00768 <span class="keywordflow">if</span> (rho>1) dsdp->rhon=rho; <a name="l00769"></a>00769 DSDPLogInfo(0,2,<span class="stringliteral">"Set Potential Parameter %4.4f\n"</span>,rho); <a name="l00770"></a>00770 DSDPFunctionReturn(0); <a name="l00771"></a>00771 } <a name="l00772"></a>00772 <a name="l00782"></a>00782 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00783"></a>00783 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetPotentialParameter"</span> <a name="l00784"></a><a class="code" href="group__DSDPSolver.html#ga0cc2e91620e27338d0a508d60f8761ce">00784</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#ga0cc2e91620e27338d0a508d60f8761ce" title="Copy the potential parameter.">DSDPGetPotentialParameter</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">double</span> *rho){ <a name="l00785"></a>00785 DSDPFunctionBegin; <a name="l00786"></a>00786 DSDPValid(dsdp); <a name="l00787"></a>00787 *rho=dsdp->rhon; <a name="l00788"></a>00788 DSDPFunctionReturn(0); <a name="l00789"></a>00789 } <a name="l00790"></a>00790 <a name="l00801"></a>00801 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00802"></a>00802 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetPotential"</span> <a name="l00803"></a><a class="code" href="group__DSDPSolution.html#gaed464f68b994d51bf107e08c37ad9c1d">00803</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolution.html#gaed464f68b994d51bf107e08c37ad9c1d" title="Copy the potential of the current solution.">DSDPGetPotential</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">double</span> *potential){ <a name="l00804"></a>00804 DSDPFunctionBegin; <a name="l00805"></a>00805 DSDPValid(dsdp); <a name="l00806"></a>00806 *potential=dsdp->potential; <a name="l00807"></a>00807 DSDPFunctionReturn(0); <a name="l00808"></a>00808 } <a name="l00809"></a>00809 <a name="l00819"></a>00819 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00820"></a>00820 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPUseDynamicRho"</span> <a name="l00821"></a><a class="code" href="group__DSDPSolver.html#gae48a2eaf3ee6a982cb0c45d512216702">00821</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#gae48a2eaf3ee6a982cb0c45d512216702" title="Use a dynamic strategy to choose parameter rho.">DSDPUseDynamicRho</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">int</span> yesorno){ <a name="l00822"></a>00822 DSDPFunctionBegin; <a name="l00823"></a>00823 DSDPValid(dsdp); <a name="l00824"></a>00824 <span class="keywordflow">if</span> (yesorno) dsdp->usefixedrho=<a class="code" href="dsdpbasictypes_8h.html#ae667f2bff3ab5ab0bc109fa76dc4ed65a74385569aa7a59059a8847e2d39b754c">DSDP_FALSE</a>; <a name="l00825"></a>00825 <span class="keywordflow">else</span> dsdp->usefixedrho=<a class="code" href="dsdpbasictypes_8h.html#ae667f2bff3ab5ab0bc109fa76dc4ed65ae6b2e53e51e94a5fa7204ceac78f824f">DSDP_TRUE</a>; <a name="l00826"></a>00826 DSDPLogInfo(0,2,<span class="stringliteral">"Set UseDynamicRho: %d \n"</span>,yesorno); <a name="l00827"></a>00827 DSDPFunctionReturn(0); <a name="l00828"></a>00828 } <a name="l00829"></a>00829 <a name="l00830"></a>00830 <span class="comment">/* Not Current or documented</span> <a name="l00831"></a>00831 <span class="comment">*/</span> <a name="l00832"></a>00832 <span class="preprocessor">#undef __FUNCT__</span> <a name="l00833"></a>00833 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPBoundDualVariables"</span> <a name="l00834"></a>00834 <span class="preprocessor"></span><span class="comment">/* !</span> <a name="l00835"></a>00835 <span class="comment">\fn int DSDPBoundDualVariables(DSDP dsdp, double lbound, double ubound)</span> <a name="l00836"></a>00836 <span class="comment">\brief Bounds on the variables y.</span> <a name="l00837"></a>00837 <span class="comment"></span> <a name="l00838"></a>00838 <span class="comment">\param dsdp is the solver</span> <a name="l00839"></a>00839 <span class="comment">\param lbound will be the lower bound of the variables y</span> <a name="l00840"></a>00840 <span class="comment">\param ubound will be the upper bound of the variables y</span> <a name="l00841"></a>00841 <span class="comment">\sa DSDPSetYBounds()</span> <a name="l00842"></a>00842 <span class="comment">\ingroup DSDPSolver</span> <a name="l00843"></a>00843 <span class="comment">*/</span> <a name="l00844"></a>00844 <span class="keywordtype">int</span> DSDPBoundDualVariables(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> lbound, <span class="keywordtype">double</span> ubound){ <a name="l00845"></a>00845 <span class="keywordtype">int</span> info; <a name="l00846"></a>00846 <span class="keywordtype">double</span> bbound; <a name="l00847"></a>00847 DSDPFunctionBegin; <a name="l00848"></a>00848 bbound=DSDPMax(fabs(lbound),fabs(ubound)); <a name="l00849"></a>00849 DSDPLogInfo(0,2,<span class="stringliteral">"Bound Variables between %4.4e and %4.4e \n"</span>,-bbound,bbound); <a name="l00850"></a>00850 info = <a class="code" href="allbounds_8c.html#a8332f6f37dddb20cf8bd351b19e54cf3" title="Set bounds on the variables.">BoundYConeSetBounds</a>(dsdp->ybcone,-bbound,bbound);DSDPCHKERR(info); <a name="l00851"></a>00851 DSDPFunctionReturn(0); <a name="l00852"></a>00852 } <a name="l00853"></a>00853 <a name="l00864"></a>00864 <span class="preprocessor">#undef __FUNCT__</span> <a name="l00865"></a>00865 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetYBounds"</span> <a name="l00866"></a><a class="code" href="group__DSDPSolver.html#gaeb2f494ff50c552de67a02bf68f7b47e">00866</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#gaeb2f494ff50c552de67a02bf68f7b47e" title="Copy the bounds on the variables y.">DSDPGetYBounds</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> *lbound, <span class="keywordtype">double</span> *ubound){ <a name="l00867"></a>00867 <span class="keywordtype">int</span> info; <a name="l00868"></a>00868 DSDPFunctionBegin; <a name="l00869"></a>00869 info=<a class="code" href="allbounds_8c.html#a601e09f9ea801ed9b1ddd71de92be7c2" title="Get bounds on the variables.">BoundYConeGetBounds</a>(dsdp->ybcone,lbound,ubound);DSDPCHKERR(info); <a name="l00870"></a>00870 DSDPFunctionReturn(0); <a name="l00871"></a>00871 } <a name="l00872"></a>00872 <a name="l00883"></a>00883 <span class="preprocessor">#undef __FUNCT__</span> <a name="l00884"></a>00884 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPSetYBounds"</span> <a name="l00885"></a><a class="code" href="group__DSDPSolver.html#gad73a74d9d294e87b58ad3a7e939a43ad">00885</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#gad73a74d9d294e87b58ad3a7e939a43ad" title="Bound the variables y.">DSDPSetYBounds</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp,<span class="keywordtype">double</span> lbound, <span class="keywordtype">double</span> ubound){ <a name="l00886"></a>00886 <span class="keywordtype">int</span> info; <a name="l00887"></a>00887 DSDPFunctionBegin; <a name="l00888"></a>00888 info=<a class="code" href="allbounds_8c.html#a8332f6f37dddb20cf8bd351b19e54cf3" title="Set bounds on the variables.">BoundYConeSetBounds</a>(dsdp->ybcone,lbound,ubound);DSDPCHKERR(info); <a name="l00889"></a>00889 DSDPFunctionReturn(0); <a name="l00890"></a>00890 } <a name="l00891"></a>00891 <a name="l00892"></a>00892 <a name="l00893"></a>00893 <a name="l00903"></a>00903 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00904"></a>00904 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPReuseMatrix"</span> <a name="l00905"></a><a class="code" href="group__DSDPSolver.html#ga903ff948f2ba766430ba3918b9447ee7">00905</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#ga903ff948f2ba766430ba3918b9447ee7" title="Reuse the Hessian of the barrier function multiple times at each DSDP iteration.">DSDPReuseMatrix</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">int</span> rm){ <a name="l00906"></a>00906 DSDPFunctionBegin; <a name="l00907"></a>00907 DSDPValid(dsdp); <a name="l00908"></a>00908 dsdp->reuseM=rm; <a name="l00909"></a>00909 DSDPLogInfo(0,2,<span class="stringliteral">"Reuse the Schur Matrix: %d times\n"</span>,rm); <a name="l00910"></a>00910 DSDPFunctionReturn(0); <a name="l00911"></a>00911 } <a name="l00912"></a>00912 <a name="l00913"></a>00913 <a name="l00923"></a>00923 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00924"></a>00924 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPGetReuseMatrix"</span> <a name="l00925"></a><a class="code" href="group__DSDPSolver.html#gaf45e1f4f8329adb347b476d183d35885">00925</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#gaf45e1f4f8329adb347b476d183d35885" title="Copy this parameter.">DSDPGetReuseMatrix</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">int</span> *rm){ <a name="l00926"></a>00926 DSDPFunctionBegin; <a name="l00927"></a>00927 DSDPValid(dsdp); <a name="l00928"></a>00928 *rm=dsdp->reuseM; <a name="l00929"></a>00929 DSDPFunctionReturn(0); <a name="l00930"></a>00930 } <a name="l00931"></a>00931 <a name="l00932"></a>00932 <a name="l00943"></a>00943 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00944"></a>00944 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPSetMonitor"</span> <a name="l00945"></a><a class="code" href="group__DSDPSolver.html#ga888dd07a4f1c8def3f1708582baa07a4">00945</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPSolver.html#ga888dd07a4f1c8def3f1708582baa07a4" title="Monitor each iteration of the solver.">DSDPSetMonitor</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <span class="keywordtype">int</span> (*monitor)(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a>,<span class="keywordtype">void</span>*), <span class="keywordtype">void</span>* monitorctx){ <a name="l00946"></a>00946 DSDPFunctionBegin; <a name="l00947"></a>00947 DSDPValid(dsdp); <a name="l00948"></a>00948 <span class="keywordflow">if</span> (dsdp->nmonitors<MAX_DSDP_MONITORS){ <a name="l00949"></a>00949 DSDPLogInfo(0,2,<span class="stringliteral">"Set Monitor\n"</span>); <a name="l00950"></a>00950 dsdp->dmonitor[dsdp->nmonitors].monitor=monitor; <a name="l00951"></a>00951 dsdp->dmonitor[dsdp->nmonitors].monitorctx=monitorctx; <a name="l00952"></a>00952 dsdp->nmonitors++; <a name="l00953"></a>00953 } <a name="l00954"></a>00954 DSDPFunctionReturn(0); <a name="l00955"></a>00955 } <a name="l00956"></a>00956 <a name="l00966"></a>00966 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00967"></a>00967 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "DSDPSetConvergenceFlag"</span> <a name="l00968"></a><a class="code" href="group__DSDPConverge.html#ga1293e76a2fb57bd963713c3df7e88221">00968</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__DSDPConverge.html#ga1293e76a2fb57bd963713c3df7e88221" title="Monitor each iteration of the solver.">DSDPSetConvergenceFlag</a>(<a class="code" href="structDSDP__C.html" title="Internal structures for the DSDP solver.">DSDP</a> dsdp, <a class="code" href="dsdpbasictypes_8h.html#a2a68c4cccb1289043bf9b59a58f55b3a" title="There are many reasons to terminate the solver.">DSDPTerminationReason</a> reason ){ <a name="l00969"></a>00969 DSDPFunctionBegin; <a name="l00970"></a>00970 DSDPValid(dsdp); <a name="l00971"></a>00971 dsdp->reason=reason; <a name="l00972"></a>00972 <span class="keywordflow">if</span> (reason==<a class="code" href="dsdpbasictypes_8h.html#a2a68c4cccb1289043bf9b59a58f55b3aa7f8800e949dce9fa0f5e41b9bca69e02">DSDP_INFEASIBLE_START</a>){ <a name="l00973"></a>00973 DSDPLogInfo(0,2,<span class="stringliteral">"Initial Point Infeasible, Check variable bounds? \n"</span>,0); <a name="l00974"></a>00974 } <a name="l00975"></a>00975 DSDPFunctionReturn(0); <a name="l00976"></a>00976 } <a name="l00977"></a>00977 </pre></div></div> </div> <hr class="footer"/><address class="footer"><small>Generated on Wed Jun 8 2011 for DSDP by  <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </small></address> </body> </html>