<!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>CPPLapack: dsymatrix-calc.hpp File Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">CPPLapack
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</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>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="dir_a37d0dd275f7ec49ee26f1d33d1059f5.html">include</a>      </li>
      <li class="navelem"><a class="el" href="dir_19fe6fec48ebb32a77b25b76521af88b.html">dsymatrix-</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">dsymatrix-calc.hpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><a href="dsymatrix-calc_8hpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class__dsymatrix.html">_dsymatrix</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsymatrix-calc_8hpp.html#a80186013d5ec13c51fb777e1529f3de1">t</a> (const <a class="el" href="classdsymatrix.html">dsymatrix</a> &amp;mat)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class__dsymatrix.html">_dsymatrix</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsymatrix-calc_8hpp.html#ab60f1da7386ac7655533349f5e5cf870">i</a> (const <a class="el" href="classdsymatrix.html">dsymatrix</a> &amp;mat)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsymatrix-calc_8hpp.html#a4faf823f7a52a4f9da6dbd4c8d3d87f3">idamax</a> (long &amp;<a class="el" href="zhematrix-calc_8hpp.html#ac771bfd10987fa7433f15259476f25fc">i</a>, long &amp;j, const <a class="el" href="classdsymatrix.html">dsymatrix</a> &amp;mat)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsymatrix-calc_8hpp.html#ab5fc9cd37dd9395c1759ff01edce21e4">damax</a> (const <a class="el" href="classdsymatrix.html">dsymatrix</a> &amp;mat)</td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a80186013d5ec13c51fb777e1529f3de1"></a><!-- doxytag: member="dsymatrix&#45;calc.hpp::t" ref="a80186013d5ec13c51fb777e1529f3de1" args="(const dsymatrix &amp;mat)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class__dsymatrix.html">_dsymatrix</a> <a class="el" href="zrovector-calc_8hpp.html#ad500dfc3f8af25ed0ef176c8f9249fcc">t</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classdsymatrix.html">dsymatrix</a> &amp;&#160;</td>
          <td class="paramname"><em>mat</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>return transposed dgematrix </p>

<p>Definition at line <a class="el" href="dsymatrix-calc_8hpp_source.html#l00003">3</a> of file <a class="el" href="dsymatrix-calc_8hpp_source.html">dsymatrix-calc.hpp</a>.</p>

<p>References <a class="el" href="dcovector-misc_8hpp_source.html#l00134">_()</a>.</p>
<div class="fragment"><pre class="fragment">{VERBOSE_REPORT;
<span class="preprocessor">#ifdef  CPPL_DEBUG</span>
<span class="preprocessor"></span>  WARNING_REPORT;
  std::cerr &lt;&lt; <span class="stringliteral">&quot;This function call has no effect since the matrix is symmetric.&quot;</span> &lt;&lt; std::endl;
<span class="preprocessor">#endif//CPPL_DEBUG</span>
<span class="preprocessor"></span>  
  <a class="code" href="classdsymatrix.html" title="Real Double-precision Symmetric Matrix Class [l-type (UPLO=l) Strage].">dsymatrix</a> newmat(mat);
  <span class="keywordflow">return</span> <a class="code" href="dcovector-misc_8hpp.html#a297beda6502b0d92c99576d2fb9548cb">_</a>(newmat);
}
</pre></div>
</div>
</div>
<a class="anchor" id="ab60f1da7386ac7655533349f5e5cf870"></a><!-- doxytag: member="dsymatrix&#45;calc.hpp::i" ref="ab60f1da7386ac7655533349f5e5cf870" args="(const dsymatrix &amp;mat)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class__dsymatrix.html">_dsymatrix</a> <a class="el" href="zhematrix-calc_8hpp.html#ac771bfd10987fa7433f15259476f25fc">i</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classdsymatrix.html">dsymatrix</a> &amp;&#160;</td>
          <td class="paramname"><em>mat</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>return its inverse matrix </p>

<p>Definition at line <a class="el" href="dsymatrix-calc_8hpp_source.html#l00016">16</a> of file <a class="el" href="dsymatrix-calc_8hpp_source.html">dsymatrix-calc.hpp</a>.</p>

