root/doc/html/cfix_8h-source.html @ 354

Revision 353, 37.4 kB (checked in by smidl, 16 years ago)

doc

Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
3<title>mixpp: cfix.h Source File</title>
4<link href="tabs.css" rel="stylesheet" type="text/css">
5<link href="doxygen.css" rel="stylesheet" type="text/css">
6</head><body>
7<!-- Generated by Doxygen 1.5.8 -->
8<script type="text/javascript">
9<!--
10function changeDisplayState (e){
11  var num=this.id.replace(/[^[0-9]/g,'');
12  var button=this.firstChild;
13  var sectionDiv=document.getElementById('dynsection'+num);
14  if (sectionDiv.style.display=='none'||sectionDiv.style.display==''){
15    sectionDiv.style.display='block';
16    button.src='open.gif';
17  }else{
18    sectionDiv.style.display='none';
19    button.src='closed.gif';
20  }
21}
22function initDynSections(){
23  var divs=document.getElementsByTagName('div');
24  var sectionCounter=1;
25  for(var i=0;i<divs.length-1;i++){
26    if(divs[i].className=='dynheader'&&divs[i+1].className=='dynsection'){
27      var header=divs[i];
28      var section=divs[i+1];
29      var button=header.firstChild;
30      if (button!='IMG'){
31        divs[i].insertBefore(document.createTextNode(' '),divs[i].firstChild);
32        button=document.createElement('img');
33        divs[i].insertBefore(button,divs[i].firstChild);
34      }
35      header.style.cursor='pointer';
36      header.onclick=changeDisplayState;
37      header.id='dynheader'+sectionCounter;
38      button.src='closed.gif';
39      section.id='dynsection'+sectionCounter;
40      section.style.display='none';
41      section.style.marginLeft='14px';
42      sectionCounter++;
43    }
44  }
45}
46window.onload = initDynSections;
47-->
48</script>
49<div class="navigation" id="top">
50  <div class="tabs">
51    <ul>
52      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
53      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
54      <li><a href="modules.html"><span>Modules</span></a></li>
55      <li><a href="annotated.html"><span>Classes</span></a></li>
56      <li class="current"><a href="files.html"><span>Files</span></a></li>
57    </ul>
58  </div>
59  <div class="tabs">
60    <ul>
61      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
62      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
63    </ul>
64  </div>
65<h1>cfix.h</h1><a href="cfix_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
66<a name="l00029"></a>00029 <span class="preprocessor">#ifndef CFIX_H</span>
67<a name="l00030"></a>00030 <span class="preprocessor"></span><span class="preprocessor">#define CFIX_H</span>
68<a name="l00031"></a>00031 <span class="preprocessor"></span>
69<a name="l00032"></a>00032 <span class="preprocessor">#include &lt;<a class="code" href="fix_8h.html" title="Definitions of a fixed-point data type Fix.">itpp/fixed/fix.h</a>&gt;</span>
70<a name="l00033"></a>00033
71<a name="l00034"></a>00034
72<a name="l00035"></a>00035 <span class="keyword">namespace </span>itpp
73<a name="l00036"></a>00036 {
74<a name="l00037"></a>00037
75<a name="l00038"></a>00038 <span class="comment">// Forward declarations</span>
76<a name="l00039"></a>00039 <span class="keyword">template</span>&lt;<span class="keyword">class</span> Num_T&gt; <span class="keyword">class </span>Vec;
77<a name="l00040"></a>00040 <span class="keyword">template</span>&lt;<span class="keyword">class</span> Num_T&gt; <span class="keyword">class </span>Mat;
78<a name="l00041"></a>00041
79<a name="l00044"></a>00044
80<a name="l00050"></a><a class="code" href="classitpp_1_1CFix.html">00050</a> <span class="keyword">class </span><a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> : <span class="keyword">public</span> <a class="code" href="classitpp_1_1Fix__Base.html" title="Base class for fixed-point data types.">Fix_Base</a>
81<a name="l00051"></a>00051 {
82<a name="l00052"></a>00052   <span class="keyword">template</span>&lt;<span class="keywordtype">int</span>, e_mode, o_mode, q_mode&gt; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classitpp_1_1CFixed.html" title="Templated complex fixed-point data type.">CFixed</a>;
83<a name="l00053"></a>00053 <span class="keyword">public</span>:
84<a name="l00055"></a><a class="code" href="classitpp_1_1CFix.html#84a43428f4c792b2df635e416a2b6447">00055</a>   <a class="code" href="classitpp_1_1CFix.html#84a43428f4c792b2df635e416a2b6447" title="Default constructor.">CFix</a>(<span class="keywordtype">double</span> r = 0.0, <span class="keywordtype">double</span> i = 0.0, <span class="keywordtype">int</span> s = 0, <span class="keywordtype">int</span> w = <a class="code" href="group__fixed.html#g16660ef1accee4eb3c95d2807c0d7c9c" title="Max word length.">MAX_WORDLEN</a>, <a class="code" href="group__fixed.html#g3a204def662e60bf9bb54d27db09450d" title="Sign encoding modes (aligned with SystemC).">e_mode</a> e = <a class="code" href="group__fixed.html#gg3a204def662e60bf9bb54d27db09450df4bddf5c0c77795974633939360e6e4a" title="Two&amp;#39;s complement.">TC</a>, <a class="code" href="group__fixed.html#g18d0ad4d7280177b761737a7b8b5c45d" title="Overflow modes (aligned with SystemC).">o_mode</a> o = <a class="code" href="group__fixed.html#gg18d0ad4d7280177b761737a7b8b5c45da7ea797d8579a3e2dc82f792e16e946b" title="Wrap-around.">WRAP</a>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a> q = <a class="code" href="group__fixed.html#gga644362f0b3d795ce8521326e20fed110566af00cff42134b7f719254d07bec1" title="Truncation.">TRN</a>, <a class="code" href="classitpp_1_1Stat.html" title="A class for sampling a signal and calculating statistics.">Stat</a> *ptr = 0)
85<a name="l00056"></a>00056       : <a class="code" href="classitpp_1_1Fix__Base.html" title="Base class for fixed-point data types.">Fix_Base</a>(s, w, e, o, q, ptr), <a class="code" href="classitpp_1_1CFix.html#eceddf502d1f1ed429922c0e91843131" title="Real data part.">re</a>(<a class="code" href="classitpp_1_1Fix__Base.html#a881bc83f4be90b9f7fb7f87b0953f25" title="Convert from double to fixrep using shift and quantization mode qmode, then call...">scale_and_apply_modes</a>(r)), <a class="code" href="classitpp_1_1CFix.html#e18a88265bc5d74f27d9f5abbc98c6df" title="Imaginary data part.">im</a>(<a class="code" href="classitpp_1_1Fix__Base.html#a881bc83f4be90b9f7fb7f87b0953f25" title="Convert from double to fixrep using shift and quantization mode qmode, then call...">scale_and_apply_modes</a>(i)) {}
86<a name="l00058"></a><a class="code" href="classitpp_1_1CFix.html#c274e82fd00c1605de86ba500f9cde1b">00058</a>   <a class="code" href="classitpp_1_1CFix.html#84a43428f4c792b2df635e416a2b6447" title="Default constructor.">CFix</a>(std::complex&lt;double&gt; x, <span class="keywordtype">double</span>, <span class="keywordtype">int</span> s = 0, <span class="keywordtype">int</span> w = <a class="code" href="group__fixed.html#g16660ef1accee4eb3c95d2807c0d7c9c" title="Max word length.">MAX_WORDLEN</a>, <a class="code" href="group__fixed.html#g3a204def662e60bf9bb54d27db09450d" title="Sign encoding modes (aligned with SystemC).">e_mode</a> e = <a class="code" href="group__fixed.html#gg3a204def662e60bf9bb54d27db09450df4bddf5c0c77795974633939360e6e4a" title="Two&amp;#39;s complement.">TC</a>, <a class="code" href="group__fixed.html#g18d0ad4d7280177b761737a7b8b5c45d" title="Overflow modes (aligned with SystemC).">o_mode</a> o = <a class="code" href="group__fixed.html#gg18d0ad4d7280177b761737a7b8b5c45da7ea797d8579a3e2dc82f792e16e946b" title="Wrap-around.">WRAP</a>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a> q = <a class="code" href="group__fixed.html#gga644362f0b3d795ce8521326e20fed110566af00cff42134b7f719254d07bec1" title="Truncation.">TRN</a>, <a class="code" href="classitpp_1_1Stat.html" title="A class for sampling a signal and calculating statistics.">Stat</a> *ptr = 0)
87<a name="l00059"></a>00059       : <a class="code" href="classitpp_1_1Fix__Base.html" title="Base class for fixed-point data types.">Fix_Base</a>(s, w, e, o, q, ptr), <a class="code" href="classitpp_1_1CFix.html#eceddf502d1f1ed429922c0e91843131" title="Real data part.">re</a>(<a class="code" href="classitpp_1_1Fix__Base.html#a881bc83f4be90b9f7fb7f87b0953f25" title="Convert from double to fixrep using shift and quantization mode qmode, then call...">scale_and_apply_modes</a>(std::<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>(x))), <a class="code" href="classitpp_1_1CFix.html#e18a88265bc5d74f27d9f5abbc98c6df" title="Imaginary data part.">im</a>(<a class="code" href="classitpp_1_1Fix__Base.html#a881bc83f4be90b9f7fb7f87b0953f25" title="Convert from double to fixrep using shift and quantization mode qmode, then call...">scale_and_apply_modes</a>(std::<a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>(x))) {}
88<a name="l00061"></a><a class="code" href="classitpp_1_1CFix.html#9f447463fcc2e0e03d24da12140dd9bc">00061</a>   <span class="keyword">explicit</span> <a class="code" href="classitpp_1_1CFix.html#84a43428f4c792b2df635e416a2b6447" title="Default constructor.">CFix</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Fix__Factory.html" title="Class factory for fixed-point data types Fix and CFix.">Fix_Factory</a> &amp;f)
89<a name="l00062"></a>00062       : <a class="code" href="classitpp_1_1Fix__Base.html" title="Base class for fixed-point data types.">Fix_Base</a>(0, f.<a class="code" href="classitpp_1_1Fix__Base.html#4872b2d730a546e017a75006a99580a6" title="Word length.">wordlen</a>, f.<a class="code" href="classitpp_1_1Fix__Base.html#9ee6bb0d7811e0ec284c19d6497b0b83" title="Sign encoding mode.">emode</a>, f.<a class="code" href="classitpp_1_1Fix__Base.html#d1b464ea0c3db8fa8c70d9740147ca6c" title="Overflow mode.">omode</a>, f.<a class="code" href="classitpp_1_1Fix__Base.html#cd49b5854e52ef93458f4776e1007b1a" title="Quantization mode.">qmode</a>, f.<a class="code" href="classitpp_1_1Fix__Base.html#a23b1ecd00cd0f0c8fa9b3b5c669a93d" title="Pointer to statistics object.">stat_ptr</a>), <a class="code" href="classitpp_1_1CFix.html#eceddf502d1f1ed429922c0e91843131" title="Real data part.">re</a>(0), <a class="code" href="classitpp_1_1CFix.html#e18a88265bc5d74f27d9f5abbc98c6df" title="Imaginary data part.">im</a>(0) {}
90<a name="l00064"></a><a class="code" href="classitpp_1_1CFix.html#f6237bb89b6c48e22f9950e08e70f856">00064</a>   <a class="code" href="classitpp_1_1CFix.html#84a43428f4c792b2df635e416a2b6447" title="Default constructor.">CFix</a>(<a class="code" href="group__fixed.html#gf3f12ba9f1a5ce9d50ef18fa3b65b5c3" title="Representation for fixed-point data types.">fixrep</a> r, <a class="code" href="group__fixed.html#gf3f12ba9f1a5ce9d50ef18fa3b65b5c3" title="Representation for fixed-point data types.">fixrep</a> i, <span class="keywordtype">int</span> s, <span class="keywordtype">int</span>, <span class="keywordtype">int</span>)
91<a name="l00065"></a>00065       : <a class="code" href="classitpp_1_1Fix__Base.html" title="Base class for fixed-point data types.">Fix_Base</a>(s), <a class="code" href="classitpp_1_1CFix.html#eceddf502d1f1ed429922c0e91843131" title="Real data part.">re</a>(r), <a class="code" href="classitpp_1_1CFix.html#e18a88265bc5d74f27d9f5abbc98c6df" title="Imaginary data part.">im</a>(i) {}
92<a name="l00067"></a><a class="code" href="classitpp_1_1CFix.html#4b7c384eb4871082928c993928bc1bb5">00067</a>   <a class="code" href="classitpp_1_1CFix.html#84a43428f4c792b2df635e416a2b6447" title="Default constructor.">CFix</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &amp;r, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &amp;i = 0.0, <span class="keywordtype">int</span> w = <a class="code" href="group__fixed.html#g16660ef1accee4eb3c95d2807c0d7c9c" title="Max word length.">MAX_WORDLEN</a>, <a class="code" href="group__fixed.html#g3a204def662e60bf9bb54d27db09450d" title="Sign encoding modes (aligned with SystemC).">e_mode</a> e = <a class="code" href="group__fixed.html#gg3a204def662e60bf9bb54d27db09450df4bddf5c0c77795974633939360e6e4a" title="Two&amp;#39;s complement.">TC</a>, <a class="code" href="group__fixed.html#g18d0ad4d7280177b761737a7b8b5c45d" title="Overflow modes (aligned with SystemC).">o_mode</a> o = <a class="code" href="group__fixed.html#gg18d0ad4d7280177b761737a7b8b5c45da7ea797d8579a3e2dc82f792e16e946b" title="Wrap-around.">WRAP</a>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a> q = <a class="code" href="group__fixed.html#gga644362f0b3d795ce8521326e20fed110566af00cff42134b7f719254d07bec1" title="Truncation.">TRN</a>, <a class="code" href="classitpp_1_1Stat.html" title="A class for sampling a signal and calculating statistics.">Stat</a> *ptr = 0)
93<a name="l00068"></a>00068       : <a class="code" href="classitpp_1_1Fix__Base.html" title="Base class for fixed-point data types.">Fix_Base</a>(<a class="code" href="classitpp_1_1CFix.html#8819dcb3be6073cc5c91d842c3e565bc" title="Check that x.shift==y.shift OR x==0 OR y==0 and return the shift (for the non-zero...">assert_shifts</a>(r, i), w, e, o, q, ptr), <a class="code" href="classitpp_1_1CFix.html#eceddf502d1f1ed429922c0e91843131" title="Real data part.">re</a>(r.<a class="code" href="classitpp_1_1CFix.html#eceddf502d1f1ed429922c0e91843131" title="Real data part.">re</a>), <a class="code" href="classitpp_1_1CFix.html#e18a88265bc5d74f27d9f5abbc98c6df" title="Imaginary data part.">im</a>(i.<a class="code" href="classitpp_1_1CFix.html#eceddf502d1f1ed429922c0e91843131" title="Real data part.">re</a>) {}
94<a name="l00070"></a><a class="code" href="classitpp_1_1CFix.html#bda4612ddac94b11c64ecc476fbd0cf7">00070</a>   <a class="code" href="classitpp_1_1CFix.html#84a43428f4c792b2df635e416a2b6447" title="Default constructor.">CFix</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &amp;x, <span class="keywordtype">double</span>, <span class="keywordtype">int</span> w = <a class="code" href="group__fixed.html#g16660ef1accee4eb3c95d2807c0d7c9c" title="Max word length.">MAX_WORDLEN</a>, <a class="code" href="group__fixed.html#g3a204def662e60bf9bb54d27db09450d" title="Sign encoding modes (aligned with SystemC).">e_mode</a> e = <a class="code" href="group__fixed.html#gg3a204def662e60bf9bb54d27db09450df4bddf5c0c77795974633939360e6e4a" title="Two&amp;#39;s complement.">TC</a>, <a class="code" href="group__fixed.html#g18d0ad4d7280177b761737a7b8b5c45d" title="Overflow modes (aligned with SystemC).">o_mode</a> o = <a class="code" href="group__fixed.html#gg18d0ad4d7280177b761737a7b8b5c45da7ea797d8579a3e2dc82f792e16e946b" title="Wrap-around.">WRAP</a>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a> q = <a class="code" href="group__fixed.html#gga644362f0b3d795ce8521326e20fed110566af00cff42134b7f719254d07bec1" title="Truncation.">TRN</a>, <a class="code" href="classitpp_1_1Stat.html" title="A class for sampling a signal and calculating statistics.">Stat</a> *ptr = 0)
95<a name="l00071"></a>00071       : <a class="code" href="classitpp_1_1Fix__Base.html" title="Base class for fixed-point data types.">Fix_Base</a>(x.<a class="code" href="classitpp_1_1Fix__Base.html#c42e876a20028d8c7538d6f1d4754d6a" title="Accumulated bitshift (positive means left-shifted, negative means right-shifted)...">shift</a>, w, e, o, q, ptr), <a class="code" href="classitpp_1_1CFix.html#eceddf502d1f1ed429922c0e91843131" title="Real data part.">re</a>(x.<a class="code" href="classitpp_1_1CFix.html#eceddf502d1f1ed429922c0e91843131" title="Real data part.">re</a>), <a class="code" href="classitpp_1_1CFix.html#e18a88265bc5d74f27d9f5abbc98c6df" title="Imaginary data part.">im</a>(x.<a class="code" href="classitpp_1_1CFix.html#e18a88265bc5d74f27d9f5abbc98c6df" title="Imaginary data part.">im</a>) {}
96<a name="l00073"></a><a class="code" href="classitpp_1_1CFix.html#61ec78774edb094d481ef5481d0f38c1">00073</a>   <span class="keyword">virtual</span> <a class="code" href="classitpp_1_1CFix.html#61ec78774edb094d481ef5481d0f38c1" title="Destructor.">~CFix</a>() {}
97<a name="l00074"></a>00074
98<a name="l00076"></a>00076   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#d5423e305f4ce5c18d7e8a05f5290d74" title="Assignment from CFix.">operator=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &amp;x);
99<a name="l00078"></a>00078   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#d5423e305f4ce5c18d7e8a05f5290d74" title="Assignment from CFix.">operator=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &amp;x);
100<a name="l00080"></a>00080   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#d5423e305f4ce5c18d7e8a05f5290d74" title="Assignment from CFix.">operator=</a>(<span class="keyword">const</span> std::complex&lt;double&gt; &amp;x);
101<a name="l00082"></a>00082   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#d5423e305f4ce5c18d7e8a05f5290d74" title="Assignment from CFix.">operator=</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> x);
102<a name="l00084"></a>00084   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#80750fd5a6f39e63de9eadf4c73ebb99" title="Addition of CFix.">operator+=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &amp;x);
103<a name="l00086"></a>00086   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#80750fd5a6f39e63de9eadf4c73ebb99" title="Addition of CFix.">operator+=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &amp;x);
104<a name="l00088"></a>00088   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#80750fd5a6f39e63de9eadf4c73ebb99" title="Addition of CFix.">operator+=</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> x);
105<a name="l00090"></a>00090   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#6933b783ec85e3dd5e94b0f946ac7bf7" title="Subtraction of CFix.">operator-=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &amp;x);
106<a name="l00092"></a>00092   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#6933b783ec85e3dd5e94b0f946ac7bf7" title="Subtraction of CFix.">operator-=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &amp;x);
107<a name="l00094"></a>00094   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#6933b783ec85e3dd5e94b0f946ac7bf7" title="Subtraction of CFix.">operator-=</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> x);
108<a name="l00096"></a>00096   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#52300bf047647036ad803f12a7dd44de" title="Multiplication with CFix. Temporary variables use the maximum word length (64 bits)...">operator*=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &amp;x);
109<a name="l00098"></a>00098   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#52300bf047647036ad803f12a7dd44de" title="Multiplication with CFix. Temporary variables use the maximum word length (64 bits)...">operator*=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &amp;x);
110<a name="l00100"></a>00100   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#52300bf047647036ad803f12a7dd44de" title="Multiplication with CFix. Temporary variables use the maximum word length (64 bits)...">operator*=</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> x);
111<a name="l00102"></a>00102   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#211a3458b57f66dac3769b59b773590e" title="Division with CFix using quantization mode TRN. Temporary variables use the maximum...">operator/=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &amp;x);
112<a name="l00104"></a>00104   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#211a3458b57f66dac3769b59b773590e" title="Division with CFix using quantization mode TRN. Temporary variables use the maximum...">operator/=</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &amp;x);
113<a name="l00106"></a>00106   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#211a3458b57f66dac3769b59b773590e" title="Division with CFix using quantization mode TRN. Temporary variables use the maximum...">operator/=</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> x);
114<a name="l00108"></a>00108   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> <a class="code" href="classitpp_1_1CFix.html#f3fe5dca5736d683901aba3ca84bf0a1" title="Unary negative of CFix.">operator-</a>() <span class="keyword">const</span>;
115<a name="l00110"></a>00110   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#647069fc2eb2e9943530fd8334c3b2c7" title="Left shift n bits.">operator&lt;&lt;=</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> n);
116<a name="l00112"></a>00112   <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a>&amp; <a class="code" href="classitpp_1_1CFix.html#cfd2a4610e09e597eb9cb8a5e90982a0" title="Right shift n bits using quantization mode qmode (constructor argument).">operator&gt;&gt;=</a>(<span class="keyword">const</span> <span class="keywordtype">int</span> n);
117<a name="l00113"></a>00113
118<a name="l00115"></a>00115   <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keywordtype">double</span> <a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>, <span class="keywordtype">double</span> <a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>, <span class="keywordtype">int</span> n);
119<a name="l00117"></a>00117   <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keywordtype">double</span> <a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>, <span class="keywordtype">double</span> <a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>, <span class="keywordtype">int</span> n, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a> q);
120<a name="l00119"></a>00119   <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keyword">const</span> std::complex&lt;double&gt; &amp;x, <span class="keywordtype">int</span> n);
121<a name="l00121"></a>00121   <span class="keywordtype">void</span> <span class="keyword">set</span>(<span class="keyword">const</span> std::complex&lt;double&gt; &amp;x, <span class="keywordtype">int</span> n, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a> q);
122<a name="l00123"></a><a class="code" href="classitpp_1_1CFix.html#3de4465f36c2c8620dc8e7c448a11b87">00123</a>   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1CFix.html#3de4465f36c2c8620dc8e7c448a11b87" title="Set data representation for real part (mainly for internal use since it reveals the...">set_re</a>(<a class="code" href="group__fixed.html#gf3f12ba9f1a5ce9d50ef18fa3b65b5c3" title="Representation for fixed-point data types.">fixrep</a> x) {<a class="code" href="classitpp_1_1CFix.html#eceddf502d1f1ed429922c0e91843131" title="Real data part.">re</a> = <a class="code" href="classitpp_1_1Fix__Base.html#d5793faefe33b344b0d74a21ceca81a4" title="Handle overflows using overflow mode omode and make call to statistics object (if...">apply_o_mode</a>(x);}
123<a name="l00125"></a><a class="code" href="classitpp_1_1CFix.html#91c485bead8cc92ca440526c3d4c4ce4">00125</a>   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1CFix.html#91c485bead8cc92ca440526c3d4c4ce4" title="Set data representation for imaginary part (mainly for internal use since it reveals...">set_im</a>(<a class="code" href="group__fixed.html#gf3f12ba9f1a5ce9d50ef18fa3b65b5c3" title="Representation for fixed-point data types.">fixrep</a> x) {<a class="code" href="classitpp_1_1CFix.html#e18a88265bc5d74f27d9f5abbc98c6df" title="Imaginary data part.">im</a> = <a class="code" href="classitpp_1_1Fix__Base.html#d5793faefe33b344b0d74a21ceca81a4" title="Handle overflows using overflow mode omode and make call to statistics object (if...">apply_o_mode</a>(x);}
124<a name="l00126"></a>00126
125<a name="l00128"></a>00128   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1CFix.html#61ff5d70bc5b983ac4fe34d2ee2a830a" title="Left shift n bits.">lshift</a>(<span class="keywordtype">int</span> n);
126<a name="l00130"></a>00130   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1CFix.html#b289e5b8b4bf58da601bcd251ea43e32" title="Right shift n bits using quantization mode qmode (constructor argument).">rshift</a>(<span class="keywordtype">int</span> n);
127<a name="l00132"></a>00132   <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1CFix.html#b289e5b8b4bf58da601bcd251ea43e32" title="Right shift n bits using quantization mode qmode (constructor argument).">rshift</a>(<span class="keywordtype">int</span> n, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a> q);
128<a name="l00133"></a>00133
129<a name="l00135"></a>00135   <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classitpp_1_1CFix.html#6d801106caaab4dfa02c0accee19444b" title="Print restrictions.">print</a>() <span class="keyword">const</span>;
130<a name="l00137"></a><a class="code" href="classitpp_1_1CFix.html#b3662f49d47f09fd291381fdad26d086">00137</a>   <a class="code" href="group__fixed.html#gf3f12ba9f1a5ce9d50ef18fa3b65b5c3" title="Representation for fixed-point data types.">fixrep</a> <a class="code" href="classitpp_1_1CFix.html#b3662f49d47f09fd291381fdad26d086" title="Get data representation for real part (mainly for internal use since it reveals the...">get_re</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classitpp_1_1CFix.html#eceddf502d1f1ed429922c0e91843131" title="Real data part.">re</a>;}
131<a name="l00139"></a><a class="code" href="classitpp_1_1CFix.html#db7f57813c1f8b8bfe867051dbaf1c9a">00139</a>   <a class="code" href="group__fixed.html#gf3f12ba9f1a5ce9d50ef18fa3b65b5c3" title="Representation for fixed-point data types.">fixrep</a> <a class="code" href="classitpp_1_1CFix.html#db7f57813c1f8b8bfe867051dbaf1c9a" title="Get data representation for imaginary part (mainly for internal use since it reveals...">get_im</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classitpp_1_1CFix.html#e18a88265bc5d74f27d9f5abbc98c6df" title="Imaginary data part.">im</a>;}
132<a name="l00141"></a>00141   std::complex&lt;double&gt; <a class="code" href="classitpp_1_1CFix.html#a50af6275a8ffb446be444b061f05525" title="Conversion to std::complex&amp;lt;double&amp;gt;.">unfix</a>() <span class="keyword">const</span>;
133<a name="l00142"></a>00142
134<a name="l00143"></a>00143 <span class="preprocessor">#ifndef NO_IMPLICIT_FIX_CONVERSION</span>
135<a name="l00145"></a><a class="code" href="classitpp_1_1CFix.html#3ceb031173ba69c7b4ecaa7075da0d80">00145</a> <span class="preprocessor">  operator std::complex&lt;double&gt;() const {</span>
136<a name="l00146"></a>00146 <span class="preprocessor"></span>    <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(<a class="code" href="classitpp_1_1Fix__Base.html#c42e876a20028d8c7538d6f1d4754d6a" title="Accumulated bitshift (positive means left-shifted, negative means right-shifted)...">shift</a> &gt;= -63 &amp;&amp; <a class="code" href="classitpp_1_1Fix__Base.html#c42e876a20028d8c7538d6f1d4754d6a" title="Accumulated bitshift (positive means left-shifted, negative means right-shifted)...">shift</a> &lt;= 64, <span class="stringliteral">"CFix::operator complex&lt;double&gt;: Illegal shift!"</span>);
137<a name="l00147"></a>00147     <span class="keywordflow">return</span> std::complex&lt;double&gt;(double(<a class="code" href="classitpp_1_1CFix.html#eceddf502d1f1ed429922c0e91843131" title="Real data part.">re</a>)*<a class="code" href="group__fixed.html#g338980796829ae82ef35b6643a31d441" title="Table for fast multiplication by 2^(n-64).">DOUBLE_POW2</a>[64 - <a class="code" href="classitpp_1_1Fix__Base.html#c42e876a20028d8c7538d6f1d4754d6a" title="Accumulated bitshift (positive means left-shifted, negative means right-shifted)...">shift</a>],
138<a name="l00148"></a>00148                                 double(<a class="code" href="classitpp_1_1CFix.html#e18a88265bc5d74f27d9f5abbc98c6df" title="Imaginary data part.">im</a>)*<a class="code" href="group__fixed.html#g338980796829ae82ef35b6643a31d441" title="Table for fast multiplication by 2^(n-64).">DOUBLE_POW2</a>[64 - <a class="code" href="classitpp_1_1Fix__Base.html#c42e876a20028d8c7538d6f1d4754d6a" title="Accumulated bitshift (positive means left-shifted, negative means right-shifted)...">shift</a>]);
139<a name="l00149"></a>00149   }
140<a name="l00150"></a>00150 <span class="preprocessor">#endif</span>
141<a name="l00151"></a>00151 <span class="preprocessor"></span>
142<a name="l00153"></a>00153   <span class="keyword">friend</span> <span class="keywordtype">int</span> <a class="code" href="group__fixed.html#ga9fdd7dc11b39d9dfedbe5f57d904229" title="Check that x.shift==0 OR x==0 OR y==0 and return x.shift.">assert_shifts</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &amp;x, <span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &amp;y);
143<a name="l00155"></a>00155   <span class="keyword">friend</span> <span class="keywordtype">int</span> <a class="code" href="group__fixed.html#ga9fdd7dc11b39d9dfedbe5f57d904229" title="Check that x.shift==0 OR x==0 OR y==0 and return x.shift.">assert_shifts</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &amp;x, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &amp;y);
144<a name="l00157"></a>00157   <span class="keyword">friend</span> <span class="keywordtype">int</span> <a class="code" href="group__fixed.html#ga9fdd7dc11b39d9dfedbe5f57d904229" title="Check that x.shift==0 OR x==0 OR y==0 and return x.shift.">assert_shifts</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &amp;x, <span class="keywordtype">int</span> y);
145<a name="l00158"></a>00158
146<a name="l00159"></a>00159 <span class="keyword">protected</span>:
147<a name="l00160"></a><a class="code" href="classitpp_1_1CFix.html#eceddf502d1f1ed429922c0e91843131">00160</a>   <a class="code" href="group__fixed.html#gf3f12ba9f1a5ce9d50ef18fa3b65b5c3" title="Representation for fixed-point data types.">fixrep</a> re;   
148<a name="l00161"></a><a class="code" href="classitpp_1_1CFix.html#e18a88265bc5d74f27d9f5abbc98c6df">00161</a>   <a class="code" href="group__fixed.html#gf3f12ba9f1a5ce9d50ef18fa3b65b5c3" title="Representation for fixed-point data types.">fixrep</a> im;   
149<a name="l00162"></a>00162 };
150<a name="l00163"></a>00163
151<a name="l00165"></a>00165 <span class="keywordtype">int</span> <a class="code" href="group__fixed.html#ga9fdd7dc11b39d9dfedbe5f57d904229" title="Check that x.shift==0 OR x==0 OR y==0 and return x.shift.">assert_shifts</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &amp;x, <span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &amp;y);
152<a name="l00167"></a>00167 <span class="keywordtype">int</span> <a class="code" href="group__fixed.html#ga9fdd7dc11b39d9dfedbe5f57d904229" title="Check that x.shift==0 OR x==0 OR y==0 and return x.shift.">assert_shifts</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &amp;x, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &amp;y);
153<a name="l00169"></a>00169 <span class="keywordtype">int</span> <a class="code" href="group__fixed.html#ga9fdd7dc11b39d9dfedbe5f57d904229" title="Check that x.shift==0 OR x==0 OR y==0 and return x.shift.">assert_shifts</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &amp;x, <span class="keywordtype">int</span> y);
154<a name="l00170"></a>00170
155<a name="l00172"></a>00172 std::istream &amp;<a class="code" href="classitpp_1_1Array.html#fe07b04bfe22532f04c5584abd66de56" title="Input stream for Array&amp;lt;T&amp;gt;. T must have istream operator&amp;gt;&amp;gt; defined.">operator&gt;&gt;</a>(std::istream &amp;is, <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &amp;x);
156<a name="l00174"></a>00174 std::ostream &amp;<a class="code" href="classitpp_1_1Array.html#527a6c86b076ffe554452697e19b8f60" title="Output stream for Array&amp;lt;T&amp;gt;. T must have ostream operator&amp;lt;&amp;lt; defined.">operator&lt;&lt;</a>(std::ostream &amp;os, <span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &amp;x);
157<a name="l00175"></a>00175
158<a name="l00177"></a><a class="code" href="group__fixed.html#g057e78df9719352a7a2ae36c0e190982">00177</a> <span class="keyword">typedef</span> <a class="code" href="classitpp_1_1Vec.html" title="Vector Class (Templated).">Vec&lt;CFix&gt;</a> <a class="code" href="classitpp_1_1Vec.html" title="Vector Class (Templated).">cfixvec</a>;
159<a name="l00179"></a><a class="code" href="group__fixed.html#g6dd4e3e315ed992df7841744c656afce">00179</a> <span class="keyword">typedef</span> <a class="code" href="classitpp_1_1Mat.html" title="Matrix Class (Templated).">Mat&lt;CFix&gt;</a> <a class="code" href="classitpp_1_1Mat.html" title="Matrix Class (Templated).">cfixmat</a>;
160<a name="l00180"></a>00180
161<a name="l00181"></a>00181 <span class="comment">// Specialization of template definition in vec.cpp</span>
162<a name="l00182"></a>00182 <span class="keyword">template</span>&lt;&gt; <span class="keywordtype">void</span> cfixvec::set(<span class="keyword">const</span> <span class="keywordtype">char</span> *values);
163<a name="l00183"></a>00183 <span class="comment">// Specialization of template definition in mat.cpp</span>
164<a name="l00184"></a>00184 <span class="keyword">template</span>&lt;&gt; <span class="keywordtype">void</span> cfixmat::set(<span class="keyword">const</span> <span class="keywordtype">char</span> *values);
165<a name="l00185"></a>00185
166<a name="l00187"></a>00187
167<a name="l00188"></a>00188 } <span class="comment">// namespace itpp</span>
168<a name="l00189"></a>00189
169<a name="l00190"></a>00190 <span class="preprocessor">#endif // #ifndef CFIX_H</span>
170</pre></div></div>
171<hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:10 2009 for mixpp by&nbsp;
172<a href="http://www.doxygen.org/index.html">
173<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
174</body>
175</html>
Note: See TracBrowser for help on using the browser.