<!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/sdp/dsdpadddata.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_2c21778722bc8593635d5ebd154ac3f7.html">sdp</a> </li> </ul> </div> </div> <div class="header"> <div class="headertitle"> <div class="title">dsdpadddata.c</div> </div> </div> <div class="contents"> <a href="dsdpadddata_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 "<a class="code" href="dsdpsdp_8h.html" title="Internal SDPCone data structures and routines.">dsdpsdp.h</a>"</span> <a name="l00002"></a>00002 <span class="preprocessor">#include "<a class="code" href="dsdpsys_8h.html" title="Error handling, printing, and profiling.">dsdpsys.h</a>"</span> <a name="l00007"></a>00007 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00008"></a>00008 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeCheckI"</span> <a name="l00009"></a>00009 <span class="preprocessor"></span> <a name="l00015"></a><a class="code" href="dsdpadddata_8c.html#ad4d473b079b878f37556932dca767342">00015</a> <span class="keywordtype">int</span> <a class="code" href="dsdpadddata_8c.html#ad4d473b079b878f37556932dca767342" title="Check validity of parameter.">SDPConeCheckI</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone,<span class="keywordtype">int</span> vari){ <a name="l00016"></a>00016 DSDPFunctionBegin; <a name="l00017"></a>00017 SDPConeValid(sdpcone); <a name="l00018"></a>00018 <span class="keywordflow">if</span> (vari<0 || vari>sdpcone->m) { <a name="l00019"></a>00019 DSDPSETERR2(1,<span class="stringliteral">"Bad Data Matrix: variable: %d (Max: %d)\n"</span>,vari,sdpcone->m+1);} <a name="l00020"></a>00020 DSDPFunctionReturn(0); <a name="l00021"></a>00021 } <a name="l00022"></a>00022 <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__ "SDPConeCheckJ"</span> <a name="l00025"></a>00025 <span class="preprocessor"></span> <a name="l00031"></a><a class="code" href="dsdpsdp_8h.html#a3987894eee5a89d6b6b28c40965d913c">00031</a> <span class="keywordtype">int</span> <a class="code" href="dsdpadddata_8c.html#a8043a5d379af0a18dcd0e5d4fd82387e" title="Check validity of parameter.">SDPConeCheckJ</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone,<span class="keywordtype">int</span> blockj){ <a name="l00032"></a>00032 DSDPFunctionBegin; <a name="l00033"></a>00033 SDPConeValid(sdpcone); <a name="l00034"></a>00034 <span class="keywordflow">if</span> (blockj<0 || blockj>= sdpcone->nblocks) { <a name="l00035"></a>00035 DSDPSETERR2(2,<span class="stringliteral">"Bad Data Matrix: Block: %d (Max: %d)\n"</span>,blockj,sdpcone->nblocks-1);} <a name="l00036"></a>00036 DSDPFunctionReturn(0); <a name="l00037"></a>00037 } <a name="l00038"></a>00038 <a name="l00039"></a>00039 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00040"></a>00040 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeCheckN"</span> <a name="l00041"></a>00041 <span class="preprocessor"></span> <a name="l00048"></a><a class="code" href="dsdpsdp_8h.html#a813b233b717094bba3faa1d2d475f905">00048</a> <span class="keywordtype">int</span> <a class="code" href="dsdpadddata_8c.html#af1714aaed2783404801235ae8065558d" title="Check validity of parameter.">SDPConeCheckN</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone,<span class="keywordtype">int</span> blockj, <span class="keywordtype">int</span> n){ <a name="l00049"></a>00049 <span class="keywordtype">int</span> info; <a name="l00050"></a>00050 DSDPFunctionBegin; <a name="l00051"></a>00051 info=<a class="code" href="dsdpadddata_8c.html#a8043a5d379af0a18dcd0e5d4fd82387e" title="Check validity of parameter.">SDPConeCheckJ</a>(sdpcone,blockj);DSDPCHKERR(info); <a name="l00052"></a>00052 <span class="keywordflow">if</span> (sdpcone->blk[blockj].n==0 && n>0){info=<a class="code" href="group__SDPRoutines.html#ga0c3a5c6eee6aca0ab0c222fbfcca1d19" title="Set the dimension of one block in the semidefinite cone.">SDPConeSetBlockSize</a>(sdpcone,blockj,n);DSDPCHKERR(info);} <a name="l00053"></a>00053 <span class="keywordflow">if</span> (sdpcone->blk[blockj].n != n){ <a name="l00054"></a>00054 DSDPSETERR3(3,<span class="stringliteral">"Check Dimension of Data Matrix: Block: %d, %d -- expecting %d\n"</span>, <a name="l00055"></a>00055 blockj,n,sdpcone->blk[blockj].n); <a name="l00056"></a>00056 } <a name="l00057"></a>00057 DSDPFunctionReturn(0); <a name="l00058"></a>00058 } <a name="l00059"></a>00059 <a name="l00060"></a>00060 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00061"></a>00061 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeCheckM"</span> <a name="l00062"></a>00062 <span class="preprocessor"></span> <a name="l00068"></a><a class="code" href="dsdpsdp_8h.html#aaeee8e3194b714cc6e902320021874a3">00068</a> <span class="keywordtype">int</span> <a class="code" href="dsdpadddata_8c.html#af369d5fedbca0d3aca1bfb2acc18adf8" title="Check validity of parameter.">SDPConeCheckM</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone,<span class="keywordtype">int</span> m){ <a name="l00069"></a>00069 DSDPFunctionBegin; <a name="l00070"></a>00070 SDPConeValid(sdpcone); <a name="l00071"></a>00071 <span class="keywordflow">if</span> (m!=sdpcone->m){ <a name="l00072"></a>00072 DSDPSETERR1(4,<span class="stringliteral">"Check dimension of array. This problem has %d variables\n"</span>,sdpcone->m);} <a name="l00073"></a>00073 DSDPFunctionReturn(0); <a name="l00074"></a>00074 } <a name="l00075"></a>00075 <a name="l00076"></a>00076 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00077"></a>00077 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeValidStorageFormat"</span> <a name="l00078"></a>00078 <span class="preprocessor"></span> <a name="l00084"></a><a class="code" href="dsdpadddata_8c.html#af7a6550c241cd5f4858152635a0ec320">00084</a> <span class="keywordtype">int</span> <a class="code" href="dsdpadddata_8c.html#af7a6550c241cd5f4858152635a0ec320" title="Check validity of parameter.">SDPConeValidStorageFormat</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone, <span class="keywordtype">char</span> format){ <a name="l00085"></a>00085 DSDPFunctionBegin; <a name="l00086"></a>00086 <span class="keywordflow">if</span> (format!=<span class="charliteral">'P'</span> && format != <span class="charliteral">'U'</span>){ <a name="l00087"></a>00087 DSDPSETERR1(4,<span class="stringliteral">"Check format of Block: %c is not supported! Use P or U. \n"</span>,format); <a name="l00088"></a>00088 } <a name="l00089"></a>00089 DSDPFunctionReturn(0); <a name="l00090"></a>00090 } <a name="l00091"></a>00091 <a name="l00092"></a>00092 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00093"></a>00093 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeCheckStorageFormat"</span> <a name="l00094"></a>00094 <span class="preprocessor"></span> <a name="l00101"></a><a class="code" href="dsdp5_8h.html#a0fad3b670c293cf78affa75d3576aa5b">00101</a> <span class="keywordtype">int</span> <a class="code" href="dsdpadddata_8c.html#afa39ba7bb64630c003bf3cb92dc0f640" title="Check validity of parameters.">SDPConeCheckStorageFormat</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone,<span class="keywordtype">int</span> blockj, <span class="keywordtype">char</span> format){ <a name="l00102"></a>00102 <span class="keywordtype">int</span> info; <a name="l00103"></a>00103 DSDPFunctionBegin; <a name="l00104"></a>00104 info=<a class="code" href="dsdpadddata_8c.html#a8043a5d379af0a18dcd0e5d4fd82387e" title="Check validity of parameter.">SDPConeCheckJ</a>(sdpcone,blockj);DSDPCHKERR(info); <a name="l00105"></a>00105 info=<a class="code" href="dsdpadddata_8c.html#af7a6550c241cd5f4858152635a0ec320" title="Check validity of parameter.">SDPConeValidStorageFormat</a>(sdpcone,format);DSDPCHKERR(info); <a name="l00106"></a>00106 <span class="keywordflow">if</span> (sdpcone->blk[blockj].format==<span class="charliteral">'N'</span>){ <a name="l00107"></a>00107 sdpcone->blk[blockj].format = format; <a name="l00108"></a>00108 } <a name="l00109"></a>00109 <span class="keywordflow">if</span> (sdpcone->blk[blockj].format != format){ <a name="l00110"></a>00110 DSDPSETERR3(4,<span class="stringliteral">"Check format of Data Matrix: Block: %d, %c -- expecting %c\n"</span>, <a name="l00111"></a>00111 blockj,format,sdpcone->blk[blockj].format); <a name="l00112"></a>00112 } <a name="l00113"></a>00113 DSDPFunctionReturn(0); <a name="l00114"></a>00114 } <a name="l00115"></a>00115 <a name="l00116"></a>00116 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00117"></a>00117 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeRemoveDataMatrix"</span> <a name="l00118"></a>00118 <span class="preprocessor"></span> <a name="l00127"></a><a class="code" href="group__SDPData.html#ga432458dcffefd28177d23ae8e60cf4d8">00127</a> <span class="keywordtype">int</span> <a class="code" href="group__SDPData.html#ga432458dcffefd28177d23ae8e60cf4d8" title="Remove the data matrix from the cone.">SDPConeRemoveDataMatrix</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone,<span class="keywordtype">int</span> blockj, <span class="keywordtype">int</span> vari){ <a name="l00128"></a>00128 <span class="keywordtype">int</span> info; <a name="l00129"></a>00129 DSDPFunctionBegin; <a name="l00130"></a>00130 info=<a class="code" href="dsdpadddata_8c.html#ad4d473b079b878f37556932dca767342" title="Check validity of parameter.">SDPConeCheckI</a>(sdpcone,vari);DSDPCHKERR(info); <a name="l00131"></a>00131 info=<a class="code" href="dsdpadddata_8c.html#a8043a5d379af0a18dcd0e5d4fd82387e" title="Check validity of parameter.">SDPConeCheckJ</a>(sdpcone,blockj);DSDPCHKERR(info); <a name="l00132"></a>00132 info=<a class="code" href="dsdpblock_8c.html#a94bf6be698a84670ba680739a105657b" title="Remove a data matrix.">DSDPBlockRemoveDataMatrix</a>(&sdpcone->blk[blockj].ADATA,vari);DSDPCHKERR(info); <a name="l00133"></a>00133 DSDPFunctionReturn(0); <a name="l00134"></a>00134 } <a name="l00135"></a>00135 <a name="l00136"></a>00136 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00137"></a>00137 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeAddDataMatrix"</span> <a name="l00138"></a>00138 <span class="preprocessor"></span> <a name="l00154"></a><a class="code" href="group__SDPData.html#ga16144b39108a8daef0d993f14404d6ca">00154</a> <span class="keywordtype">int</span> <a class="code" href="group__SDPData.html#ga16144b39108a8daef0d993f14404d6ca" title="Add a data matrix .">SDPConeAddDataMatrix</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone,<span class="keywordtype">int</span> blockj, <span class="keywordtype">int</span> vari, <span class="keywordtype">int</span> n, <span class="keywordtype">char</span> format, <span class="keyword">struct</span> <a class="code" href="structDSDPDataMat__Ops.html" title="Table of function pointers that operate on the data matrix.">DSDPDataMat_Ops</a>* dsdpdataops, <span class="keywordtype">void</span>* data){ <a name="l00155"></a>00155 <span class="keywordtype">int</span> info; <a name="l00156"></a>00156 DSDPFunctionBegin; <a name="l00157"></a>00157 info=<a class="code" href="dsdpadddata_8c.html#ad4d473b079b878f37556932dca767342" title="Check validity of parameter.">SDPConeCheckI</a>(sdpcone,vari);DSDPCHKERR(info); <a name="l00158"></a>00158 info=<a class="code" href="dsdpadddata_8c.html#a8043a5d379af0a18dcd0e5d4fd82387e" title="Check validity of parameter.">SDPConeCheckJ</a>(sdpcone,blockj);DSDPCHKERR(info); <a name="l00159"></a>00159 info=<a class="code" href="dsdpadddata_8c.html#af1714aaed2783404801235ae8065558d" title="Check validity of parameter.">SDPConeCheckN</a>(sdpcone,blockj,n);DSDPCHKERR(info); <a name="l00160"></a>00160 info=<a class="code" href="dsdpadddata_8c.html#afa39ba7bb64630c003bf3cb92dc0f640" title="Check validity of parameters.">SDPConeCheckStorageFormat</a>(sdpcone,blockj,format);DSDPCHKERR(info); <a name="l00161"></a>00161 info=<a class="code" href="dsdpblock_8c.html#a7126f9cb8f818e6f1e04db14ae2b16e8" title="Add data matrix into SDP block.">DSDPBlockAddDataMatrix</a>(&sdpcone->blk[blockj].ADATA,vari,dsdpdataops,data);DSDPCHKERR(info); <a name="l00162"></a>00162 DSDPFunctionReturn(0); <a name="l00163"></a>00163 } <a name="l00164"></a>00164 <a name="l00165"></a>00165 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00166"></a>00166 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeSetRMatrix"</span> <a name="l00167"></a>00167 <span class="preprocessor"></span> <a name="l00181"></a><a class="code" href="dsdpadddatamat_8c.html#a27c7f94f2f5f7a6ce16e5d921b23753d">00181</a> <span class="keywordtype">int</span> <a class="code" href="dsdpadddata_8c.html#a3a1012a610dff7102fdf219f9d94ff40" title="Add identity to dual matrix.">SDPConeSetRMatrix</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone,<span class="keywordtype">int</span> blockj, <span class="keywordtype">int</span> n, <span class="keywordtype">char</span> format, <span class="keyword">struct</span> <a class="code" href="structDSDPDataMat__Ops.html" title="Table of function pointers that operate on the data matrix.">DSDPDataMat_Ops</a>* dsdpdataops, <span class="keywordtype">void</span>* data){ <a name="l00182"></a>00182 <span class="keywordtype">int</span> info; <a name="l00183"></a>00183 <span class="keywordtype">int</span> vari=sdpcone->m+1; <a name="l00184"></a>00184 DSDPFunctionBegin; <a name="l00185"></a>00185 info=<a class="code" href="dsdpadddata_8c.html#a8043a5d379af0a18dcd0e5d4fd82387e" title="Check validity of parameter.">SDPConeCheckJ</a>(sdpcone,blockj);DSDPCHKERR(info); <a name="l00186"></a>00186 info=<a class="code" href="dsdpadddata_8c.html#af1714aaed2783404801235ae8065558d" title="Check validity of parameter.">SDPConeCheckN</a>(sdpcone,blockj,n);DSDPCHKERR(info); <a name="l00187"></a>00187 info=<a class="code" href="dsdpadddata_8c.html#afa39ba7bb64630c003bf3cb92dc0f640" title="Check validity of parameters.">SDPConeCheckStorageFormat</a>(sdpcone,blockj,format);DSDPCHKERR(info); <a name="l00188"></a>00188 info=<a class="code" href="dsdpblock_8c.html#a94bf6be698a84670ba680739a105657b" title="Remove a data matrix.">DSDPBlockRemoveDataMatrix</a>(&sdpcone->blk[blockj].ADATA,vari);DSDPCHKERR(info); <a name="l00189"></a>00189 info=<a class="code" href="dsdpblock_8c.html#a74777e0932680acbfab564073be288fe" title="Set data matrix into SDP block.">DSDPBlockSetDataMatrix</a>(&sdpcone->blk[blockj].ADATA,vari,dsdpdataops,data);DSDPCHKERR(info); <a name="l00190"></a>00190 DSDPFunctionReturn(0); <a name="l00191"></a>00191 } <a name="l00192"></a>00192 <a name="l00193"></a>00193 <a name="l00194"></a>00194 <span class="preprocessor">#undef __FUNCT__</span> <a name="l00195"></a>00195 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeViewDataMatrix"</span> <a name="l00196"></a>00196 <span class="preprocessor"></span> <a name="l00205"></a><a class="code" href="group__SDPBasic.html#ga66567faeecc4cb75f7ae3a3eed966bd4">00205</a> <span class="keywordtype">int</span> <a class="code" href="group__SDPBasic.html#ga66567faeecc4cb75f7ae3a3eed966bd4" title="Print a data matrix to the screen.">SDPConeViewDataMatrix</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone,<span class="keywordtype">int</span> blockj, <span class="keywordtype">int</span> vari){ <a name="l00206"></a>00206 <span class="keywordtype">int</span> info,ii,vari2,nnzmats; <a name="l00207"></a>00207 <a class="code" href="structDSDPDataMat__C.html" title="Symmetric data matrix for one block in the semidefinite cone.">DSDPDataMat</a> AA; <a name="l00208"></a>00208 DSDPFunctionBegin; <a name="l00209"></a>00209 info=<a class="code" href="dsdpadddata_8c.html#ad4d473b079b878f37556932dca767342" title="Check validity of parameter.">SDPConeCheckI</a>(sdpcone,vari);DSDPCHKERR(info); <a name="l00210"></a>00210 info=<a class="code" href="dsdpadddata_8c.html#a8043a5d379af0a18dcd0e5d4fd82387e" title="Check validity of parameter.">SDPConeCheckJ</a>(sdpcone,blockj);DSDPCHKERR(info); <a name="l00211"></a>00211 info=<a class="code" href="dsdpblock_8c.html#aa48f55168b6780852229dea20c3f1d38" title="Count how many data matrices are in a block of data.">DSDPBlockCountNonzeroMatrices</a>(&sdpcone->blk[blockj].ADATA,&nnzmats);DSDPCHKERR(info); <a name="l00212"></a>00212 <span class="keywordflow">for</span> (ii=0;ii<nnzmats; ii++){ <span class="comment">/* Matrix Entries */</span> <a name="l00213"></a>00213 info=<a class="code" href="dsdpblock_8c.html#a4154d7692828019b8f2d0f407310188c" title="Get a data matrix from a block of data.">DSDPBlockGetMatrix</a>(&sdpcone->blk[blockj].ADATA,ii,&vari2,0,&AA);DSDPCHKVARERR(vari,info); <a name="l00214"></a>00214 <span class="keywordflow">if</span> (vari2==vari){ info = <a class="code" href="dsdpdatamat_8c.html#a62c8f354eb4dd1e2214670cf4b262b5f" title="Print matrix.">DSDPDataMatView</a>(AA);DSDPCHKERR(info);} <a name="l00215"></a>00215 } <a name="l00216"></a>00216 DSDPFunctionReturn(0); <a name="l00217"></a>00217 } <a name="l00218"></a>00218 <a name="l00219"></a>00219 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00220"></a>00220 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeClearVMatrix"</span> <a name="l00221"></a>00221 <span class="preprocessor"></span> <a name="l00228"></a><a class="code" href="dsdpadddata_8c.html#a39874fc723dabc68c57260d69e461639">00228</a> <span class="keywordtype">int</span> <a class="code" href="dsdpadddata_8c.html#a39874fc723dabc68c57260d69e461639" title="Free V matrix.">SDPConeClearVMatrix</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone,<span class="keywordtype">int</span> blockj, <span class="keywordtype">int</span> n){ <a name="l00229"></a>00229 <span class="keywordtype">int</span> info; <a name="l00230"></a>00230 DSDPFunctionBegin; <a name="l00231"></a>00231 SDPConeValid(sdpcone); <a name="l00232"></a>00232 info=<a class="code" href="dsdpxmat_8c.html#acb23f3beb4969a6d69d1e3af7ccba034" title="Deallocate matrix.">DSDPVMatDestroy</a>(&sdpcone->blk[blockj].T);DSDPCHKERR(info); <a name="l00233"></a>00233 info=<a class="code" href="dsdpxmat_8c.html#a0088d6c397591c98f9e52a019c385304" title="Set pointers to null.">DSDPVMatInitialize</a>(&sdpcone->blk[blockj].T);DSDPCHKERR(info); <a name="l00234"></a>00234 DSDPFunctionReturn(0); <a name="l00235"></a>00235 } <a name="l00236"></a>00236 <a name="l00237"></a>00237 <a name="l00238"></a>00238 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00239"></a>00239 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeSetXMat"</span> <a name="l00240"></a>00240 <span class="preprocessor"></span> <a name="l00247"></a><a class="code" href="dsdp5_8h.html#a2f9d218e1cc7e0910811ce541534a06c">00247</a> <span class="keywordtype">int</span> <a class="code" href="dsdpadddata_8c.html#a63b350fa726733bb05cc16d6b611883a" title="Create X matrix.">SDPConeSetXMat</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone,<span class="keywordtype">int</span> blockj, <span class="keywordtype">int</span> n){ <a name="l00248"></a>00248 <span class="keywordtype">int</span> info; <a name="l00249"></a>00249 <span class="keywordtype">char</span> UPLQ; <a name="l00250"></a>00250 <a class="code" href="structDSDPVMat__C.html" title="Dense symmetric matrix for one block in the semidefinite cone.">DSDPVMat</a> T; <a name="l00251"></a>00251 <a name="l00252"></a>00252 DSDPFunctionBegin; <a name="l00253"></a>00253 SDPConeValid(sdpcone); <a name="l00254"></a>00254 info=<a class="code" href="dsdpadddata_8c.html#a39874fc723dabc68c57260d69e461639" title="Free V matrix.">SDPConeClearVMatrix</a>(sdpcone,blockj,n);DSDPCHKERR(info); <a name="l00255"></a>00255 DSDPLogInfo(0,10,<span class="stringliteral">"Create block X Mat: Block: %d, size: %d.\n"</span>,blockj,n); <a name="l00256"></a>00256 info=<a class="code" href="group__SDPData.html#gabb32703bcca3a703fbbb591ee6737118" title="Get the storage format for the block.">SDPConeGetStorageFormat</a>(sdpcone,blockj,&UPLQ); DSDPCHKERR(info); <a name="l00257"></a>00257 info=<a class="code" href="dsdpsdp_8h.html#aff1b2849be280d7a70e9480e4089cd74" title="Allocate V matrix.">DSDPMakeVMat</a>(UPLQ,n,&T);DSDPCHKERR(info); <a name="l00258"></a>00258 sdpcone->blk[blockj].T=T; <a name="l00259"></a>00259 DSDPFunctionReturn(0); <a name="l00260"></a>00260 } <a name="l00261"></a>00261 <a name="l00262"></a>00262 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00263"></a>00263 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeSetXArray"</span> <a name="l00264"></a>00264 <span class="preprocessor"></span> <a name="l00278"></a><a class="code" href="group__SDPRoutines.html#gaa3db1133fbf2edbfc1e48521bb367705">00278</a> <span class="keywordtype">int</span> <a class="code" href="group__SDPRoutines.html#gaa3db1133fbf2edbfc1e48521bb367705" title="Provide an array for the SDPCone object can use to store dense matrices.">SDPConeSetXArray</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone,<span class="keywordtype">int</span> blockj, <span class="keywordtype">int</span> n, <span class="keywordtype">double</span> xx[], <span class="keywordtype">int</span> nn){ <a name="l00279"></a>00279 <span class="keywordtype">int</span> info; <a name="l00280"></a>00280 <span class="keywordtype">char</span> UPLQ; <a name="l00281"></a>00281 <a class="code" href="structDSDPVMat__C.html" title="Dense symmetric matrix for one block in the semidefinite cone.">DSDPVMat</a> T; <a name="l00282"></a>00282 DSDPFunctionBegin; <a name="l00283"></a>00283 info=<a class="code" href="dsdpadddata_8c.html#a8043a5d379af0a18dcd0e5d4fd82387e" title="Check validity of parameter.">SDPConeCheckJ</a>(sdpcone,blockj);DSDPCHKERR(info); <a name="l00284"></a>00284 info=<a class="code" href="dsdpadddata_8c.html#af1714aaed2783404801235ae8065558d" title="Check validity of parameter.">SDPConeCheckN</a>(sdpcone,blockj,n);DSDPCHKERR(info); <a name="l00285"></a>00285 info=<a class="code" href="dsdpadddata_8c.html#a39874fc723dabc68c57260d69e461639" title="Free V matrix.">SDPConeClearVMatrix</a>(sdpcone,blockj,n);DSDPCHKERR(info); <a name="l00286"></a>00286 DSDPLogInfo(0,10,<span class="stringliteral">"Set block X array: Block: %d, size: %d.\n"</span>,blockj,n); <a name="l00287"></a>00287 info=<a class="code" href="group__SDPData.html#gabb32703bcca3a703fbbb591ee6737118" title="Get the storage format for the block.">SDPConeGetStorageFormat</a>(sdpcone,blockj,&UPLQ); DSDPCHKERR(info); <a name="l00288"></a>00288 info=<a class="code" href="dsdpsdp_8h.html#a17dc8bc3404b674460890974551cab29" title="Allocate V matrix using the given array.">DSDPMakeVMatWithArray</a>(UPLQ,xx,nn,n,&T);DSDPCHKERR(info); <a name="l00289"></a>00289 sdpcone->blk[blockj].T=T; <a name="l00290"></a>00290 DSDPFunctionReturn(0); <a name="l00291"></a>00291 } <a name="l00292"></a>00292 <a name="l00293"></a>00293 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00294"></a>00294 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeGetXArray"</span> <a name="l00295"></a>00295 <span class="preprocessor"></span> <a name="l00328"></a><a class="code" href="group__SDPBasic.html#ga9e7744a5c7fbe87642979e2b41bc2c00">00328</a> <span class="keywordtype">int</span> <a class="code" href="group__SDPBasic.html#ga9e7744a5c7fbe87642979e2b41bc2c00" title="After applying the solver, set a pointer to the array in the object with the solution X...">SDPConeGetXArray</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone,<span class="keywordtype">int</span> blockj, <span class="keywordtype">double</span>* xx[], <span class="keywordtype">int</span> *nn){ <a name="l00329"></a>00329 <span class="keywordtype">int</span> info,flag; <a name="l00330"></a>00330 DSDPFunctionBegin; <a name="l00331"></a>00331 info=<a class="code" href="dsdpadddata_8c.html#a8043a5d379af0a18dcd0e5d4fd82387e" title="Check validity of parameter.">SDPConeCheckJ</a>(sdpcone,blockj);DSDPCHKERR(info); <a name="l00332"></a>00332 info=<a class="code" href="dsdpxmat_8c.html#aae8cc5530449adc05a8f13d7ee56d00a" title="Answer whether the array has been allocated or not.">DSDPVMatExist</a>(sdpcone->blk[blockj].T,&flag);DSDPCHKERR(info); <a name="l00333"></a>00333 <span class="keywordflow">if</span> (flag==0){ <a name="l00334"></a>00334 DSDPSETERR(6,<span class="stringliteral">"No X Array available, Call DSDPSetup() or SDPConeSetXArray.\n"</span>);} <a name="l00335"></a>00335 info=<a class="code" href="dsdpxmat_8c.html#a3601c3a4974f85d70476152aeebb8a6d" title="Get the array that stores the matrix.">DSDPVMatGetArray</a>(sdpcone->blk[blockj].T,xx,nn);DSDPCHKERR(info); <a name="l00336"></a>00336 DSDPFunctionReturn(0); <a name="l00337"></a>00337 } <a name="l00338"></a>00338 <a name="l00339"></a>00339 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00340"></a>00340 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeRestoreXArray"</span> <a name="l00341"></a>00341 <span class="preprocessor"></span> <a name="l00351"></a><a class="code" href="group__SDPRoutines.html#gafd7a739bd01013be7e96f4069d526524">00351</a> <span class="keywordtype">int</span> <a class="code" href="group__SDPRoutines.html#gafd7a739bd01013be7e96f4069d526524" title="Restore the dense array and set these pointers to null.">SDPConeRestoreXArray</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone,<span class="keywordtype">int</span> blockj, <span class="keywordtype">double</span>* xx[], <span class="keywordtype">int</span> *nn){ <a name="l00352"></a>00352 <span class="keywordtype">int</span> info,flag; <a name="l00353"></a>00353 DSDPFunctionBegin; <a name="l00354"></a>00354 info=<a class="code" href="dsdpadddata_8c.html#a8043a5d379af0a18dcd0e5d4fd82387e" title="Check validity of parameter.">SDPConeCheckJ</a>(sdpcone,blockj);DSDPCHKERR(info); <a name="l00355"></a>00355 info=<a class="code" href="dsdpxmat_8c.html#aae8cc5530449adc05a8f13d7ee56d00a" title="Answer whether the array has been allocated or not.">DSDPVMatExist</a>(sdpcone->blk[blockj].T,&flag);DSDPCHKERR(info); <a name="l00356"></a>00356 <span class="keywordflow">if</span> (flag==0){ <a name="l00357"></a>00357 DSDPSETERR(6,<span class="stringliteral">"No X Array available, Call DSDPSetup() or SDPConeSetXArray.\n"</span>);} <a name="l00358"></a>00358 info=<a class="code" href="dsdpxmat_8c.html#a45cd417f498392df8fe1f8afca6cff8b" title="Restore the array that stores the matrix.">DSDPVMatRestoreArray</a>(sdpcone->blk[blockj].T,xx,nn);DSDPCHKERR(info); <a name="l00359"></a>00359 DSDPFunctionReturn(0); <a name="l00360"></a>00360 } <a name="l00361"></a>00361 <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__ "SDPConeMatrixView"</span> <a name="l00364"></a>00364 <span class="preprocessor"></span> <a name="l00372"></a><a class="code" href="group__SDPRoutines.html#gaa9602b67858d92a161dab4a0b36e42ac">00372</a> <span class="keywordtype">int</span> <a class="code" href="group__SDPRoutines.html#gaa9602b67858d92a161dab4a0b36e42ac" title="Print the dense array to the screen.">SDPConeMatrixView</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone, <span class="keywordtype">int</span> blockj){ <a name="l00373"></a>00373 <span class="keywordtype">int</span> info; <a name="l00374"></a>00374 DSDPFunctionBegin; <a name="l00375"></a>00375 info=<a class="code" href="dsdpadddata_8c.html#a8043a5d379af0a18dcd0e5d4fd82387e" title="Check validity of parameter.">SDPConeCheckJ</a>(sdpcone,blockj);DSDPCHKERR(info); <a name="l00376"></a>00376 info=<a class="code" href="dsdpxmat_8c.html#afa0b2c0d0c9ec7c7f9842d1db778a5b3" title="Print matrix.">DSDPVMatView</a>(sdpcone->blk[blockj].T);DSDPCHKERR(info); <a name="l00377"></a>00377 DSDPFunctionReturn(0); <a name="l00378"></a>00378 } <a name="l00379"></a>00379 <a name="l00380"></a>00380 <span class="preprocessor">#undef __FUNCT__</span> <a name="l00381"></a>00381 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeUseFullSymmetricFormat"</span> <a name="l00382"></a>00382 <span class="preprocessor"></span> <a name="l00414"></a><a class="code" href="group__SDPData.html#ga303574b92e3dd97faadb1a3a190391e4">00414</a> <span class="keywordtype">int</span> <a class="code" href="group__SDPData.html#ga303574b92e3dd97faadb1a3a190391e4" title="Use full symmetric format for the dense array.">SDPConeUseFullSymmetricFormat</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone, <span class="keywordtype">int</span> blockj){ <a name="l00415"></a>00415 <span class="keywordtype">int</span> info; <a name="l00416"></a>00416 DSDPFunctionBegin; <a name="l00417"></a>00417 info=<a class="code" href="group__SDPData.html#gadb309e9fe9d1cbc1a0e3a30d051be2aa" title="Set the dense storage format of a block in the semidefinite cone.">SDPConeSetStorageFormat</a>(sdpcone,blockj,<span class="charliteral">'U'</span>);DSDPCHKERR(info); <a name="l00418"></a>00418 DSDPFunctionReturn(0); <a name="l00419"></a>00419 } <a name="l00420"></a>00420 <a name="l00421"></a>00421 <span class="preprocessor">#undef __FUNCT__</span> <a name="l00422"></a>00422 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeUsePackedFormat"</span> <a name="l00423"></a>00423 <span class="preprocessor"></span> <a name="l00452"></a><a class="code" href="group__SDPData.html#gaa3747efc8ae918a9be9138dcab3cf7bd">00452</a> <span class="keywordtype">int</span> <a class="code" href="group__SDPData.html#gaa3747efc8ae918a9be9138dcab3cf7bd" title="Use packed symmetric format for the dense array.">SDPConeUsePackedFormat</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone, <span class="keywordtype">int</span> blockj){ <a name="l00453"></a>00453 <span class="keywordtype">int</span> info; <a name="l00454"></a>00454 DSDPFunctionBegin; <a name="l00455"></a>00455 info=<a class="code" href="group__SDPData.html#gadb309e9fe9d1cbc1a0e3a30d051be2aa" title="Set the dense storage format of a block in the semidefinite cone.">SDPConeSetStorageFormat</a>(sdpcone,blockj,<span class="charliteral">'P'</span>);DSDPCHKERR(info); <a name="l00456"></a>00456 DSDPFunctionReturn(0); <a name="l00457"></a>00457 } <a name="l00458"></a>00458 <a name="l00459"></a>00459 <span class="preprocessor">#undef __FUNCT__</span> <a name="l00460"></a>00460 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeSetStorageFormat"</span> <a name="l00461"></a>00461 <span class="preprocessor"></span> <a name="l00479"></a><a class="code" href="group__SDPData.html#gadb309e9fe9d1cbc1a0e3a30d051be2aa">00479</a> <span class="keywordtype">int</span> <a class="code" href="group__SDPData.html#gadb309e9fe9d1cbc1a0e3a30d051be2aa" title="Set the dense storage format of a block in the semidefinite cone.">SDPConeSetStorageFormat</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone, <span class="keywordtype">int</span> blockj, <span class="keywordtype">char</span> format){ <a name="l00480"></a>00480 <span class="keywordtype">int</span> info; <a name="l00481"></a>00481 DSDPFunctionBegin; <a name="l00482"></a>00482 info=<a class="code" href="dsdpadddata_8c.html#af7a6550c241cd5f4858152635a0ec320" title="Check validity of parameter.">SDPConeValidStorageFormat</a>(sdpcone,format);DSDPCHKERR(info); <a name="l00483"></a>00483 info=<a class="code" href="dsdpadddata_8c.html#a8043a5d379af0a18dcd0e5d4fd82387e" title="Check validity of parameter.">SDPConeCheckJ</a>(sdpcone,blockj);DSDPCHKERR(info); <a name="l00484"></a>00484 sdpcone->blk[blockj].format=format; <a name="l00485"></a>00485 DSDPFunctionReturn(0); <a name="l00486"></a>00486 } <a name="l00487"></a>00487 <a name="l00488"></a>00488 <span class="preprocessor">#undef __FUNCT__</span> <a name="l00489"></a>00489 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeGetStorageFormat"</span> <a name="l00490"></a>00490 <span class="preprocessor"></span> <a name="l00505"></a><a class="code" href="group__SDPData.html#gabb32703bcca3a703fbbb591ee6737118">00505</a> <span class="keywordtype">int</span> <a class="code" href="group__SDPData.html#gabb32703bcca3a703fbbb591ee6737118" title="Get the storage format for the block.">SDPConeGetStorageFormat</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone, <span class="keywordtype">int</span> blockj, <span class="keywordtype">char</span> *format){ <a name="l00506"></a>00506 <span class="keywordtype">int</span> info; <a name="l00507"></a>00507 DSDPFunctionBegin; <a name="l00508"></a>00508 info=<a class="code" href="dsdpadddata_8c.html#a8043a5d379af0a18dcd0e5d4fd82387e" title="Check validity of parameter.">SDPConeCheckJ</a>(sdpcone,blockj);DSDPCHKERR(info); <a name="l00509"></a>00509 *format=sdpcone->blk[blockj].format; <a name="l00510"></a>00510 <span class="keywordflow">if</span> (*format==<span class="charliteral">'N'</span>) *format=<span class="charliteral">'P'</span>; <a name="l00511"></a>00511 DSDPFunctionReturn(0); <a name="l00512"></a>00512 } <a name="l00513"></a>00513 <a name="l00514"></a>00514 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00515"></a>00515 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeScaleBarrier"</span> <a name="l00516"></a>00516 <span class="preprocessor"></span><span class="keywordtype">int</span> SDPConeScaleBarrier(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone,<span class="keywordtype">int</span> blockj, <span class="keywordtype">double</span> ggamma){ <a name="l00517"></a>00517 <span class="keywordtype">int</span> info; <a name="l00518"></a>00518 DSDPFunctionBegin; <a name="l00519"></a>00519 info=<a class="code" href="dsdpadddata_8c.html#a8043a5d379af0a18dcd0e5d4fd82387e" title="Check validity of parameter.">SDPConeCheckJ</a>(sdpcone,blockj);DSDPCHKERR(info); <a name="l00520"></a>00520 sdpcone->blk[blockj].gammamu=ggamma; <a name="l00521"></a>00521 DSDPFunctionReturn(0); <a name="l00522"></a>00522 } <a name="l00523"></a>00523 <a name="l00524"></a>00524 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00525"></a>00525 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeSetBlockSize"</span> <a name="l00526"></a>00526 <span class="preprocessor"></span> <a name="l00535"></a><a class="code" href="group__SDPRoutines.html#ga0c3a5c6eee6aca0ab0c222fbfcca1d19">00535</a> <span class="keywordtype">int</span> <a class="code" href="group__SDPRoutines.html#ga0c3a5c6eee6aca0ab0c222fbfcca1d19" title="Set the dimension of one block in the semidefinite cone.">SDPConeSetBlockSize</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone, <span class="keywordtype">int</span> blockj, <span class="keywordtype">int</span> n){ <a name="l00536"></a>00536 <span class="keywordtype">int</span> info,n0; <a name="l00537"></a>00537 DSDPFunctionBegin; <a name="l00538"></a>00538 DSDPLogInfo(0,10,<span class="stringliteral">"Set block size: Block: %d, size: %d.\n"</span>,blockj,n); <a name="l00539"></a>00539 info=<a class="code" href="dsdpadddata_8c.html#a8043a5d379af0a18dcd0e5d4fd82387e" title="Check validity of parameter.">SDPConeCheckJ</a>(sdpcone,blockj);DSDPCHKERR(info); <a name="l00540"></a>00540 n0=sdpcone->blk[blockj].n; <a name="l00541"></a>00541 <span class="keywordflow">if</span> (n0==n){DSDPFunctionReturn(0);} <a name="l00542"></a>00542 <span class="keywordflow">if</span> (n0!=0 &&n0!=n){ <a name="l00543"></a>00543 DSDPSETERR2(5,<span class="stringliteral">"Block %d Size previously set to %d \n"</span>,blockj,n0); } <a name="l00544"></a>00544 sdpcone->blk[blockj].n=n; <a name="l00545"></a>00545 sdpcone->nn+=n-n0; <a name="l00546"></a>00546 DSDPFunctionReturn(0); <a name="l00547"></a>00547 } <a name="l00548"></a>00548 <a name="l00549"></a>00549 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00550"></a>00550 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeGetBlockSize"</span> <a name="l00551"></a>00551 <span class="preprocessor"></span> <a name="l00560"></a><a class="code" href="group__SDPRoutines.html#gada3cc6468c592a2e40b4f78b0def507c">00560</a> <span class="keywordtype">int</span> <a class="code" href="group__SDPRoutines.html#gada3cc6468c592a2e40b4f78b0def507c" title="Get the dimension of one block in the semidefinite cone.">SDPConeGetBlockSize</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone, <span class="keywordtype">int</span> blockj, <span class="keywordtype">int</span> *n){ <a name="l00561"></a>00561 <span class="keywordtype">int</span> info; <a name="l00562"></a>00562 DSDPFunctionBegin; <a name="l00563"></a>00563 info=<a class="code" href="dsdpadddata_8c.html#a8043a5d379af0a18dcd0e5d4fd82387e" title="Check validity of parameter.">SDPConeCheckJ</a>(sdpcone,blockj);DSDPCHKERR(info); <a name="l00564"></a>00564 *n=sdpcone->blk[blockj].n; <a name="l00565"></a>00565 DSDPFunctionReturn(0); <a name="l00566"></a>00566 } <a name="l00567"></a>00567 <a name="l00576"></a>00576 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00577"></a>00577 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeGetNumberOfBlocks"</span> <a name="l00578"></a><a class="code" href="group__SDPRoutines.html#ga1b36d9b0d9411f3a46dafbeffddc8def">00578</a> <span class="preprocessor"></span><span class="keywordtype">int</span> <a class="code" href="group__SDPRoutines.html#ga1b36d9b0d9411f3a46dafbeffddc8def" title="Get the number of blocks in the semidefinite cone.">SDPConeGetNumberOfBlocks</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone, <span class="keywordtype">int</span> *nblocks){ <a name="l00579"></a>00579 DSDPFunctionBegin; <a name="l00580"></a>00580 SDPConeValid(sdpcone); <a name="l00581"></a>00581 *nblocks=sdpcone->nblocks; <a name="l00582"></a>00582 DSDPFunctionReturn(0); <a name="l00583"></a>00583 } <a name="l00584"></a>00584 <a name="l00585"></a>00585 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00586"></a>00586 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeSetSparsity"</span> <a name="l00587"></a>00587 <span class="preprocessor"></span> <a name="l00596"></a><a class="code" href="group__SDPRoutines.html#ga40728695e4c841900c02c615a8d96ab0">00596</a> <span class="keywordtype">int</span> <a class="code" href="group__SDPRoutines.html#ga40728695e4c841900c02c615a8d96ab0" title="Set the number of nonzero matrices in a block of the semidefinite cone.">SDPConeSetSparsity</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone, <span class="keywordtype">int</span> blockj, <span class="keywordtype">int</span> nnz){ <a name="l00597"></a>00597 <span class="keywordtype">int</span> info; <a name="l00598"></a>00598 DSDPFunctionBegin; <a name="l00599"></a>00599 DSDPLogInfo(0,10,<span class="stringliteral">"Set block nonzeros: Block: %d, Nonzero Matrices: %d.\n"</span>,blockj,nnz); <a name="l00600"></a>00600 info=<a class="code" href="dsdpadddata_8c.html#a8043a5d379af0a18dcd0e5d4fd82387e" title="Check validity of parameter.">SDPConeCheckJ</a>(sdpcone,blockj);DSDPCHKERR(info); <a name="l00601"></a>00601 <span class="keywordflow">if</span> (nnz>sdpcone->m) nnz=sdpcone->m; <a name="l00602"></a>00602 info=<a class="code" href="dsdpblock_8c.html#a3736c54bd0e831664e9aa7e2130a0766" title="Allocate some structures.">DSDPBlockDataAllocate</a>(&sdpcone->blk[blockj].ADATA,nnz+2); DSDPCHKERR(info); <a name="l00603"></a>00603 DSDPFunctionReturn(0); <a name="l00604"></a>00604 } <a name="l00605"></a>00605 <a name="l00606"></a>00606 <a name="l00607"></a>00607 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00608"></a>00608 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeView"</span> <a name="l00609"></a>00609 <span class="preprocessor"></span> <a name="l00617"></a><a class="code" href="dsdp5_8h.html#a5d847d444ba507c05d05370e16f66ab9">00617</a> <span class="keywordtype">int</span> <a class="code" href="dsdpadddata_8c.html#a090ffcb29e21d85ef1c6fb4effdab4ba" title="Print the SDPCone to the screen;.">SDPConeView</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone){ <a name="l00618"></a>00618 <span class="keywordtype">int</span> blockj,info; <a name="l00619"></a>00619 DSDPFunctionBegin; <a name="l00620"></a>00620 <span class="keywordflow">for</span> (blockj=0; blockj<sdpcone->nblocks; blockj++){ <a name="l00621"></a>00621 printf(<span class="stringliteral">"Block: %d, Dimension: %d\n"</span>,blockj,sdpcone->blk[blockj].n); <a name="l00622"></a>00622 info=<a class="code" href="dsdpblock_8c.html#adca5f2068d4515779b89111ef9adf7d4" title="Print the structure of the block.">DSDPBlockView</a>(&sdpcone->blk[blockj].ADATA);DSDPCHKERR(info); <a name="l00623"></a>00623 } <a name="l00624"></a>00624 DSDPFunctionReturn(0); <a name="l00625"></a>00625 } <a name="l00626"></a>00626 <a name="l00627"></a>00627 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00628"></a>00628 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeView2"</span> <a name="l00629"></a>00629 <span class="preprocessor"></span> <a name="l00637"></a><a class="code" href="group__SDPData.html#gaafa7a20cefd79a41d5ba024227f96c85">00637</a> <span class="keywordtype">int</span> <a class="code" href="group__SDPData.html#gaafa7a20cefd79a41d5ba024227f96c85" title="Print the SDP cone to the screen in a second way.">SDPConeView2</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone){ <a name="l00638"></a>00638 <span class="keywordtype">int</span> blockj,info; <a name="l00639"></a>00639 DSDPFunctionBegin; <a name="l00640"></a>00640 <span class="keywordflow">for</span> (blockj=0; blockj<sdpcone->nblocks; blockj++){ <a name="l00641"></a>00641 printf(<span class="stringliteral">"Block: %d, Dimension: %d\n"</span>,blockj,sdpcone->blk[blockj].n); <a name="l00642"></a>00642 info=<a class="code" href="dsdpblock_8c.html#a2e067fba7b5ec294fff7f3daae5167de" title="Print the data.">DSDPBlockView2</a>(&sdpcone->blk[blockj].ADATA);DSDPCHKERR(info); <a name="l00643"></a>00643 } <a name="l00644"></a>00644 DSDPFunctionReturn(0); <a name="l00645"></a>00645 } <a name="l00646"></a>00646 <a name="l00647"></a>00647 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00648"></a>00648 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeView3"</span> <a name="l00649"></a>00649 <span class="preprocessor"></span> <a name="l00657"></a><a class="code" href="group__SDPData.html#gaaba0c2eab95b5cd5ecf008bdd9ac360b">00657</a> <span class="keywordtype">int</span> <a class="code" href="group__SDPData.html#gaaba0c2eab95b5cd5ecf008bdd9ac360b" title="Print the SDP cone to the screen in a third way.">SDPConeView3</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone){ <a name="l00658"></a>00658 <span class="keywordtype">int</span> blockj,id,n,info,nnzmats; <a name="l00659"></a>00659 DSDPFunctionBegin; <a name="l00660"></a>00660 <span class="keywordflow">for</span> (blockj=0; blockj<sdpcone->nblocks; blockj++){ <a name="l00661"></a>00661 n=sdpcone->blk[blockj].n; <a name="l00662"></a>00662 printf(<span class="stringliteral">"Block: %d \n"</span>,blockj); <a name="l00663"></a>00663 printf(<span class="stringliteral">" Dimension: %d\n"</span>,n); <a name="l00664"></a>00664 info=DSDPDSMatGetType(sdpcone->blk[blockj].DS,&<span class="keywordtype">id</span>); <a name="l00665"></a>00665 <span class="keywordflow">if</span> (<span class="keywordtype">id</span>==1){ <a name="l00666"></a>00666 printf(<span class="stringliteral">" DS Matrix Type: Dense, Using LAPACK\n"</span>); <a name="l00667"></a>00667 } <span class="keywordflow">else</span> { <a name="l00668"></a>00668 printf(<span class="stringliteral">" DS Matrix Type: %d\n"</span>,<span class="keywordtype">id</span>); <a name="l00669"></a>00669 } <a name="l00670"></a>00670 info=DSDPDualMatGetType(sdpcone->blk[blockj].S,&<span class="keywordtype">id</span>); <a name="l00671"></a>00671 <span class="keywordflow">if</span> (<span class="keywordtype">id</span>==1){ <a name="l00672"></a>00672 printf(<span class="stringliteral">" Dual Matrix Type: Dense, Using LAPACK\n"</span>); <a name="l00673"></a>00673 } <span class="keywordflow">else</span> { <a name="l00674"></a>00674 printf(<span class="stringliteral">" Dual Matrix Type: %d\n"</span>,<span class="keywordtype">id</span>); <a name="l00675"></a>00675 } <a name="l00676"></a>00676 info=<a class="code" href="dsdpblock_8c.html#aa48f55168b6780852229dea20c3f1d38" title="Count how many data matrices are in a block of data.">DSDPBlockCountNonzeroMatrices</a>(&sdpcone->blk[blockj].ADATA,&nnzmats);DSDPCHKERR(info); <a name="l00677"></a>00677 printf(<span class="stringliteral">" Number of Data Matrices: %d of %d\n"</span>,nnzmats-1,sdpcone->m+1); <a name="l00678"></a>00678 printf(<span class="stringliteral">" Number of Data Nonzeros: %d\n"</span>,sdpcone->blk[blockj].nnz); <a name="l00679"></a>00679 } <a name="l00680"></a>00680 DSDPFunctionReturn(0); <a name="l00681"></a>00681 } <a name="l00682"></a>00682 <a name="l00683"></a>00683 <a name="l00684"></a>00684 <span class="preprocessor">#undef __FUNCT__ </span> <a name="l00685"></a>00685 <span class="preprocessor"></span><span class="preprocessor">#define __FUNCT__ "SDPConeCheckData"</span> <a name="l00686"></a>00686 <span class="preprocessor"></span> <a name="l00692"></a><a class="code" href="group__SDPData.html#ga479e45b5543849df14aa0d1c56e25753">00692</a> <span class="keywordtype">int</span> <a class="code" href="group__SDPData.html#ga479e45b5543849df14aa0d1c56e25753" title="Check the matrix operations on a data matrix;.">SDPConeCheckData</a>(<a class="code" href="structSDPCone__C.html" title="Internal structure for semidefinite cone.">SDPCone</a> sdpcone){ <a name="l00693"></a>00693 <span class="keywordtype">int</span> i,ii,blockj,nnzmats,info; <a name="l00694"></a>00694 <span class="keywordtype">double</span> scl=0; <a name="l00695"></a>00695 <a class="code" href="structDSDPDataMat__C.html" title="Symmetric data matrix for one block in the semidefinite cone.">DSDPDataMat</a> AA; <a name="l00696"></a>00696 DSDPIndex IS; <a name="l00697"></a>00697 <a class="code" href="structDSDPVMat__C.html" title="Dense symmetric matrix for one block in the semidefinite cone.">DSDPVMat</a> T; <a name="l00698"></a>00698 <a class="code" href="structDSDPDSMat__C.html" title="Symmetric Delta S matrix for one block in the semidefinite cone.">DSDPDSMat</a> DS; <a name="l00699"></a>00699 <a class="code" href="structDSDPDualMat__C.html" title="Represents an S matrix for one block in the semidefinite cone.">DSDPDualMat</a> S1,S2; <a name="l00700"></a>00700 <a class="code" href="structSDPConeVec__C.html" title="Vector whose length corresponds to dimension of a block in a cone.">SDPConeVec</a> W,W2; <a name="l00701"></a>00701 DSDPFunctionBegin; <a name="l00702"></a>00702 <span class="keywordflow">for</span> (blockj=0; blockj<sdpcone->nblocks; blockj++){ <a name="l00703"></a>00703 T=sdpcone->blk[blockj].T;DS=sdpcone->blk[blockj].DS; <a name="l00704"></a>00704 W=sdpcone->blk[blockj].W;W2=sdpcone->blk[blockj].W2; <a name="l00705"></a>00705 S1=sdpcone->blk[blockj].S;S2=sdpcone->blk[blockj].SS; <a name="l00706"></a>00706 IS=sdpcone->blk[blockj].IS; <a name="l00707"></a>00707 printf(<span class="stringliteral">"Block: %d\n"</span>,blockj); <a name="l00708"></a>00708 info=<a class="code" href="dsdpxmat_8c.html#ac754c2e4d97bfe8c7245ccb8be67d5d3" title="Test correctness of operations.">DSDPVMatCheck</a>(T,W,W2);DSDPCHKERR(info); <a name="l00709"></a>00709 info=DSDPDSMatCheck(DS,W,W2,T);DSDPCHKERR(info); <a name="l00710"></a>00710 info=DSDPDualMatCheck(S1,W,W2,IS,T);DSDPCHKERR(info); <a name="l00711"></a>00711 info=DSDPDualMatCheck(S2,W,W2,IS,T);DSDPCHKERR(info); <a name="l00712"></a>00712 <a name="l00713"></a>00713 info=<a class="code" href="dsdpblock_8c.html#aa48f55168b6780852229dea20c3f1d38" title="Count how many data matrices are in a block of data.">DSDPBlockCountNonzeroMatrices</a>(&sdpcone->blk[blockj].ADATA,&nnzmats);DSDPCHKERR(info); <a name="l00714"></a>00714 <span class="keywordflow">for</span> (ii=0;ii<nnzmats;ii++){ <a name="l00715"></a>00715 info=<a class="code" href="dsdpblock_8c.html#a4154d7692828019b8f2d0f407310188c" title="Get a data matrix from a block of data.">DSDPBlockGetMatrix</a>(&sdpcone->blk[blockj].ADATA,ii,&i,&scl,&AA);DSDPCHKERR(info); <a name="l00716"></a>00716 <span class="keywordflow">if</span> (i==0) <span class="keywordflow">continue</span>; <a name="l00717"></a>00717 printf(<span class="stringliteral">" Variable: %d, \n"</span>,i); <a name="l00718"></a>00718 info=<a class="code" href="dsdpblock_8c.html#a208f2d363a32877ae6ed1411889d1f13" title="Check correctness of operations on the data.">DSDPDataMatCheck</a>(AA,W,IS,T);DSDPCHKERR(info); <a name="l00719"></a>00719 } <a name="l00720"></a>00720 } <a name="l00721"></a>00721 DSDPFunctionReturn(0); <a name="l00722"></a>00722 } </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>