<!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_scomplex.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_scomplex.h</h1><a href="slu__scomplex_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_SCOMPLEX </span><span class="comment">/* allow multiple inclusions */</span>
<a name="l00015"></a>00015 <span class="preprocessor">#define __SUPERLU_SCOMPLEX</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span>
<a name="l00017"></a>00017
<a name="l00018"></a>00018 <span class="preprocessor">#ifndef SCOMPLEX_INCLUDE</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define SCOMPLEX_INCLUDE</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00021"></a><a class="code" href="structcomplex.html#6b24d5cc84eef41dbe90b79e93de030f">00021</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>{ <span class="keywordtype">float</span> r, i; } <a class="code" href="structcomplex.html">complex</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__scomplex_8h.html#f3df9377099fd2cba886d217734ce884">00027</a> <span class="preprocessor">#define c_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__scomplex_8h.html#0fe6bb9dac5f735dd69a127519a9c841">00031</a> <span class="preprocessor">#define c_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__scomplex_8h.html#a675d825b907fe4d939ddc2533b38bb8">00035</a> <span class="preprocessor">#define cs_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__scomplex_8h.html#515037047a218e7f77c4f495b1d6abca">00039</a> <span class="preprocessor">#define cc_mult(c, a, b) { \</span>
<a name="l00040"></a>00040 <span class="preprocessor"> float 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__scomplex_8h.html#c917679ece23ee5f61e994fb56b30e1c">00047</a> <span class="preprocessor">#define cc_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__scomplex_8h.html#82b7c0f8931b82e92d24a076eab0e82e">00053</a> <span class="preprocessor">#define c_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 scomplex.c */</span>
<a name="l00061"></a>00061 <span class="keywordtype">void</span> <a class="code" href="scomplex_8c.html#19814f5030befb85c4bb07e0fac34a7b" title="Complex Division c = a/b.">c_div</a>(<a class="code" href="structcomplex.html">complex</a> *, <a class="code" href="structcomplex.html">complex</a> *, <a class="code" href="structcomplex.html">complex</a> *);
<a name="l00062"></a>00062 <span class="keywordtype">double</span> <a class="code" href="scomplex_8c.html#fc2967f7b71477625eb58de94a6e4c71" title="Returns sqrt(z.r^2 + z.i^2).">c_abs</a>(<a class="code" href="structcomplex.html">complex</a> *); <span class="comment">/* exact */</span>
<a name="l00063"></a>00063 <span class="keywordtype">double</span> <a class="code" href="scomplex_8c.html#6a6e9259e2eadc976a783d1b0e8f013b" title="Approximates the abs. Returns abs(z.r) + abs(z.i).">c_abs1</a>(<a class="code" href="structcomplex.html">complex</a> *); <span class="comment">/* approximate */</span>
<a name="l00064"></a>00064 <span class="keywordtype">void</span> <a class="code" href="scomplex_8c.html#6111d345ee625a35d42da30db28c6041" title="Return the exponentiation.">c_exp</a>(<a class="code" href="structcomplex.html">complex</a> *, <a class="code" href="structcomplex.html">complex</a> *);
<a name="l00065"></a>00065 <span class="keywordtype">void</span> <a class="code" href="scomplex_8c.html#dd0e09f7411e03b7516ddedacd6a59df" title="Return the complex conjugate.">r_cnjg</a>(<a class="code" href="structcomplex.html">complex</a> *, <a class="code" href="structcomplex.html">complex</a> *);
<a name="l00066"></a>00066 <span class="keywordtype">double</span> <a class="code" href="scomplex_8c.html#b6bc19479c8838286f451d5d9a6c86a3" title="Return the imaginary part.">r_imag</a>(<a class="code" href="structcomplex.html">complex</a> *);
<a name="l00067"></a>00067 <a class="code" href="structcomplex.html">complex</a> <a class="code" href="scomplex_8c.html#ee98d3dfc6ee26d36a2e095bd28414e5" title="SIGN functions for complex number. Returns z/abs(z).">c_sgn</a>(<a class="code" href="structcomplex.html">complex</a> *);
<a name="l00068"></a>00068 <a class="code" href="structcomplex.html">complex</a> <a class="code" href="scomplex_8c.html#8e9b533cd4055cb200a5d63152754898" title="Square-root of a complex number.">c_sqrt</a>(<a class="code" href="structcomplex.html">complex</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_SCOMPLEX */</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>