<!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_small.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_cb17ad2bab547ae9db055464c7b276b8.html">small</a>      </li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">dsymatrix_small.hpp File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><a href="dsymatrix__small_8hpp_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdsymatrix__small.html">dsymatrix_small&lt; n &gt;</a></td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Samll Real Double-precision Symmetric Matrix Class.  <a href="classdsymatrix__small.html#details">More...</a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsymatrix__small_8hpp.html#a1bcb37497c63aa8087d37a586ccc871e">det</a> (const dsymat2 &amp;)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">dsymat2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsymatrix__small_8hpp.html#a8bbb765bd40d6d370c7f185f02516e1c">inv</a> (const dsymat2 &amp;)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">dsymat2&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsymatrix__small_8hpp.html#a0a71f056942df24040a173cfde321254">rotate</a> (const dsymat2 &amp;, const double &amp;)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsymatrix__small_8hpp.html#a6e6cd52c8d1f5e23070ccfa1a5d8d3bf">det</a> (const dsymat3 &amp;)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">dsymat3&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsymatrix__small_8hpp.html#a55ba7253f3bc2023440e5e97bb74ee70">inv</a> (const dsymat3 &amp;)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">dsymat3&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="dsymatrix__small_8hpp.html#a439da5f2564fc8b616bef28f93c5bf3d">rotate</a> (const dsymat3 &amp;, const dquater &amp;)</td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="a1bcb37497c63aa8087d37a586ccc871e"></a><!-- doxytag: member="dsymatrix_small.hpp::det" ref="a1bcb37497c63aa8087d37a586ccc871e" args="(const dsymat2 &amp;)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double <a class="el" href="zhematrix__small_8hpp.html#aeb24837c2b2dc8db2b384ea4117c4d7d">det</a> </td>
          <td>(</td>
          <td class="paramtype">const dsymat2 &amp;&#160;</td>
          <td class="paramname"><em>A</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>calculate determinant </p>

<p>Definition at line <a class="el" href="dsymatrix__small-specialized_8hpp_source.html#l00003">3</a> of file <a class="el" href="dsymatrix__small-specialized_8hpp_source.html">dsymatrix_small-specialized.hpp</a>.</p>
<div class="fragment"><pre class="fragment">{VERBOSE_REPORT;
  <span class="keywordflow">return</span> A(0,0)*A(1,1) -A(1,0)*A(1,0);
}
</pre></div>
</div>
</div>
<a class="anchor" id="a8bbb765bd40d6d370c7f185f02516e1c"></a><!-- doxytag: member="dsymatrix_small.hpp::inv" ref="a8bbb765bd40d6d370c7f185f02516e1c" args="(const dsymat2 &amp;)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dsymat2 <a class="el" href="zhematrix__small_8hpp.html#acc702ee065b3cac5af9247b61715f4b2">inv</a> </td>
          <td>(</td>
          <td class="paramtype">const dsymat2 &amp;&#160;</td>
          <td class="paramname"><em>A</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>calculate inverse </p>

<p>Definition at line <a class="el" href="dsymatrix__small-specialized_8hpp_source.html#l00010">10</a> of file <a class="el" href="dsymatrix__small-specialized_8hpp_source.html">dsymatrix_small-specialized.hpp</a>.</p>

<p>References <a class="el" href="dgematrix__small-specialized_8hpp_source.html#l00003">det()</a>.</p>
<div class="fragment"><pre class="fragment">{VERBOSE_REPORT;
  <span class="keyword">const</span> <span class="keywordtype">double</span> Adet( <a class="code" href="dgematrix__small-specialized_8hpp.html#a74dda59225405b0940dc395b6f682596">det</a>(A) );
  dsymat2 Ainv;
  Ainv(0,0)= A(1,1)/Adet;
  Ainv(1,0)=-A(1,0)/Adet;  Ainv(1,1)= A(0,0)/Adet;
  <span class="keywordflow">return</span> Ainv;
}
</pre></div>
</div>
</div>
<a class="anchor" id="a0a71f056942df24040a173cfde321254"></a><!-- doxytag: member="dsymatrix_small.hpp::rotate" ref="a0a71f056942df24040a173cfde321254" args="(const dsymat2 &amp;, const double &amp;)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dsymat2 <a class="el" href="dsymatrix__small_8hpp.html#a439da5f2564fc8b616bef28f93c5bf3d">rotate</a> </td>
          <td>(</td>
          <td class="paramtype">const dsymat2 &amp;&#160;</td>
          <td class="paramname"><em>m</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const double &amp;&#160;</td>
          <td class="paramname"><em>theta</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>return 2x2 rotated tensor </p>

<p>Definition at line <a class="el" href="dsymatrix__small-specialized_8hpp_source.html#l00021">21</a> of file <a class="el" href="dsymatrix__small-specialized_8hpp_source.html">dsymatrix_small-specialized.hpp</a>.</p>
<div class="fragment"><pre class="fragment">{VERBOSE_REPORT;
  <span class="keywordtype">double</span> c(cos(theta)), s(sin(theta));
  <span class="keywordtype">double</span> cc(c*c), cs(c*s), ss(s*s);
  dsymat2 mat;
  mat(0,0) =m(0,0)*cc -2.*m(1,0)*cs       +m(1,1)*ss;
  mat(1,0) =m(1,0)*cc +(m(0,0)-m(1,1))*cs -m(1,0)*ss;
  mat(1,1) =m(1,1)*cc +2.*m(1,0)*cs       +m(0,0)*ss;
  <span class="keywordflow">return</span> mat;
}
</pre></div>
</div>
</div>
<a class="anchor" id="a6e6cd52c8d1f5e23070ccfa1a5d8d3bf"></a><!-- doxytag: member="dsymatrix_small.hpp::det" ref="a6e6cd52c8d1f5e23070ccfa1a5d8d3bf" args="(const dsymat3 &amp;)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double <a class="el" href="zhematrix__small_8hpp.html#aeb24837c2b2dc8db2b384ea4117c4d7d">det</a> </td>
          <td>(</td>
          <td class="paramtype">const dsymat3 &amp;&#160;</td>
          <td class="paramname"><em>A</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>calculate determinant </p>

<p>Definition at line <a class="el" href="dsymatrix__small-specialized_8hpp_source.html#l00044">44</a> of file <a class="el" href="dsymatrix__small-specialized_8hpp_source.html">dsymatrix_small-specialized.hpp</a>.</p>
<div class="fragment"><pre class="fragment">{VERBOSE_REPORT;
  <span class="keywordflow">return</span>
    +A(0,0)*A(1,1)*A(2,2) -A(0,0)*A(2,1)*A(2,1)
    +A(1,0)*A(2,1)*A(2,0) -A(1,0)*A(1,0)*A(2,2)
    +A(2,0)*A(1,0)*A(2,1) -A(2,0)*A(1,1)*A(2,0);
}
</pre></div>
</div>
</div>
<a class="anchor" id="a55ba7253f3bc2023440e5e97bb74ee70"></a><!-- doxytag: member="dsymatrix_small.hpp::inv" ref="a55ba7253f3bc2023440e5e97bb74ee70" args="(const dsymat3 &amp;)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dsymat3 <a class="el" href="zhematrix__small_8hpp.html#acc702ee065b3cac5af9247b61715f4b2">inv</a> </td>
          <td>(</td>
          <td class="paramtype">const dsymat3 &amp;&#160;</td>
          <td class="paramname"><em>A</em></td><td>)</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>calculate inverse </p>

<p>Definition at line <a class="el" href="dsymatrix__small-specialized_8hpp_source.html#l00054">54</a> of file <a class="el" href="dsymatrix__small-specialized_8hpp_source.html">dsymatrix_small-specialized.hpp</a>.</p>

<p>References <a class="el" href="dgematrix__small-specialized_8hpp_source.html#l00003">det()</a>.</p>
<div class="fragment"><pre class="fragment">{VERBOSE_REPORT;
  <span class="keyword">const</span> <span class="keywordtype">double</span> Adet( <a class="code" href="dgematrix__small-specialized_8hpp.html#a74dda59225405b0940dc395b6f682596">det</a>(A) );
  dsymat3 Ainv;
  Ainv(0,0) =(A(1,1)*A(2,2)-A(2,1)*A(2,1))/Adet;
  Ainv(1,0) =(A(2,1)*A(2,0)-A(1,0)*A(2,2))/Adet;
  Ainv(1,1) =(A(0,0)*A(2,2)-A(2,0)*A(2,0))/Adet;
  Ainv(2,0) =(A(1,0)*A(2,1)-A(1,1)*A(2,0))/Adet;
  Ainv(2,1) =(A(1,0)*A(2,0)-A(0,0)*A(2,1))/Adet;
  Ainv(2,2) =(A(0,0)*A(1,1)-A(1,0)*A(1,0))/Adet;
  <span class="keywordflow">return</span> Ainv;
}
</pre></div>
</div>
</div>
<a class="anchor" id="a439da5f2564fc8b616bef28f93c5bf3d"></a><!-- doxytag: member="dsymatrix_small.hpp::rotate" ref="a439da5f2564fc8b616bef28f93c5bf3d" args="(const dsymat3 &amp;, const dquater &amp;)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">dsymat3 <a class="el" href="dsymatrix__small_8hpp.html#a439da5f2564fc8b616bef28f93c5bf3d">rotate</a> </td>
          <td>(</td>
          <td class="paramtype">const dsymat3 &amp;&#160;</td>
          <td class="paramname"><em>m</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const dquater &amp;&#160;</td>
          <td class="paramname"><em>q</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="dsymatrix__small-specialized_8hpp_source.html#l00069">69</a> of file <a class="el" href="dsymatrix__small-specialized_8hpp_source.html">dsymatrix_small-specialized.hpp</a>.</p>

<p>References <a class="el" href="__dgbmatrix-calc_8hpp_source.html#l00019">i()</a>, and <a class="el" href="dcovector__small-specialized_8hpp_source.html#l00161">q2m()</a>.</p>
<div class="fragment"><pre class="fragment">{VERBOSE_REPORT;
  dgemat3 R =<a class="code" href="dcovector__small-specialized_8hpp.html#a0b8662d50893bcd25e2d80f468b721f5">q2m</a>(q);
  dgemat3 Rm =R*m;
  
  dsymat3 RmRT;<span class="comment">//not dgemat3</span>
  RmRT.zero();
  <span class="keywordflow">for</span>(<span class="keywordtype">long</span> <a class="code" href="__dgbmatrix-calc_8hpp.html#af7c79b3740ba9c1d547f55ac94bc1258">i</a>=0; <a class="code" href="__dgbmatrix-calc_8hpp.html#af7c79b3740ba9c1d547f55ac94bc1258">i</a>&lt;3; <a class="code" href="__dgbmatrix-calc_8hpp.html#af7c79b3740ba9c1d547f55ac94bc1258">i</a>++){
    <span class="keywordflow">for</span>(<span class="keywordtype">long</span> j=0; j&lt;=<a class="code" href="__dgbmatrix-calc_8hpp.html#af7c79b3740ba9c1d547f55ac94bc1258">i</a>; j++){
      <span class="keywordflow">for</span>(<span class="keywordtype">long</span> k=0; k&lt;3; k++){
        RmRT(<a class="code" href="__dgbmatrix-calc_8hpp.html#af7c79b3740ba9c1d547f55ac94bc1258">i</a>,j) +=Rm(<a class="code" href="__dgbmatrix-calc_8hpp.html#af7c79b3740ba9c1d547f55ac94bc1258">i</a>,k)*R(j,k);
      }
    }
  }
  <span class="keywordflow">return</span> RmRT;
}
</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>