<p>References <a class="el" href="dcovector-misc_8hpp_source.html#l00134">_()</a>, <a class="el" href="dsymatrix_8hpp_source.html#l00011">dsymatrix::array</a>, <a class="el" href="dsymatrix-misc_8hpp_source.html#l00035">dsymatrix::identity()</a>, and <a class="el" href="dsymatrix_8hpp_source.html#l00010">dsymatrix::n</a>.</p>
<div class="fragment"><pre class="fragment">{VERBOSE_REPORT;
  <a class="code" href="classdsymatrix.html" title="Real Double-precision Symmetric Matrix Class [l-type (UPLO=l) Strage].">dsymatrix</a> mat_cp(mat);
  <a class="code" href="classdsymatrix.html" title="Real Double-precision Symmetric Matrix Class [l-type (UPLO=l) Strage].">dsymatrix</a> mat_inv(mat.<a class="code" href="classdsymatrix.html#a4a2ca7ec3f2b7bd62139777fbb6ad1a9" title="matrix column size">n</a>);
  mat_inv.identity();
  
  <span class="keywordtype">char</span> UPLO(<span class="charliteral">&#39;l&#39;</span>);
  <span class="keywordtype">long</span> NRHS(mat.<a class="code" href="classdsymatrix.html#a4a2ca7ec3f2b7bd62139777fbb6ad1a9" title="matrix column size">n</a>), LDA(mat.<a class="code" href="classdsymatrix.html#a4a2ca7ec3f2b7bd62139777fbb6ad1a9" title="matrix column size">n</a>), *IPIV(<span class="keyword">new</span> <span class="keywordtype">long</span>[mat.<a class="code" href="classdsymatrix.html#a4a2ca7ec3f2b7bd62139777fbb6ad1a9" title="matrix column size">n</a>]), LDB(mat.<a class="code" href="classdsymatrix.html#a4a2ca7ec3f2b7bd62139777fbb6ad1a9" title="matrix column size">n</a>), LWORK(-1), INFO(1);
  <span class="keywordtype">double</span> *WORK( <span class="keyword">new</span> <span class="keywordtype">double</span>[1] );
  dsysv_(UPLO, mat.<a class="code" href="classdsymatrix.html#a4a2ca7ec3f2b7bd62139777fbb6ad1a9" title="matrix column size">n</a>, NRHS, mat_cp.array, LDA, IPIV, mat_inv.array, LDB, WORK, LWORK, INFO);
  LWORK = long(WORK[0]);
  <span class="keyword">delete</span> [] WORK;  WORK = <span class="keyword">new</span> <span class="keywordtype">double</span>[LWORK];
  dsysv_(UPLO, mat.<a class="code" href="classdsymatrix.html#a4a2ca7ec3f2b7bd62139777fbb6ad1a9" title="matrix column size">n</a>, NRHS, mat_cp.array, LDA, IPIV, mat_inv.array, LDB, WORK, LWORK, INFO);
  <span class="keyword">delete</span> [] WORK; <span class="keyword">delete</span> [] IPIV;
  <span class="keywordflow">if</span>(INFO!=0){
    WARNING_REPORT;
    std::cerr &lt;&lt; <span class="stringliteral">&quot;Serious trouble happend. INFO = &quot;</span> &lt;&lt; INFO &lt;&lt; <span class="stringliteral">&quot;.&quot;</span> &lt;&lt; std::endl;
  }
  
  <span class="keywordflow">return</span> <a class="code" href="dcovector-misc_8hpp.html#a297beda6502b0d92c99576d2fb9548cb">_</a>(mat_inv);
}
</pre></div>
</div>
</div>
<a class="anchor" id="a4faf823f7a52a4f9da6dbd4c8d3d87f3"></a><!-- doxytag: member="dsymatrix&#45;calc.hpp::idamax" ref="a4faf823f7a52a4f9da6dbd4c8d3d87f3" args="(long &amp;i, long &amp;j, const dsymatrix &amp;mat)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void <a class="el" href="zrovector-calc_8hpp.html#aed93f65dbbeec9dac1f8feb12770dba1">idamax</a> </td>
          <td>(</td>
          <td class="paramtype">long &amp;&#160;</td>
          <td class="paramname"><em>i</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long &amp;&#160;</td>
          <td class="paramname"><em>j</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classdsymatrix.html">dsymatrix</a> &amp;&#160;</td>
          <td class="paramname"><em>mat</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>search the index of element having the largest absolute value in 0-based numbering system </p>

<p>Definition at line <a class="el" href="dsymatrix-calc_8hpp_source.html#l00046">46</a> of file <a class="el" href="dsymatrix-calc_8hpp_source.html">dsymatrix-calc.hpp</a>.</p>

<p>References <a class="el" href="dsymatrix_8hpp_source.html#l00012">dsymatrix::darray</a>, <a class="el" href="dsymatrix_8hpp_source.html#l00009">dsymatrix::m</a>, and <a class="el" href="dsymatrix_8hpp_source.html#l00010">dsymatrix::n</a>.</p>
<div class="fragment"><pre class="fragment">{VERBOSE_REPORT;
  <a class="code" href="__dgbmatrix-calc_8hpp.html#af7c79b3740ba9c1d547f55ac94bc1258">i</a>=j=0;
  <span class="keywordtype">double</span> val(0.);
  <span class="keywordflow">for</span>(<span class="keywordtype">long</span> J=0; J&lt;mat.<a class="code" href="classdsymatrix.html#a4a2ca7ec3f2b7bd62139777fbb6ad1a9" title="matrix column size">n</a>; J++){
    <span class="keywordtype">long</span> I( J +idamax_(mat.<a class="code" href="classdsymatrix.html#a955f345240dab42d931f4c8700dc43d5" title="matrix row size">m</a>-J, mat.<a class="code" href="classdsymatrix.html#a786e420fb2551cffb147af789197a681" title="array of pointers of column head addresses">darray</a>[J]+J, 1) -1 );
    <span class="keywordflow">if</span>( val&lt;fabs(mat.<a class="code" href="classdsymatrix.html#a786e420fb2551cffb147af789197a681" title="array of pointers of column head addresses">darray</a>[J][I]) ){
      val =fabs(mat.<a class="code" href="classdsymatrix.html#a786e420fb2551cffb147af789197a681" title="array of pointers of column head addresses">darray</a>[J][I]);
      <a class="code" href="__dgbmatrix-calc_8hpp.html#af7c79b3740ba9c1d547f55ac94bc1258">i</a>=I;
      j=J;
    }
  }
}
</pre></div>
</div>
</div>
<a class="anchor" id="ab5fc9cd37dd9395c1759ff01edce21e4"></a><!-- doxytag: member="dsymatrix&#45;calc.hpp::damax" ref="ab5fc9cd37dd9395c1759ff01edce21e4" args="(const dsymatrix &amp;mat)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double <a class="el" href="zrovector-calc_8hpp.html#a3a716f0e4e20337e57371acb84ea0d1f">damax</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classdsymatrix.html">dsymatrix</a> &amp;&#160;</td>
          <td class="paramname"><em>mat</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>return its largest absolute value </p>

<p>Definition at line <a class="el" href="dsymatrix-calc_8hpp_source.html#l00062">62</a> of file <a class="el" href="dsymatrix-calc_8hpp_source.html">dsymatrix-calc.hpp</a>.</p>

<p>References <a class="el" href="__dgbmatrix-calc_8hpp_source.html#l00019">i()</a>, and <a class="el" href="__dcovector-calc_8hpp_source.html#l00027">idamax()</a>.</p>
<div class="fragment"><pre class="fragment">{VERBOSE_REPORT;
  <span class="keywordtype">long</span> <a class="code" href="__dgbmatrix-calc_8hpp.html#af7c79b3740ba9c1d547f55ac94bc1258">i</a>,j;
  <a class="code" href="__dcovector-calc_8hpp.html#a250895c0528a387beace5e285fe82354">idamax</a>(i, j, mat);
  <span class="keywordflow">return</span> mat(i,j);
}
</pre></div>
</div>
</div>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Friends</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
