<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>SuperLU: SRC/slu_dcomplex.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.5 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main Page</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>
</ul>
</div>
<h1>SRC/slu_dcomplex.h</h1><a href="slu__dcomplex_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
<a name="l00014"></a>00014 <span class="preprocessor">#ifndef __SUPERLU_DCOMPLEX </span><span class="comment">/* allow multiple inclusions */</span>
<a name="l00015"></a>00015 <span class="preprocessor">#define __SUPERLU_DCOMPLEX</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span>
<a name="l00017"></a>00017
<a name="l00018"></a>00018 <span class="preprocessor">#ifndef DCOMPLEX_INCLUDE</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define DCOMPLEX_INCLUDE</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00021"></a><a class="code" href="structdoublecomplex.html#7b1a3f489cadc006bfe2fda973267af6">00021</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ <span class="keywordtype">double</span> r, i; } <a class="code" href="structdoublecomplex.html">doublecomplex</a>;
<a name="l00022"></a>00022
<a name="l00023"></a>00023
<a name="l00024"></a>00024 <span class="comment">/* Macro definitions */</span>
<a name="l00025"></a>00025
<a name="l00027"></a><a class="code" href="slu__dcomplex_8h.html#35daa816dd5911bdb075aba8856f9cf0">00027</a> <span class="preprocessor">#define z_add(c, a, b) { (c)->r = (a)->r + (b)->r; \</span>
<a name="l00028"></a>00028 <span class="preprocessor"> (c)->i = (a)->i + (b)->i; }</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span>
<a name="l00031"></a><a class="code" href="slu__dcomplex_8h.html#8d01f55090621b481fcec184a2012ffb">00031</a> <span class="preprocessor">#define z_sub(c, a, b) { (c)->r = (a)->r - (b)->r; \</span>
<a name="l00032"></a>00032 <span class="preprocessor"> (c)->i = (a)->i - (b)->i; }</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00035"></a><a class="code" href="slu__dcomplex_8h.html#aa361695d091f77d512454ddbee3b2b3">00035</a> <span class="preprocessor">#define zd_mult(c, a, b) { (c)->r = (a)->r * (b); \</span>
<a name="l00036"></a>00036 <span class="preprocessor"> (c)->i = (a)->i * (b); }</span>
<a name="l00037"></a>00037 <span class="preprocessor"></span>
<a name="l00039"></a><a class="code" href="slu__dcomplex_8h.html#008009fa4c5e6733f840478ceb0fb8ae">00039</a> <span class="preprocessor">#define zz_mult(c, a, b) { \</span>
<a name="l00040"></a>00040 <span class="preprocessor"> double cr, ci; \</span>
<a name="l00041"></a>00041 <span class="preprocessor"> cr = (a)->r * (b)->r - (a)->i * (b)->i; \</span>
<a name="l00042"></a>00042 <span class="preprocessor"> ci = (a)->i * (b)->r + (a)->r * (b)->i; \</span>
<a name="l00043"></a>00043 <span class="preprocessor"> (c)->r = cr; \</span>
<a name="l00044"></a>00044 <span class="preprocessor"> (c)->i = ci; \</span>
<a name="l00045"></a>00045 <span class="preprocessor"> }</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span>
<a name="l00047"></a><a class="code" href="slu__dcomplex_8h.html#8c08104b0130f14f6f40f17bee239e80">00047</a> <span class="preprocessor">#define zz_conj(a, b) { \</span>
<a name="l00048"></a>00048 <span class="preprocessor"> (a)->r = (b)->r; \</span>
<a name="l00049"></a>00049 <span class="preprocessor"> (a)->i = -((b)->i); \</span>
<a name="l00050"></a>00050 <span class="preprocessor"> }</span>
<a name="l00051"></a>00051 <span class="preprocessor"></span>
<a name="l00053"></a><a class="code" href="slu__dcomplex_8h.html#fe2eaa3195b69824be150f4163f8d056">00053</a> <span class="preprocessor">#define z_eq(a, b) ( (a)->r == (b)->r && (a)->i == (b)->i )</span>
<a name="l00054"></a>00054 <span class="preprocessor"></span>
<a name="l00055"></a>00055
<a name="l00056"></a>00056 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
<a name="l00058"></a>00058 <span class="preprocessor">#endif</span>
<a name="l00059"></a>00059 <span class="preprocessor"></span>
<a name="l00060"></a>00060 <span class="comment">/* Prototypes for functions in dcomplex.c */</span>
<a name="l00061"></a>00061 <span class="keywordtype">void</span> <a class="code" href="dcomplex_8c.html#4cfde2671a83833a15c5b48517781db0" title="Complex Division c = a/b.">z_div</a>(<a class="code" href="structdoublecomplex.html">doublecomplex</a> *, <a class="code" href="structdoublecomplex.html">doublecomplex</a> *, <a class="code" href="structdoublecomplex.html">doublecomplex</a> *);
<a name="l00062"></a>00062 <span class="keywordtype">double</span> <a class="code" href="dcomplex_8c.html#f701b1c549ee8dcf6767742a91681b55" title="Returns sqrt(z.r^2 + z.i^2).">z_abs</a>(<a class="code" href="structdoublecomplex.html">doublecomplex</a> *); <span class="comment">/* exact */</span>
<a name="l00063"></a>00063 <span class="keywordtype">double</span> <a class="code" href="dcomplex_8c.html#47b00c33108809a1a9a94ffea7ef2097" title="Approximates the abs. Returns abs(z.r) + abs(z.i).">z_abs1</a>(<a class="code" href="structdoublecomplex.html">doublecomplex</a> *); <span class="comment">/* approximate */</span>
<a name="l00064"></a>00064 <span class="keywordtype">void</span> <a class="code" href="dcomplex_8c.html#b03337c37aa8b70db9a3bac9368fb06c" title="Return the exponentiation.">z_exp</a>(<a class="code" href="structdoublecomplex.html">doublecomplex</a> *, <a class="code" href="structdoublecomplex.html">doublecomplex</a> *);
<a name="l00065"></a>00065 <span class="keywordtype">void</span> <a class="code" href="dcomplex_8c.html#753978ee017e26dbdab16a40cf45b2cb" title="Return the complex conjugate.">d_cnjg</a>(<a class="code" href="structdoublecomplex.html">doublecomplex</a> *r, <a class="code" href="structdoublecomplex.html">doublecomplex</a> *z);
<a name="l00066"></a>00066 <span class="keywordtype">double</span> <a class="code" href="dcomplex_8c.html#58f08c15442d32d787301386ed99ac01" title="Return the imaginary part.">d_imag</a>(<a class="code" href="structdoublecomplex.html">doublecomplex</a> *);
<a name="l00067"></a>00067 <a class="code" href="structdoublecomplex.html">doublecomplex</a> <a class="code" href="dcomplex_8c.html#36451f8af6b7bd3a4d5f655ead8d5ee4" title="SIGN functions for complex number. Returns z/abs(z).">z_sgn</a>(<a class="code" href="structdoublecomplex.html">doublecomplex</a> *);
<a name="l00068"></a>00068 <a class="code" href="structdoublecomplex.html">doublecomplex</a> <a class="code" href="dcomplex_8c.html#29f4b8ea3e1309c47c2b1f783c6efa89" title="Square-root of a complex number.">z_sqrt</a>(<a class="code" href="structdoublecomplex.html">doublecomplex</a> *);
<a name="l00069"></a>00069
<a name="l00070"></a>00070
<a name="l00071"></a>00071
<a name="l00072"></a>00072 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00073"></a>00073 <span class="preprocessor"></span> }
<a name="l00074"></a>00074 <span class="preprocessor">#endif</span>
<a name="l00075"></a>00075 <span class="preprocessor"></span>
<a name="l00076"></a>00076 <span class="preprocessor">#endif</span>
<a name="l00077"></a>00077 <span class="preprocessor"></span>
<a name="l00078"></a>00078 <span class="preprocessor">#endif </span><span class="comment">/* __SUPERLU_DCOMPLEX */</span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Mon Nov 22 10:23:47 2010 for SuperLU by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
</body>
</html>