[353] | 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: fix_functions.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 | <!-- |
---|
| 10 | function 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 | } |
---|
| 22 | function 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 | } |
---|
| 46 | window.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 Page</span></a></li> |
---|
| 53 | <li><a href="pages.html"><span>Related 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 List</span></a></li> |
---|
| 62 | <li><a href="globals.html"><span>File Members</span></a></li> |
---|
| 63 | </ul> |
---|
| 64 | </div> |
---|
| 65 | <h1>fix_functions.h</h1><a href="fix__functions_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 |
---|
| 66 | <a name="l00030"></a>00030 <span class="preprocessor">#ifndef FIX_FUNCTIONS_H</span> |
---|
| 67 | <a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#define FIX_FUNCTIONS_H</span> |
---|
| 68 | <a name="l00032"></a>00032 <span class="preprocessor"></span> |
---|
| 69 | <a name="l00033"></a>00033 <span class="preprocessor">#include <<a class="code" href="cfix_8h.html" title="Definitions of a complex fixed-point data type CFix.">itpp/fixed/cfix.h</a>></span> |
---|
| 70 | <a name="l00034"></a>00034 <span class="preprocessor">#include <<a class="code" href="vec_8h.html" title="Templated Vector Class Definitions.">itpp/base/vec.h</a>></span> |
---|
| 71 | <a name="l00035"></a>00035 <span class="preprocessor">#include <<a class="code" href="mat_8h.html" title="Matrix Class Definitions.">itpp/base/mat.h</a>></span> |
---|
| 72 | <a name="l00036"></a>00036 <span class="preprocessor">#include <<a class="code" href="array_8h.html" title="Definition of Array class (container).">itpp/base/array.h</a>></span> |
---|
| 73 | <a name="l00037"></a>00037 <span class="preprocessor">#include <<a class="code" href="converters_8h.html" title="Definitions of converters between different vector and matrix types.">itpp/base/converters.h</a>></span> |
---|
| 74 | <a name="l00038"></a>00038 |
---|
| 75 | <a name="l00039"></a>00039 |
---|
| 76 | <a name="l00040"></a>00040 <span class="keyword">namespace </span>itpp |
---|
| 77 | <a name="l00041"></a>00041 { |
---|
| 78 | <a name="l00042"></a>00042 |
---|
| 79 | <a name="l00045"></a>00045 |
---|
| 80 | <a name="l00047"></a><a class="code" href="group__fixed.html#gdae1745af8181dab605a140b02e5204e">00047</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="group__fixed.html#g136eb218f0f4a85d2108fa3847381bac" title="Return true only if argument is of type Fix or CFix (or an Array/Vec/Mat of Fix or...">is_fix</a>(<span class="keyword">const</span> T &) {<span class="keywordflow">return</span> <span class="keyword">false</span>;} |
---|
| 81 | <a name="l00049"></a><a class="code" href="group__fixed.html#ge2ada92174c22b5ebcab8e26352ce2f7">00049</a> <span class="keyword">template</span><> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="group__fixed.html#g136eb218f0f4a85d2108fa3847381bac" title="Return true only if argument is of type Fix or CFix (or an Array/Vec/Mat of Fix or...">is_fix</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &) {<span class="keywordflow">return</span> <span class="keyword">true</span>;} |
---|
| 82 | <a name="l00051"></a><a class="code" href="group__fixed.html#g93af5fa4cf737de55142693f91617038">00051</a> <span class="keyword">template</span><> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="group__fixed.html#g136eb218f0f4a85d2108fa3847381bac" title="Return true only if argument is of type Fix or CFix (or an Array/Vec/Mat of Fix or...">is_fix</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Vec.html" title="Vector Class (Templated).">fixvec</a> &) {<span class="keywordflow">return</span> <span class="keyword">true</span>;} |
---|
| 83 | <a name="l00053"></a><a class="code" href="group__fixed.html#g0d8eae605bc7339fc090f5740284b7fd">00053</a> <span class="keyword">template</span><> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="group__fixed.html#g136eb218f0f4a85d2108fa3847381bac" title="Return true only if argument is of type Fix or CFix (or an Array/Vec/Mat of Fix or...">is_fix</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Mat.html" title="Matrix Class (Templated).">fixmat</a> &) {<span class="keywordflow">return</span> <span class="keyword">true</span>;} |
---|
| 84 | <a name="l00055"></a><a class="code" href="group__fixed.html#g1034ac3e2a0cedaa91221c5d3d3f3fe5">00055</a> <span class="keyword">template</span><> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="group__fixed.html#g136eb218f0f4a85d2108fa3847381bac" title="Return true only if argument is of type Fix or CFix (or an Array/Vec/Mat of Fix or...">is_fix</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &) {<span class="keywordflow">return</span> <span class="keyword">true</span>;} |
---|
| 85 | <a name="l00057"></a>00057 <span class="keyword">template</span><> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="group__fixed.html#g136eb218f0f4a85d2108fa3847381bac" title="Return true only if argument is of type Fix or CFix (or an Array/Vec/Mat of Fix or...">is_fix</a>(<span class="keyword">const</span> <a class="code" href="group__fixed.html#g057e78df9719352a7a2ae36c0e190982" title="Typedef for complex fixed-point vector type.">cfixvec</a> &) {<span class="keywordflow">return</span> <span class="keyword">true</span>;} |
---|
| 86 | <a name="l00059"></a>00059 <span class="keyword">template</span><> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="group__fixed.html#g136eb218f0f4a85d2108fa3847381bac" title="Return true only if argument is of type Fix or CFix (or an Array/Vec/Mat of Fix or...">is_fix</a>(<span class="keyword">const</span> <a class="code" href="group__fixed.html#g6dd4e3e315ed992df7841744c656afce" title="Typedef for complex fixed-point matrix type.">cfixmat</a> &) {<span class="keywordflow">return</span> <span class="keyword">true</span>;} |
---|
| 87 | <a name="l00061"></a><a class="code" href="group__fixed.html#g136eb218f0f4a85d2108fa3847381bac">00061</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="group__fixed.html#g136eb218f0f4a85d2108fa3847381bac" title="Return true only if argument is of type Fix or CFix (or an Array/Vec/Mat of Fix or...">is_fix</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<T></a> &) {<span class="keywordflow">return</span> <a class="code" href="group__fixed.html#g136eb218f0f4a85d2108fa3847381bac" title="Return true only if argument is of type Fix or CFix (or an Array/Vec/Mat of Fix or...">is_fix</a>(T());} |
---|
| 88 | <a name="l00062"></a>00062 |
---|
| 89 | <a name="l00064"></a><a class="code" href="group__fixed.html#g0a86befa914ac37d259354f43a703a98">00064</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &y, <span class="keywordtype">double</span> x, <span class="keywordtype">int</span> n) {y.<a class="code" href="classitpp_1_1Fix.html#333fe1f805ebff7c4944429db9af792b" title="Set to x * pow2(n) using quantization mode qmode (constructor argument).">set</a>(x, n);} |
---|
| 90 | <a name="l00066"></a><a class="code" href="group__fixed.html#gedf327e46db48b015aadba15ee28653d">00066</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &y, <span class="keywordtype">double</span> 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) {y.<a class="code" href="classitpp_1_1Fix.html#333fe1f805ebff7c4944429db9af792b" title="Set to x * pow2(n) using quantization mode qmode (constructor argument).">set</a>(x, n, q);} |
---|
| 91 | <a name="l00068"></a><a class="code" href="group__fixed.html#gbb854328d9870f9c35fc83f832948e15">00068</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Vec.html" title="Vector Class (Templated).">fixvec</a> &y, <span class="keyword">const</span> vec &x, <span class="keywordtype">int</span> n) |
---|
| 92 | <a name="l00069"></a>00069 { |
---|
| 93 | <a name="l00070"></a>00070 y.<a class="code" href="classitpp_1_1Vec.html#a4b02b7819e540bb3853c15e6480ada6" title="Set length of vector. if copy = true then keeping the old values.">set_size</a>(x.length()); |
---|
| 94 | <a name="l00071"></a>00071 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Vec.html#a906c893cd6184a774e4da8a47217d6a" title="The size of the vector.">size</a>(); i++) y(i).<a class="code" href="group__fixed.html#g873fbb59421d9998f1822c4a9b60c544" title="Set the vector equal to the values in the str string.">set</a>(x(i), n); |
---|
| 95 | <a name="l00072"></a>00072 } |
---|
| 96 | <a name="l00074"></a><a class="code" href="group__fixed.html#gaa91b5c3338365dc404f2511f7d7a4b8">00074</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Vec.html" title="Vector Class (Templated).">fixvec</a> &y, <span class="keyword">const</span> vec &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) |
---|
| 97 | <a name="l00075"></a>00075 { |
---|
| 98 | <a name="l00076"></a>00076 y.<a class="code" href="classitpp_1_1Vec.html#a4b02b7819e540bb3853c15e6480ada6" title="Set length of vector. if copy = true then keeping the old values.">set_size</a>(x.length()); |
---|
| 99 | <a name="l00077"></a>00077 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Vec.html#a906c893cd6184a774e4da8a47217d6a" title="The size of the vector.">size</a>(); i++) y(i).<a class="code" href="group__fixed.html#g873fbb59421d9998f1822c4a9b60c544" title="Set the vector equal to the values in the str string.">set</a>(x(i), n, q); |
---|
| 100 | <a name="l00078"></a>00078 } |
---|
| 101 | <a name="l00080"></a><a class="code" href="group__fixed.html#g120cbbf72eb0187278ddd57cb9f3beb0">00080</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Mat.html" title="Matrix Class (Templated).">fixmat</a> &y, <span class="keyword">const</span> mat &x, <span class="keywordtype">int</span> n) |
---|
| 102 | <a name="l00081"></a>00081 { |
---|
| 103 | <a name="l00082"></a>00082 y.<a class="code" href="classitpp_1_1Mat.html#1136d376109f2af8843593bccf9de88f" title="Set size of matrix. If copy = true then keep the data before resizing.">set_size</a>(x.rows(), x.cols()); |
---|
| 104 | <a name="l00083"></a>00083 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Mat.html#9c0850a9a2fad79960498864226818a0" title="The number of elements.">size</a>(); i++) y(i).<a class="code" href="classitpp_1_1Mat.html#700f695526662f754c1804749c486922" title="Set matrix equal to values in the string str.">set</a>(x(i), n); |
---|
| 105 | <a name="l00084"></a>00084 } |
---|
| 106 | <a name="l00086"></a><a class="code" href="group__fixed.html#ga2bd1dced27a8b6e2bf8581ae5086b98">00086</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Mat.html" title="Matrix Class (Templated).">fixmat</a> &y, <span class="keyword">const</span> mat &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) |
---|
| 107 | <a name="l00087"></a>00087 { |
---|
| 108 | <a name="l00088"></a>00088 y.<a class="code" href="classitpp_1_1Mat.html#1136d376109f2af8843593bccf9de88f" title="Set size of matrix. If copy = true then keep the data before resizing.">set_size</a>(x.rows(), x.cols()); |
---|
| 109 | <a name="l00089"></a>00089 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Mat.html#9c0850a9a2fad79960498864226818a0" title="The number of elements.">size</a>(); i++) y(i).<a class="code" href="classitpp_1_1Mat.html#700f695526662f754c1804749c486922" title="Set matrix equal to values in the string str.">set</a>(x(i), n, q); |
---|
| 110 | <a name="l00090"></a>00090 } |
---|
| 111 | <a name="l00092"></a><a class="code" href="group__fixed.html#g5f9717607af303353f37a8b0987e0164">00092</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<span class="keywordtype">double</span> &y, <span class="keywordtype">double</span> x, <span class="keywordtype">int</span>) {y = x;} |
---|
| 112 | <a name="l00094"></a><a class="code" href="group__fixed.html#g31a630da8d86e847809deb263c844f8b">00094</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<span class="keywordtype">double</span> &y, <span class="keywordtype">double</span> x, <span class="keywordtype">int</span>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a>) {y = x;} |
---|
| 113 | <a name="l00096"></a><a class="code" href="group__fixed.html#g7393ec3b391ab5f82b2d830830c228b3">00096</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(vec &y, <span class="keyword">const</span> vec &x, <span class="keywordtype">int</span>) {y = x;} |
---|
| 114 | <a name="l00098"></a><a class="code" href="group__fixed.html#g0dd26ac17d4486eacd490a823734eb4c">00098</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(vec &y, <span class="keyword">const</span> vec &x, <span class="keywordtype">int</span>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a>) {y = x;} |
---|
| 115 | <a name="l00100"></a><a class="code" href="group__fixed.html#g28a9445e730917d3e13717dda444776e">00100</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(mat &y, <span class="keyword">const</span> mat &x, <span class="keywordtype">int</span>) {y = x;} |
---|
| 116 | <a name="l00102"></a><a class="code" href="group__fixed.html#g9acb937373bba7ababd55a48e4ca9f13">00102</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(mat &y, <span class="keyword">const</span> mat &x, <span class="keywordtype">int</span>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a>) {y = x;} |
---|
| 117 | <a name="l00103"></a>00103 |
---|
| 118 | <a name="l00105"></a><a class="code" href="group__fixed.html#g2af41bd65ab75a98a2f38be0a50b8c9a">00105</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &y, std::complex<double> x, <span class="keywordtype">int</span> n) {y.<a class="code" href="classitpp_1_1CFix.html#edf53396d836afdfb069d27054bee0bb" title="Set to (real + i*imag) * pow2(n) using quantization mode qmode (constructor argument)...">set</a>(x, n);} |
---|
| 119 | <a name="l00107"></a><a class="code" href="group__fixed.html#g95390a3cd397c6c7b3c5c5bb3a0912a8">00107</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &y, <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) {y.<a class="code" href="classitpp_1_1CFix.html#edf53396d836afdfb069d27054bee0bb" title="Set to (real + i*imag) * pow2(n) using quantization mode qmode (constructor argument)...">set</a>(real, imag, n);} |
---|
| 120 | <a name="l00109"></a><a class="code" href="group__fixed.html#g9efc78a65d351de940af8ae64991daa0">00109</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &y, std::complex<double> 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) {y.<a class="code" href="classitpp_1_1CFix.html#edf53396d836afdfb069d27054bee0bb" title="Set to (real + i*imag) * pow2(n) using quantization mode qmode (constructor argument)...">set</a>(x, n, q);} |
---|
| 121 | <a name="l00111"></a><a class="code" href="group__fixed.html#g230871dc4df0e22803665c42b6497385">00111</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &y, <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) {y.<a class="code" href="classitpp_1_1CFix.html#edf53396d836afdfb069d27054bee0bb" title="Set to (real + i*imag) * pow2(n) using quantization mode qmode (constructor argument)...">set</a>(real, imag, n, q);} |
---|
| 122 | <a name="l00113"></a><a class="code" href="group__fixed.html#gdf0dbcafd4de67a74f2e08b78c01eb24">00113</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Vec.html" title="Vector Class (Templated).">cfixvec</a> &y, <span class="keyword">const</span> cvec &x, <span class="keywordtype">int</span> n) |
---|
| 123 | <a name="l00114"></a>00114 { |
---|
| 124 | <a name="l00115"></a>00115 y.<a class="code" href="classitpp_1_1Vec.html#a4b02b7819e540bb3853c15e6480ada6" title="Set length of vector. if copy = true then keeping the old values.">set_size</a>(x.length()); |
---|
| 125 | <a name="l00116"></a>00116 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Vec.html#a906c893cd6184a774e4da8a47217d6a" title="The size of the vector.">size</a>(); i++) y(i).<a class="code" href="group__fixed.html#g873fbb59421d9998f1822c4a9b60c544" title="Set the vector equal to the values in the str string.">set</a>(x(i), n); |
---|
| 126 | <a name="l00117"></a>00117 } |
---|
| 127 | <a name="l00119"></a><a class="code" href="group__fixed.html#gaefbf5f86bd87d075df4701dfd93b9c7">00119</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Vec.html" title="Vector Class (Templated).">cfixvec</a> &y, <span class="keyword">const</span> vec &<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>, <span class="keyword">const</span> vec &<a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>, <span class="keywordtype">int</span> n) |
---|
| 128 | <a name="l00120"></a>00120 { |
---|
| 129 | <a name="l00121"></a>00121 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(real.length() == imag.length(), <span class="stringliteral">"set_fix: real and imag should have the same size"</span>); |
---|
| 130 | <a name="l00122"></a>00122 y.<a class="code" href="classitpp_1_1Vec.html#a4b02b7819e540bb3853c15e6480ada6" title="Set length of vector. if copy = true then keeping the old values.">set_size</a>(real.length()); |
---|
| 131 | <a name="l00123"></a>00123 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Vec.html#a906c893cd6184a774e4da8a47217d6a" title="The size of the vector.">size</a>(); i++) y(i).<a class="code" href="group__fixed.html#g873fbb59421d9998f1822c4a9b60c544" title="Set the vector equal to the values in the str string.">set</a>(<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>(i), <a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>(i), n); |
---|
| 132 | <a name="l00124"></a>00124 } |
---|
| 133 | <a name="l00126"></a><a class="code" href="group__fixed.html#ged24d3edd6f55ae0ff23ec979bf6cb07">00126</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Vec.html" title="Vector Class (Templated).">cfixvec</a> &y, <span class="keyword">const</span> cvec &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) |
---|
| 134 | <a name="l00127"></a>00127 { |
---|
| 135 | <a name="l00128"></a>00128 y.<a class="code" href="classitpp_1_1Vec.html#a4b02b7819e540bb3853c15e6480ada6" title="Set length of vector. if copy = true then keeping the old values.">set_size</a>(x.length()); |
---|
| 136 | <a name="l00129"></a>00129 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Vec.html#a906c893cd6184a774e4da8a47217d6a" title="The size of the vector.">size</a>(); i++) y(i).<a class="code" href="group__fixed.html#g873fbb59421d9998f1822c4a9b60c544" title="Set the vector equal to the values in the str string.">set</a>(x(i), n, q); |
---|
| 137 | <a name="l00130"></a>00130 } |
---|
| 138 | <a name="l00132"></a><a class="code" href="group__fixed.html#g82c61de2eb659fbc4e6dfad5754a01af">00132</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Vec.html" title="Vector Class (Templated).">cfixvec</a> &y, <span class="keyword">const</span> vec &<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>, <span class="keyword">const</span> vec &<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) |
---|
| 139 | <a name="l00133"></a>00133 { |
---|
| 140 | <a name="l00134"></a>00134 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(real.length() == imag.length(), <span class="stringliteral">"set_fix: real and imag should have the same size"</span>); |
---|
| 141 | <a name="l00135"></a>00135 y.<a class="code" href="classitpp_1_1Vec.html#a4b02b7819e540bb3853c15e6480ada6" title="Set length of vector. if copy = true then keeping the old values.">set_size</a>(real.length()); |
---|
| 142 | <a name="l00136"></a>00136 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Vec.html#a906c893cd6184a774e4da8a47217d6a" title="The size of the vector.">size</a>(); i++) y(i).<a class="code" href="group__fixed.html#g873fbb59421d9998f1822c4a9b60c544" title="Set the vector equal to the values in the str string.">set</a>(<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>(i), <a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>(i), n, q); |
---|
| 143 | <a name="l00137"></a>00137 } |
---|
| 144 | <a name="l00139"></a><a class="code" href="group__fixed.html#g5e5cea3883e5d554049acde04526528d">00139</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Mat.html" title="Matrix Class (Templated).">cfixmat</a> &y, <span class="keyword">const</span> cmat &x, <span class="keywordtype">int</span> n) |
---|
| 145 | <a name="l00140"></a>00140 { |
---|
| 146 | <a name="l00141"></a>00141 y.<a class="code" href="classitpp_1_1Mat.html#1136d376109f2af8843593bccf9de88f" title="Set size of matrix. If copy = true then keep the data before resizing.">set_size</a>(x.rows(), x.cols()); |
---|
| 147 | <a name="l00142"></a>00142 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Mat.html#9c0850a9a2fad79960498864226818a0" title="The number of elements.">size</a>(); i++) y(i).<a class="code" href="classitpp_1_1Mat.html#700f695526662f754c1804749c486922" title="Set matrix equal to values in the string str.">set</a>(x(i), n); |
---|
| 148 | <a name="l00143"></a>00143 } |
---|
| 149 | <a name="l00145"></a><a class="code" href="group__fixed.html#g6b4b8379aa76f6181a9602086a4a080a">00145</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Mat.html" title="Matrix Class (Templated).">cfixmat</a> &y, <span class="keyword">const</span> mat &<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>, <span class="keyword">const</span> mat &<a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>, <span class="keywordtype">int</span> n) |
---|
| 150 | <a name="l00146"></a>00146 { |
---|
| 151 | <a name="l00147"></a>00147 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(real.rows() == imag.rows() && real.cols() == imag.cols(), <span class="stringliteral">"set_fix: real and imag should have the same size"</span>); |
---|
| 152 | <a name="l00148"></a>00148 y.<a class="code" href="classitpp_1_1Mat.html#1136d376109f2af8843593bccf9de88f" title="Set size of matrix. If copy = true then keep the data before resizing.">set_size</a>(real.rows(), real.cols()); |
---|
| 153 | <a name="l00149"></a>00149 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Mat.html#9c0850a9a2fad79960498864226818a0" title="The number of elements.">size</a>(); i++) y(i).<a class="code" href="classitpp_1_1Mat.html#700f695526662f754c1804749c486922" title="Set matrix equal to values in the string str.">set</a>(<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>(i), <a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>(i), n); |
---|
| 154 | <a name="l00150"></a>00150 } |
---|
| 155 | <a name="l00152"></a><a class="code" href="group__fixed.html#g0f83bd31547f710b0a5aa77f86e484ee">00152</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Mat.html" title="Matrix Class (Templated).">cfixmat</a> &y, <span class="keyword">const</span> cmat &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) |
---|
| 156 | <a name="l00153"></a>00153 { |
---|
| 157 | <a name="l00154"></a>00154 y.<a class="code" href="classitpp_1_1Mat.html#1136d376109f2af8843593bccf9de88f" title="Set size of matrix. If copy = true then keep the data before resizing.">set_size</a>(x.rows(), x.cols()); |
---|
| 158 | <a name="l00155"></a>00155 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Mat.html#9c0850a9a2fad79960498864226818a0" title="The number of elements.">size</a>(); i++) y(i).<a class="code" href="classitpp_1_1Mat.html#700f695526662f754c1804749c486922" title="Set matrix equal to values in the string str.">set</a>(x(i), n, q); |
---|
| 159 | <a name="l00156"></a>00156 } |
---|
| 160 | <a name="l00158"></a><a class="code" href="group__fixed.html#gb2df67573fb33b02dda9b525775942f4">00158</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Mat.html" title="Matrix Class (Templated).">cfixmat</a> &y, <span class="keyword">const</span> mat &<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>, <span class="keyword">const</span> mat &<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) |
---|
| 161 | <a name="l00159"></a>00159 { |
---|
| 162 | <a name="l00160"></a>00160 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(real.rows() == imag.rows() && real.cols() == imag.cols(), <span class="stringliteral">"set_fix: real and imag should have the same size"</span>); |
---|
| 163 | <a name="l00161"></a>00161 y.<a class="code" href="classitpp_1_1Mat.html#1136d376109f2af8843593bccf9de88f" title="Set size of matrix. If copy = true then keep the data before resizing.">set_size</a>(real.rows(), real.cols()); |
---|
| 164 | <a name="l00162"></a>00162 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Mat.html#9c0850a9a2fad79960498864226818a0" title="The number of elements.">size</a>(); i++) y(i).<a class="code" href="classitpp_1_1Mat.html#700f695526662f754c1804749c486922" title="Set matrix equal to values in the string str.">set</a>(<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>(i), <a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>(i), n, q); |
---|
| 165 | <a name="l00163"></a>00163 } |
---|
| 166 | <a name="l00165"></a><a class="code" href="group__fixed.html#gcaebe933fdc5389ccf8e7fca1dd353c9">00165</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(std::complex<double> &y, <span class="keyword">const</span> std::complex<double> &x, <span class="keywordtype">int</span>) {y = x;} |
---|
| 167 | <a name="l00167"></a><a class="code" href="group__fixed.html#g94590e2da39d9e1678eb47f9f6cf0aaf">00167</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(std::complex<double> &y, <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>) {y = std::complex<double>(real, imag);} |
---|
| 168 | <a name="l00169"></a><a class="code" href="group__fixed.html#ga068793b340c6ee7a92a70e31864921d">00169</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(std::complex<double> &y, <span class="keyword">const</span> std::complex<double> &x, <span class="keywordtype">int</span>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a>) {y = x;} |
---|
| 169 | <a name="l00171"></a><a class="code" href="group__fixed.html#g12e3ef8f4b2163d418c6c0b5f4d2eec8">00171</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(std::complex<double> &y, <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>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a>) {y = std::complex<double>(real, imag);} |
---|
| 170 | <a name="l00173"></a><a class="code" href="group__fixed.html#g16b73eec09a3f220e6407d02c2386e6d">00173</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(cvec &y, <span class="keyword">const</span> cvec &x, <span class="keywordtype">int</span>) {y = x;} |
---|
| 171 | <a name="l00175"></a><a class="code" href="group__fixed.html#g7cce2711472806e31efd83df2ef80487">00175</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(cvec &y, <span class="keyword">const</span> vec &<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>, <span class="keyword">const</span> vec &<a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>, <span class="keywordtype">int</span>) {y = <a class="code" href="group__fixed.html#g3f0aa27746b5d5880f77e96c089498f2" title="Converts a cfixvec to cvec.">to_cvec</a>(real, imag);} |
---|
| 172 | <a name="l00177"></a><a class="code" href="group__fixed.html#g5fea245e5eb1618fa74b492969baa211">00177</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(cvec &y, <span class="keyword">const</span> cvec &x, <span class="keywordtype">int</span>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a>) {y = x;} |
---|
| 173 | <a name="l00179"></a><a class="code" href="group__fixed.html#gf8d8593043dc75fdb08a1d920a6629dc">00179</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(cvec &y, <span class="keyword">const</span> vec &<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>, <span class="keyword">const</span> vec &<a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>, <span class="keywordtype">int</span>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a>) {y = <a class="code" href="group__fixed.html#g3f0aa27746b5d5880f77e96c089498f2" title="Converts a cfixvec to cvec.">to_cvec</a>(real, imag);} |
---|
| 174 | <a name="l00181"></a><a class="code" href="group__fixed.html#gc53c94e6af6c162e6370cb03f9dabacc">00181</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(cmat &y, <span class="keyword">const</span> cmat &x, <span class="keywordtype">int</span>) {y = x;} |
---|
| 175 | <a name="l00183"></a><a class="code" href="group__fixed.html#gb1bf931a775b26f14519fafdb7d6a102">00183</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(cmat &y, <span class="keyword">const</span> mat &<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>, <span class="keyword">const</span> mat &<a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>, <span class="keywordtype">int</span>) {y = <a class="code" href="group__fixed.html#g6c4d97173a184f3f3b1049214d662582" title="Converts a cfixmat to cmat.">to_cmat</a>(real, imag);} |
---|
| 176 | <a name="l00185"></a><a class="code" href="group__fixed.html#g1aa9a129e954b3ea7c8fc0f39a817442">00185</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(cmat &y, <span class="keyword">const</span> cmat &x, <span class="keywordtype">int</span>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a>) {y = x;} |
---|
| 177 | <a name="l00187"></a><a class="code" href="group__fixed.html#g8f4795318cc7196411dc38e660b66321">00187</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(cmat &y, <span class="keyword">const</span> mat &<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>, <span class="keyword">const</span> mat &<a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>, <span class="keywordtype">int</span>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a>) {y = <a class="code" href="group__fixed.html#g6c4d97173a184f3f3b1049214d662582" title="Converts a cfixmat to cmat.">to_cmat</a>(real, imag);} |
---|
| 178 | <a name="l00188"></a>00188 |
---|
| 179 | <a name="l00190"></a><a class="code" href="group__fixed.html#gbaffacbe1bdace49708e167601163175">00190</a> <span class="keyword">template</span><<span class="keyword">class</span> T1, <span class="keyword">class</span> T2> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<T1></a> &y, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<T2></a> &x, <span class="keywordtype">int</span> n) |
---|
| 180 | <a name="l00191"></a>00191 { |
---|
| 181 | <a name="l00192"></a>00192 y.<a class="code" href="classitpp_1_1Array.html#dbf76c71f29014a4d53f254e83f3ff1c" title="Resizing an Array&lt;T&gt;.">set_size</a>(x.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>()); |
---|
| 182 | <a name="l00193"></a>00193 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>(); i++) <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(y(i), x(i), n); |
---|
| 183 | <a name="l00194"></a>00194 } |
---|
| 184 | <a name="l00196"></a><a class="code" href="group__fixed.html#gafed7736b313f7cc20fbb313fadf8e8f">00196</a> <span class="keyword">template</span><<span class="keyword">class</span> T1, <span class="keyword">class</span> T2> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<T1></a> &y, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<T2></a> &<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<T2></a> &<a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>, <span class="keywordtype">int</span> n) |
---|
| 185 | <a name="l00197"></a>00197 { |
---|
| 186 | <a name="l00198"></a>00198 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(real.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>() == imag.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>(), <span class="stringliteral">"set_fix: real and imag should have the same size"</span>); |
---|
| 187 | <a name="l00199"></a>00199 y.<a class="code" href="classitpp_1_1Array.html#dbf76c71f29014a4d53f254e83f3ff1c" title="Resizing an Array&lt;T&gt;.">set_size</a>(real.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>()); |
---|
| 188 | <a name="l00200"></a>00200 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>(); i++) <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(y(i), <a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>(i), <a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>(i), n); |
---|
| 189 | <a name="l00201"></a>00201 } |
---|
| 190 | <a name="l00203"></a><a class="code" href="group__fixed.html#gf84d7206d2466da2031979983e7bab06">00203</a> <span class="keyword">template</span><<span class="keyword">class</span> T1, <span class="keyword">class</span> T2> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<T1></a> &y, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<T2></a> &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) |
---|
| 191 | <a name="l00204"></a>00204 { |
---|
| 192 | <a name="l00205"></a>00205 y.<a class="code" href="classitpp_1_1Array.html#dbf76c71f29014a4d53f254e83f3ff1c" title="Resizing an Array&lt;T&gt;.">set_size</a>(x.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>()); |
---|
| 193 | <a name="l00206"></a>00206 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>(); i++) <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(y(i), x(i), n, q); |
---|
| 194 | <a name="l00207"></a>00207 } |
---|
| 195 | <a name="l00209"></a><a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f">00209</a> <span class="keyword">template</span><<span class="keyword">class</span> T1, <span class="keyword">class</span> T2> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(<a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<T1></a> &y, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<T2></a> &<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<T2></a> &<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) |
---|
| 196 | <a name="l00210"></a>00210 { |
---|
| 197 | <a name="l00211"></a>00211 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(real.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>() == imag.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>(), <span class="stringliteral">"set_fix: real and imag should have the same size"</span>); |
---|
| 198 | <a name="l00212"></a>00212 y.<a class="code" href="classitpp_1_1Array.html#dbf76c71f29014a4d53f254e83f3ff1c" title="Resizing an Array&lt;T&gt;.">set_size</a>(real.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>()); |
---|
| 199 | <a name="l00213"></a>00213 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>(); i++) <a class="code" href="group__fixed.html#g8ff9517ce04505a97400b46cb97f456f" title="Call set_fix for each Array element.">set_fix</a>(y(i), <a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>(i), <a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>(i), n, q); |
---|
| 200 | <a name="l00214"></a>00214 } |
---|
| 201 | <a name="l00215"></a>00215 |
---|
| 202 | <a name="l00217"></a><a class="code" href="group__fixed.html#g6446c79a3f1526f6f46dff1d498555b9">00217</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#gd4cf746982dd05989def1a483a502015" title="Call lshift_fix for each Array element.">lshift_fix</a>(<a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &y, <span class="keywordtype">int</span> n) {y.<a class="code" href="classitpp_1_1Fix.html#10b44520817964b76b3418e2dd407b5e" title="Left shift n bits.">lshift</a>(n);} |
---|
| 203 | <a name="l00219"></a><a class="code" href="group__fixed.html#g0f9fbcb00467ce1726988544800dfe80">00219</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(<a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &y, <span class="keywordtype">int</span> n) {y.<a class="code" href="classitpp_1_1Fix.html#2c31697dd668cf8063b4a65b00fe2593" title="Right shift n bits using quantization mode qmode (constructor argument).">rshift</a>(n);} |
---|
| 204 | <a name="l00221"></a><a class="code" href="group__fixed.html#gfd63e560e3c6cfd28d8cd6c68688950c">00221</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(<a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &y, <span class="keywordtype">int</span> n, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a> q) {y.<a class="code" href="classitpp_1_1Fix.html#2c31697dd668cf8063b4a65b00fe2593" title="Right shift n bits using quantization mode qmode (constructor argument).">rshift</a>(n, q);} |
---|
| 205 | <a name="l00223"></a><a class="code" href="group__fixed.html#g4558806406d4dbeae105e6e53e1cb6d0">00223</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#gd4cf746982dd05989def1a483a502015" title="Call lshift_fix for each Array element.">lshift_fix</a>(<a class="code" href="classitpp_1_1Vec.html" title="Vector Class (Templated).">fixvec</a> &y, <span class="keywordtype">int</span> n) |
---|
| 206 | <a name="l00224"></a>00224 {<span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Vec.html#a906c893cd6184a774e4da8a47217d6a" title="The size of the vector.">size</a>(); i++) y(i).lshift(n);} |
---|
| 207 | <a name="l00226"></a><a class="code" href="group__fixed.html#g5a0dc60d91a42e3233f9a09b013f003e">00226</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(<a class="code" href="classitpp_1_1Vec.html" title="Vector Class (Templated).">fixvec</a> &y, <span class="keywordtype">int</span> n) |
---|
| 208 | <a name="l00227"></a>00227 {<span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Vec.html#a906c893cd6184a774e4da8a47217d6a" title="The size of the vector.">size</a>(); i++) y(i).rshift(n);} |
---|
| 209 | <a name="l00229"></a><a class="code" href="group__fixed.html#gca3dc538d2768f1b2ec8408df736e7c7">00229</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(<a class="code" href="classitpp_1_1Vec.html" title="Vector Class (Templated).">fixvec</a> &y, <span class="keywordtype">int</span> n, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a> q) |
---|
| 210 | <a name="l00230"></a>00230 {<span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Vec.html#a906c893cd6184a774e4da8a47217d6a" title="The size of the vector.">size</a>(); i++) y(i).rshift(n, q);} |
---|
| 211 | <a name="l00232"></a><a class="code" href="group__fixed.html#g1083ba6169845e5c7fa0c8f4158be4b6">00232</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#gd4cf746982dd05989def1a483a502015" title="Call lshift_fix for each Array element.">lshift_fix</a>(<a class="code" href="classitpp_1_1Mat.html" title="Matrix Class (Templated).">fixmat</a> &y, <span class="keywordtype">int</span> n) |
---|
| 212 | <a name="l00233"></a>00233 {<span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Mat.html#9c0850a9a2fad79960498864226818a0" title="The number of elements.">size</a>(); i++) y(i).lshift(n);} |
---|
| 213 | <a name="l00235"></a><a class="code" href="group__fixed.html#g7f48074f7bfebe18a91bc29bc38bf29f">00235</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(<a class="code" href="classitpp_1_1Mat.html" title="Matrix Class (Templated).">fixmat</a> &y, <span class="keywordtype">int</span> n) |
---|
| 214 | <a name="l00236"></a>00236 {<span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Mat.html#9c0850a9a2fad79960498864226818a0" title="The number of elements.">size</a>(); i++) y(i).rshift(n);} |
---|
| 215 | <a name="l00238"></a><a class="code" href="group__fixed.html#gd2958f86486b660bf795c582cb1bee27">00238</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(<a class="code" href="classitpp_1_1Mat.html" title="Matrix Class (Templated).">fixmat</a> &y, <span class="keywordtype">int</span> n, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a> q) |
---|
| 216 | <a name="l00239"></a>00239 {<span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Mat.html#9c0850a9a2fad79960498864226818a0" title="The number of elements.">size</a>(); i++) y(i).rshift(n, q);} |
---|
| 217 | <a name="l00241"></a><a class="code" href="group__fixed.html#g26dcfc95d6149c9f8c2e67a963273087">00241</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#gd4cf746982dd05989def1a483a502015" title="Call lshift_fix for each Array element.">lshift_fix</a>(<span class="keywordtype">double</span> &, <span class="keywordtype">int</span>) {} |
---|
| 218 | <a name="l00243"></a><a class="code" href="group__fixed.html#gc6737eef7753b31632932326d0d05101">00243</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(<span class="keywordtype">double</span> &, <span class="keywordtype">int</span>) {} |
---|
| 219 | <a name="l00245"></a><a class="code" href="group__fixed.html#g0a7ff8d412e763d8d5a264d3e7fbfa16">00245</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(<span class="keywordtype">double</span> &, <span class="keywordtype">int</span>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a>) {} |
---|
| 220 | <a name="l00247"></a><a class="code" href="group__fixed.html#gbd5ae2f403e181ba08426a597221dcfd">00247</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#gd4cf746982dd05989def1a483a502015" title="Call lshift_fix for each Array element.">lshift_fix</a>(vec &, <span class="keywordtype">int</span>) {} |
---|
| 221 | <a name="l00249"></a><a class="code" href="group__fixed.html#g240004f99baf576c28e5e3bcc2035c79">00249</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(vec &, <span class="keywordtype">int</span>) {} |
---|
| 222 | <a name="l00251"></a><a class="code" href="group__fixed.html#g66de050e04b841cbdc80ab25a8f78e3d">00251</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(vec &, <span class="keywordtype">int</span>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a>) {} |
---|
| 223 | <a name="l00253"></a><a class="code" href="group__fixed.html#gf84b709cb29dfc0a9b7f1bf9b4049f06">00253</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#gd4cf746982dd05989def1a483a502015" title="Call lshift_fix for each Array element.">lshift_fix</a>(mat &, <span class="keywordtype">int</span>) {} |
---|
| 224 | <a name="l00255"></a><a class="code" href="group__fixed.html#g4cd4a7449ac23239a43cc1299922ecef">00255</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(mat &, <span class="keywordtype">int</span>) {} |
---|
| 225 | <a name="l00257"></a><a class="code" href="group__fixed.html#g5552f5c88e26332364294720e786368f">00257</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(mat &, <span class="keywordtype">int</span>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a>) {} |
---|
| 226 | <a name="l00259"></a><a class="code" href="group__fixed.html#g8f1546f9ab7eb28fae1bbe3a074a2adc">00259</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#gd4cf746982dd05989def1a483a502015" title="Call lshift_fix for each Array element.">lshift_fix</a>(<a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &y, <span class="keywordtype">int</span> n) {y.<a class="code" href="classitpp_1_1CFix.html#61ff5d70bc5b983ac4fe34d2ee2a830a" title="Left shift n bits.">lshift</a>(n);} |
---|
| 227 | <a name="l00261"></a><a class="code" href="group__fixed.html#g39d9d79fd6ed4882479c06a62609b433">00261</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(<a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &y, <span class="keywordtype">int</span> n) {y.<a class="code" href="classitpp_1_1CFix.html#b289e5b8b4bf58da601bcd251ea43e32" title="Right shift n bits using quantization mode qmode (constructor argument).">rshift</a>(n);} |
---|
| 228 | <a name="l00263"></a><a class="code" href="group__fixed.html#g72efa51f38b18a09a38d87cdd5ee0c4a">00263</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(<a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &y, <span class="keywordtype">int</span> n, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a> q) {y.<a class="code" href="classitpp_1_1CFix.html#b289e5b8b4bf58da601bcd251ea43e32" title="Right shift n bits using quantization mode qmode (constructor argument).">rshift</a>(n, q);} |
---|
| 229 | <a name="l00265"></a>00265 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#gd4cf746982dd05989def1a483a502015" title="Call lshift_fix for each Array element.">lshift_fix</a>(<a class="code" href="group__fixed.html#g057e78df9719352a7a2ae36c0e190982" title="Typedef for complex fixed-point vector type.">cfixvec</a> &y, <span class="keywordtype">int</span> n) |
---|
| 230 | <a name="l00266"></a>00266 {<span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i < y.size(); i++) y(i).lshift(n);} |
---|
| 231 | <a name="l00268"></a>00268 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(<a class="code" href="group__fixed.html#g057e78df9719352a7a2ae36c0e190982" title="Typedef for complex fixed-point vector type.">cfixvec</a> &y, <span class="keywordtype">int</span> n) |
---|
| 232 | <a name="l00269"></a>00269 {<span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i < y.size(); i++) y(i).rshift(n);} |
---|
| 233 | <a name="l00271"></a>00271 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(<a class="code" href="group__fixed.html#g057e78df9719352a7a2ae36c0e190982" title="Typedef for complex fixed-point vector type.">cfixvec</a> &y, <span class="keywordtype">int</span> n, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a> q) |
---|
| 234 | <a name="l00272"></a>00272 {<span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i < y.size(); i++) y(i).rshift(n, q);} |
---|
| 235 | <a name="l00274"></a>00274 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#gd4cf746982dd05989def1a483a502015" title="Call lshift_fix for each Array element.">lshift_fix</a>(<a class="code" href="group__fixed.html#g6dd4e3e315ed992df7841744c656afce" title="Typedef for complex fixed-point matrix type.">cfixmat</a> &y, <span class="keywordtype">int</span> n) |
---|
| 236 | <a name="l00275"></a>00275 {<span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i < y.size(); i++) y(i).lshift(n);} |
---|
| 237 | <a name="l00277"></a>00277 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(<a class="code" href="group__fixed.html#g6dd4e3e315ed992df7841744c656afce" title="Typedef for complex fixed-point matrix type.">cfixmat</a> &y, <span class="keywordtype">int</span> n) |
---|
| 238 | <a name="l00278"></a>00278 {<span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i < y.size(); i++) y(i).rshift(n);} |
---|
| 239 | <a name="l00280"></a>00280 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(<a class="code" href="group__fixed.html#g6dd4e3e315ed992df7841744c656afce" title="Typedef for complex fixed-point matrix type.">cfixmat</a> &y, <span class="keywordtype">int</span> n, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a> q) |
---|
| 240 | <a name="l00281"></a>00281 {<span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i < y.size(); i++) y(i).rshift(n, q);} |
---|
| 241 | <a name="l00283"></a><a class="code" href="group__fixed.html#gc807ab4ee089b1049d55234a7ac41ccd">00283</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#gd4cf746982dd05989def1a483a502015" title="Call lshift_fix for each Array element.">lshift_fix</a>(std::complex<double> &, <span class="keywordtype">int</span>) {} |
---|
| 242 | <a name="l00285"></a><a class="code" href="group__fixed.html#g974cb39ac5883383c25b99663178546a">00285</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(std::complex<double> &, <span class="keywordtype">int</span>) {} |
---|
| 243 | <a name="l00287"></a><a class="code" href="group__fixed.html#g1bf8ca8bf55c462d51ae8500669f451c">00287</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(std::complex<double> &, <span class="keywordtype">int</span>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a>) {} |
---|
| 244 | <a name="l00289"></a><a class="code" href="group__fixed.html#gc1361ef6f08a295827ed5fbc936266ff">00289</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#gd4cf746982dd05989def1a483a502015" title="Call lshift_fix for each Array element.">lshift_fix</a>(cvec &, <span class="keywordtype">int</span>) {} |
---|
| 245 | <a name="l00291"></a><a class="code" href="group__fixed.html#gd948c2898e6db3955328090180cf1bb7">00291</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(cvec &, <span class="keywordtype">int</span>) {} |
---|
| 246 | <a name="l00293"></a><a class="code" href="group__fixed.html#g1bb420d22fe4da7526a8ea2fafe2126e">00293</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(cvec &, <span class="keywordtype">int</span>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a>) {} |
---|
| 247 | <a name="l00295"></a><a class="code" href="group__fixed.html#g7de73cc795e28608affad19b920b471a">00295</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#gd4cf746982dd05989def1a483a502015" title="Call lshift_fix for each Array element.">lshift_fix</a>(cmat &, <span class="keywordtype">int</span>) {} |
---|
| 248 | <a name="l00297"></a><a class="code" href="group__fixed.html#g0f2217713b84961fdb461484be3b2049">00297</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(cmat &, <span class="keywordtype">int</span>) {} |
---|
| 249 | <a name="l00299"></a><a class="code" href="group__fixed.html#g2b5221ee72bd6c0142d8631373c7ed25">00299</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(cmat &, <span class="keywordtype">int</span>, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a>) {} |
---|
| 250 | <a name="l00301"></a><a class="code" href="group__fixed.html#gd4cf746982dd05989def1a483a502015">00301</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#gd4cf746982dd05989def1a483a502015" title="Call lshift_fix for each Array element.">lshift_fix</a>(<a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<T></a> &y, <span class="keywordtype">int</span> n) |
---|
| 251 | <a name="l00302"></a>00302 {<span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>(); i++) <a class="code" href="group__fixed.html#gd4cf746982dd05989def1a483a502015" title="Call lshift_fix for each Array element.">lshift_fix</a>(y(i), n);} |
---|
| 252 | <a name="l00304"></a><a class="code" href="group__fixed.html#g7d985184865a328e832929f1ba49d5f9">00304</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(<a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<T></a> &y, <span class="keywordtype">int</span> n) |
---|
| 253 | <a name="l00305"></a>00305 {<span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>(); i++) <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(y(i), n);} |
---|
| 254 | <a name="l00307"></a><a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7">00307</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(<a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<T></a> &y, <span class="keywordtype">int</span> n, <a class="code" href="group__fixed.html#ga644362f0b3d795ce8521326e20fed11" title="Quantization modes (aligned with SystemC).">q_mode</a> q) |
---|
| 255 | <a name="l00308"></a>00308 {<span class="keywordflow">for</span>(<span class="keywordtype">int</span> i = 0; i < y.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>(); i++) <a class="code" href="group__fixed.html#g48cb6c19f3d1cc2a2db946d04880a6e7" title="Call rshift_fix for each Array element.">rshift_fix</a>(y(i), n, q);} |
---|
| 256 | <a name="l00309"></a>00309 |
---|
| 257 | <a name="l00311"></a><a class="code" href="group__fixed.html#gab32a9da43830ccb123436ea1f75c372">00311</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g1b0501a0f8c9473d7b1c17f5218ff41a" title="If x is a fixed-point variable, assert that x has the specified shift value, otherwise...">assert_fixshift</a>(<span class="keywordtype">double</span>, <span class="keywordtype">int</span>) {} |
---|
| 258 | <a name="l00313"></a><a class="code" href="group__fixed.html#gb32c687d3137d5d3432a0a276623f9da">00313</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g1b0501a0f8c9473d7b1c17f5218ff41a" title="If x is a fixed-point variable, assert that x has the specified shift value, otherwise...">assert_fixshift</a>(<span class="keyword">const</span> std::complex<double> &, <span class="keywordtype">int</span>) {} |
---|
| 259 | <a name="l00315"></a><a class="code" href="group__fixed.html#g3b7add562d989a3ae511ea104b24cd47">00315</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g1b0501a0f8c9473d7b1c17f5218ff41a" title="If x is a fixed-point variable, assert that x has the specified shift value, otherwise...">assert_fixshift</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &x, <span class="keywordtype">int</span> shift) |
---|
| 260 | <a name="l00316"></a>00316 {<a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(x.<a class="code" href="classitpp_1_1Fix__Base.html#e1224ef62f15c1dcfddc2248697f554a" title="Get shift.">get_shift</a>() == shift, <span class="stringliteral">"Shift should be "</span> + <a class="code" href="group__convertfunc.html#g67127e32647b00caaed837ea24fb63f1" title="Convert double to string.">to_str</a>(shift) + <span class="stringliteral">" but it is "</span> + <a class="code" href="group__convertfunc.html#g67127e32647b00caaed837ea24fb63f1" title="Convert double to string.">to_str</a>(x.<a class="code" href="classitpp_1_1Fix__Base.html#e1224ef62f15c1dcfddc2248697f554a" title="Get shift.">get_shift</a>()) + <span class="stringliteral">"."</span>);} |
---|
| 261 | <a name="l00318"></a><a class="code" href="group__fixed.html#g1b0501a0f8c9473d7b1c17f5218ff41a">00318</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="group__fixed.html#g1b0501a0f8c9473d7b1c17f5218ff41a" title="If x is a fixed-point variable, assert that x has the specified shift value, otherwise...">assert_fixshift</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &x, <span class="keywordtype">int</span> shift) |
---|
| 262 | <a name="l00319"></a>00319 {<a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(x.<a class="code" href="classitpp_1_1Fix__Base.html#e1224ef62f15c1dcfddc2248697f554a" title="Get shift.">get_shift</a>() == shift, <span class="stringliteral">"Shift should be "</span> + <a class="code" href="group__convertfunc.html#g67127e32647b00caaed837ea24fb63f1" title="Convert double to string.">to_str</a>(shift) + <span class="stringliteral">" but it is "</span> + <a class="code" href="group__convertfunc.html#g67127e32647b00caaed837ea24fb63f1" title="Convert double to string.">to_str</a>(x.<a class="code" href="classitpp_1_1Fix__Base.html#e1224ef62f15c1dcfddc2248697f554a" title="Get shift.">get_shift</a>()) + <span class="stringliteral">"."</span>);} |
---|
| 263 | <a name="l00320"></a>00320 |
---|
| 264 | <a name="l00322"></a>00322 vec <a class="code" href="group__fixed.html#g9e5d027084a2a9e65500a0f5d4cf81a8" title="Converts a fixvec to vec.">to_vec</a>(<span class="keyword">const</span> <a class="code" href="group__fixed.html#gf4093112bbb02b7c82af656adf439499" title="Typedef for fixed-point vector type.">fixvec</a> &v); |
---|
| 265 | <a name="l00324"></a>00324 cvec <a class="code" href="group__fixed.html#g3f0aa27746b5d5880f77e96c089498f2" title="Converts a cfixvec to cvec.">to_cvec</a>(<span class="keyword">const</span> <a class="code" href="group__fixed.html#g057e78df9719352a7a2ae36c0e190982" title="Typedef for complex fixed-point vector type.">cfixvec</a> &v); |
---|
| 266 | <a name="l00326"></a>00326 mat <a class="code" href="group__fixed.html#g36d7bf8746a81d073e4db8b0ad3bec86" title="Converts a fixmat to mat.">to_mat</a>(<span class="keyword">const</span> <a class="code" href="group__fixed.html#ga6edd9ee2e20c44f90a3bef4cebb07b1" title="Typedef for fixed-point matrix type.">fixmat</a> &m); |
---|
| 267 | <a name="l00328"></a>00328 cmat <a class="code" href="group__fixed.html#g6c4d97173a184f3f3b1049214d662582" title="Converts a cfixmat to cmat.">to_cmat</a>(<span class="keyword">const</span> <a class="code" href="group__fixed.html#g6dd4e3e315ed992df7841744c656afce" title="Typedef for complex fixed-point matrix type.">cfixmat</a> &m); |
---|
| 268 | <a name="l00329"></a>00329 |
---|
| 269 | <a name="l00331"></a>00331 |
---|
| 270 | <a name="l00333"></a>00333 <span class="keyword">template</span><<span class="keyword">class</span> T, <span class="keyword">class</span> U> |
---|
| 271 | <a name="l00334"></a>00334 <span class="keyword">class </span>ConvertU2T |
---|
| 272 | <a name="l00335"></a>00335 { |
---|
| 273 | <a name="l00336"></a>00336 <span class="keyword">public</span>: |
---|
| 274 | <a name="l00337"></a>00337 <span class="keyword">typedef</span> T result; |
---|
| 275 | <a name="l00338"></a>00338 }; |
---|
| 276 | <a name="l00340"></a>00340 <span class="keyword">template</span><<span class="keyword">class</span> T, <span class="keyword">class</span> U> |
---|
| 277 | <a name="l00341"></a>00341 <span class="keyword">class </span>ConvertU2T<T, Array<U> > |
---|
| 278 | <a name="l00342"></a>00342 { |
---|
| 279 | <a name="l00343"></a>00343 <span class="keyword">public</span>: |
---|
| 280 | <a name="l00344"></a>00344 <span class="keyword">typedef</span> Array<typename ConvertU2T<T, U>::result> result; <span class="comment">// Recursive</span> |
---|
| 281 | <a name="l00345"></a>00345 }; |
---|
| 282 | <a name="l00347"></a>00347 <span class="keyword">template</span><<span class="keyword">class</span> T, <span class="keyword">class</span> U> |
---|
| 283 | <a name="l00348"></a>00348 <span class="keyword">class </span>ConvertU2T<T, Vec<U> > |
---|
| 284 | <a name="l00349"></a>00349 { |
---|
| 285 | <a name="l00350"></a>00350 <span class="keyword">public</span>: |
---|
| 286 | <a name="l00351"></a>00351 <span class="keyword">typedef</span> Vec<T> result; |
---|
| 287 | <a name="l00352"></a>00352 }; |
---|
| 288 | <a name="l00354"></a>00354 <span class="keyword">template</span><<span class="keyword">class</span> T, <span class="keyword">class</span> U> |
---|
| 289 | <a name="l00355"></a>00355 <span class="keyword">class </span>ConvertU2T<T, Mat<U> > |
---|
| 290 | <a name="l00356"></a>00356 { |
---|
| 291 | <a name="l00357"></a>00357 <span class="keyword">public</span>: |
---|
| 292 | <a name="l00358"></a>00358 <span class="keyword">typedef</span> Mat<T> result; |
---|
| 293 | <a name="l00359"></a>00359 }; |
---|
| 294 | <a name="l00360"></a>00360 |
---|
| 295 | <a name="l00362"></a>00362 |
---|
| 296 | <a name="l00364"></a><a class="code" href="group__fixed.html#gb4732503214b5293aef0cbd2ab271c7c">00364</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">inline</span> T <a class="code" href="group__fixed.html#g77ba7ec514a9115a0d560b60de9e0cea" title="Convert Array&lt;U&gt; (real and imaginary parts), where U can be an Array/Vec/Mat...">to</a>(<span class="keywordtype">double</span> x) {<span class="keywordflow">return</span> T(x);} |
---|
| 297 | <a name="l00366"></a><a class="code" href="group__fixed.html#gef0624fa9f098fe61477dee2867fee86">00366</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">inline</span> T <a class="code" href="group__fixed.html#g77ba7ec514a9115a0d560b60de9e0cea" title="Convert Array&lt;U&gt; (real and imaginary parts), where U can be an Array/Vec/Mat...">to</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &x) {<span class="keywordflow">return</span> T(x);} |
---|
| 298 | <a name="l00368"></a><a class="code" href="group__fixed.html#g01984e272467d5c9d6415081ccb65f1c">00368</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">inline</span> T <a class="code" href="group__fixed.html#g77ba7ec514a9115a0d560b60de9e0cea" title="Convert Array&lt;U&gt; (real and imaginary parts), where U can be an Array/Vec/Mat...">to</a>(<span class="keyword">const</span> std::complex<double> &x) {<span class="keywordflow">return</span> T(x);} |
---|
| 299 | <a name="l00370"></a><a class="code" href="group__fixed.html#gce3c582a932fcc7cb765b3c22f30ec1c">00370</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">inline</span> T <a class="code" href="group__fixed.html#g77ba7ec514a9115a0d560b60de9e0cea" title="Convert Array&lt;U&gt; (real and imaginary parts), where U can be an Array/Vec/Mat...">to</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &x) {<span class="keywordflow">return</span> T(x);} |
---|
| 300 | <a name="l00372"></a><a class="code" href="group__fixed.html#geefaaed9a93f554c86510bb8f7d98f25">00372</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">inline</span> T <a class="code" href="group__fixed.html#g77ba7ec514a9115a0d560b60de9e0cea" title="Convert Array&lt;U&gt; (real and imaginary parts), where U can be an Array/Vec/Mat...">to</a>(<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="keywordflow">return</span> T(real, imag);} |
---|
| 301 | <a name="l00374"></a><a class="code" href="group__fixed.html#gc565668a74750b20dd0dc011eb8faec7">00374</a> <span class="keyword">template</span><<span class="keyword">class</span> T> <span class="keyword">inline</span> T <a class="code" href="group__fixed.html#g77ba7ec514a9115a0d560b60de9e0cea" title="Convert Array&lt;U&gt; (real and imaginary parts), where U can be an Array/Vec/Mat...">to</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &<a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>) {<span class="keywordflow">return</span> T(real, imag);} |
---|
| 302 | <a name="l00375"></a>00375 |
---|
| 303 | <a name="l00377"></a><a class="code" href="group__fixed.html#ge2e8d0ae95dfe67c20526aee81017baa">00377</a> <span class="keyword">template</span><<span class="keyword">class</span> T, <span class="keyword">class</span> U> <a class="code" href="classitpp_1_1Vec.html">Vec<T></a> <a class="code" href="group__fixed.html#g77ba7ec514a9115a0d560b60de9e0cea" title="Convert Array&lt;U&gt; (real and imaginary parts), where U can be an Array/Vec/Mat...">to</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Vec.html" title="Vector Class (Templated).">Vec<U></a> &x) |
---|
| 304 | <a name="l00378"></a>00378 { |
---|
| 305 | <a name="l00379"></a>00379 <a class="code" href="classitpp_1_1Vec.html">Vec<T></a> y(x.<a class="code" href="classitpp_1_1Vec.html#44478ea086eda22a180102e77e352325" title="The size of the vector.">length</a>()); |
---|
| 306 | <a name="l00380"></a>00380 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < x.<a class="code" href="classitpp_1_1Vec.html#44478ea086eda22a180102e77e352325" title="The size of the vector.">length</a>(); i++) { |
---|
| 307 | <a name="l00381"></a>00381 y(i) = T(x(i)); |
---|
| 308 | <a name="l00382"></a>00382 } |
---|
| 309 | <a name="l00383"></a>00383 <span class="keywordflow">return</span> y; |
---|
| 310 | <a name="l00384"></a>00384 } |
---|
| 311 | <a name="l00386"></a>00386 <span class="keyword">template</span><> <span class="keyword">inline</span> vec <a class="code" href="group__fixed.html#g43431944b8a7dac1469fe0fcf74d360d" title="Convert mat to mat.">to<double></a>(<span class="keyword">const</span> vec &x) {<span class="keywordflow">return</span> x;} |
---|
| 312 | <a name="l00388"></a>00388 <span class="keyword">template</span><> <span class="keyword">inline</span> cvec to<std::complex<double> >(<span class="keyword">const</span> cvec &x) {<span class="keywordflow">return</span> x;} |
---|
| 313 | <a name="l00390"></a>00390 <span class="keyword">template</span><> <span class="keyword">inline</span> <a class="code" href="group__fixed.html#gf4093112bbb02b7c82af656adf439499" title="Typedef for fixed-point vector type.">fixvec</a> <a class="code" href="group__fixed.html#g1abac28c8226fa0305f7aab6ff5688be" title="Convert fixmat to fixmat.">to<Fix></a>(<span class="keyword">const</span> <a class="code" href="group__fixed.html#gf4093112bbb02b7c82af656adf439499" title="Typedef for fixed-point vector type.">fixvec</a> &x) {<span class="keywordflow">return</span> x;} |
---|
| 314 | <a name="l00392"></a>00392 <span class="keyword">template</span><> <span class="keyword">inline</span> <a class="code" href="group__fixed.html#g057e78df9719352a7a2ae36c0e190982" title="Typedef for complex fixed-point vector type.">cfixvec</a> <a class="code" href="group__fixed.html#ga6a1a87b29e20883f1e1ddc86136e9e1" title="Convert cfixmat to cfixmat.">to<CFix></a>(<span class="keyword">const</span> <a class="code" href="group__fixed.html#g057e78df9719352a7a2ae36c0e190982" title="Typedef for complex fixed-point vector type.">cfixvec</a> &x) {<span class="keywordflow">return</span> x;} |
---|
| 315 | <a name="l00393"></a>00393 |
---|
| 316 | <a name="l00395"></a><a class="code" href="group__fixed.html#g7e9a14b0c87687dfdd805d8df38fdf3b">00395</a> <span class="keyword">template</span><<span class="keyword">class</span> T, <span class="keyword">class</span> U> <a class="code" href="classitpp_1_1Vec.html">Vec<T></a> <a class="code" href="group__fixed.html#g77ba7ec514a9115a0d560b60de9e0cea" title="Convert Array&lt;U&gt; (real and imaginary parts), where U can be an Array/Vec/Mat...">to</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Vec.html" title="Vector Class (Templated).">Vec<U></a> &<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Vec.html" title="Vector Class (Templated).">Vec<U></a> &<a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>) |
---|
| 317 | <a name="l00396"></a>00396 { |
---|
| 318 | <a name="l00397"></a>00397 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(real.<a class="code" href="classitpp_1_1Vec.html#44478ea086eda22a180102e77e352325" title="The size of the vector.">length</a>() == imag.<a class="code" href="classitpp_1_1Vec.html#44478ea086eda22a180102e77e352325" title="The size of the vector.">length</a>(), <span class="stringliteral">"to: real and imag should have the same size"</span>); |
---|
| 319 | <a name="l00398"></a>00398 <a class="code" href="classitpp_1_1Vec.html">Vec<T></a> y(real.<a class="code" href="classitpp_1_1Vec.html#44478ea086eda22a180102e77e352325" title="The size of the vector.">length</a>()); |
---|
| 320 | <a name="l00399"></a>00399 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < real.<a class="code" href="classitpp_1_1Vec.html#44478ea086eda22a180102e77e352325" title="The size of the vector.">length</a>(); i++) { |
---|
| 321 | <a name="l00400"></a>00400 y(i) = T(<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>(i), <a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>(i)); |
---|
| 322 | <a name="l00401"></a>00401 } |
---|
| 323 | <a name="l00402"></a>00402 <span class="keywordflow">return</span> y; |
---|
| 324 | <a name="l00403"></a>00403 } |
---|
| 325 | <a name="l00404"></a>00404 |
---|
| 326 | <a name="l00406"></a><a class="code" href="group__fixed.html#g5dc3bf508827391def960c736c72ee02">00406</a> <span class="keyword">template</span><<span class="keyword">class</span> T, <span class="keyword">class</span> U> <a class="code" href="classitpp_1_1Mat.html">Mat<T></a> <a class="code" href="group__fixed.html#g77ba7ec514a9115a0d560b60de9e0cea" title="Convert Array&lt;U&gt; (real and imaginary parts), where U can be an Array/Vec/Mat...">to</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Mat.html" title="Matrix Class (Templated).">Mat<U></a> &x) |
---|
| 327 | <a name="l00407"></a>00407 { |
---|
| 328 | <a name="l00408"></a>00408 <a class="code" href="classitpp_1_1Mat.html">Mat<T></a> y(x.<a class="code" href="classitpp_1_1Mat.html#f3028609c01e08fb07c5bf0bcd4c4e03" title="The number of rows.">rows</a>(), x.<a class="code" href="classitpp_1_1Mat.html#49680ef454d1d75b737e3ce157f1ac7b" title="The number of columns.">cols</a>()); |
---|
| 329 | <a name="l00409"></a>00409 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < x.<a class="code" href="classitpp_1_1Mat.html#f3028609c01e08fb07c5bf0bcd4c4e03" title="The number of rows.">rows</a>(); i++) { |
---|
| 330 | <a name="l00410"></a>00410 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j < x.<a class="code" href="classitpp_1_1Mat.html#49680ef454d1d75b737e3ce157f1ac7b" title="The number of columns.">cols</a>(); j++) { |
---|
| 331 | <a name="l00411"></a>00411 y(i, j) = T(x(i, j)); |
---|
| 332 | <a name="l00412"></a>00412 } |
---|
| 333 | <a name="l00413"></a>00413 } |
---|
| 334 | <a name="l00414"></a>00414 <span class="keywordflow">return</span> y; |
---|
| 335 | <a name="l00415"></a>00415 } |
---|
| 336 | <a name="l00417"></a>00417 <span class="keyword">template</span><> <span class="keyword">inline</span> mat <a class="code" href="group__fixed.html#g43431944b8a7dac1469fe0fcf74d360d" title="Convert mat to mat.">to<double></a>(<span class="keyword">const</span> mat &x) {<span class="keywordflow">return</span> x;} |
---|
| 337 | <a name="l00419"></a>00419 <span class="keyword">template</span><> <span class="keyword">inline</span> cmat to<std::complex<double> >(<span class="keyword">const</span> cmat &x) {<span class="keywordflow">return</span> x;} |
---|
| 338 | <a name="l00421"></a>00421 <span class="keyword">template</span><> <span class="keyword">inline</span> <a class="code" href="group__fixed.html#ga6edd9ee2e20c44f90a3bef4cebb07b1" title="Typedef for fixed-point matrix type.">fixmat</a> <a class="code" href="group__fixed.html#g1abac28c8226fa0305f7aab6ff5688be" title="Convert fixmat to fixmat.">to<Fix></a>(<span class="keyword">const</span> <a class="code" href="group__fixed.html#ga6edd9ee2e20c44f90a3bef4cebb07b1" title="Typedef for fixed-point matrix type.">fixmat</a> &x) {<span class="keywordflow">return</span> x;} |
---|
| 339 | <a name="l00423"></a>00423 <span class="keyword">template</span><> <span class="keyword">inline</span> <a class="code" href="group__fixed.html#g6dd4e3e315ed992df7841744c656afce" title="Typedef for complex fixed-point matrix type.">cfixmat</a> <a class="code" href="group__fixed.html#ga6a1a87b29e20883f1e1ddc86136e9e1" title="Convert cfixmat to cfixmat.">to<CFix></a>(<span class="keyword">const</span> <a class="code" href="group__fixed.html#g6dd4e3e315ed992df7841744c656afce" title="Typedef for complex fixed-point matrix type.">cfixmat</a> &x) {<span class="keywordflow">return</span> x;} |
---|
| 340 | <a name="l00424"></a>00424 |
---|
| 341 | <a name="l00426"></a><a class="code" href="group__fixed.html#g5771ce338e2bd60b8a5072ac0c5d1bf8">00426</a> <span class="keyword">template</span><<span class="keyword">class</span> T, <span class="keyword">class</span> U> <a class="code" href="classitpp_1_1Mat.html">Mat<T></a> <a class="code" href="group__fixed.html#g77ba7ec514a9115a0d560b60de9e0cea" title="Convert Array&lt;U&gt; (real and imaginary parts), where U can be an Array/Vec/Mat...">to</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Mat.html" title="Matrix Class (Templated).">Mat<U></a> &<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Mat.html" title="Matrix Class (Templated).">Mat<U></a> &<a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>) |
---|
| 342 | <a name="l00427"></a>00427 { |
---|
| 343 | <a name="l00428"></a>00428 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(real.<a class="code" href="classitpp_1_1Mat.html#f3028609c01e08fb07c5bf0bcd4c4e03" title="The number of rows.">rows</a>() == imag.<a class="code" href="classitpp_1_1Mat.html#f3028609c01e08fb07c5bf0bcd4c4e03" title="The number of rows.">rows</a>() && real.<a class="code" href="classitpp_1_1Mat.html#49680ef454d1d75b737e3ce157f1ac7b" title="The number of columns.">cols</a>() == imag.<a class="code" href="classitpp_1_1Mat.html#49680ef454d1d75b737e3ce157f1ac7b" title="The number of columns.">cols</a>(), <span class="stringliteral">"to: real and imag should have the same size"</span>); |
---|
| 344 | <a name="l00429"></a>00429 <a class="code" href="classitpp_1_1Mat.html">Mat<T></a> y(real.<a class="code" href="classitpp_1_1Mat.html#f3028609c01e08fb07c5bf0bcd4c4e03" title="The number of rows.">rows</a>(), real.<a class="code" href="classitpp_1_1Mat.html#49680ef454d1d75b737e3ce157f1ac7b" title="The number of columns.">cols</a>()); |
---|
| 345 | <a name="l00430"></a>00430 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < real.<a class="code" href="classitpp_1_1Mat.html#f3028609c01e08fb07c5bf0bcd4c4e03" title="The number of rows.">rows</a>(); i++) { |
---|
| 346 | <a name="l00431"></a>00431 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j < real.<a class="code" href="classitpp_1_1Mat.html#49680ef454d1d75b737e3ce157f1ac7b" title="The number of columns.">cols</a>(); j++) { |
---|
| 347 | <a name="l00432"></a>00432 y(i, j) = T(<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>(i, j), <a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>(i, j)); |
---|
| 348 | <a name="l00433"></a>00433 } |
---|
| 349 | <a name="l00434"></a>00434 } |
---|
| 350 | <a name="l00435"></a>00435 <span class="keywordflow">return</span> y; |
---|
| 351 | <a name="l00436"></a>00436 } |
---|
| 352 | <a name="l00437"></a>00437 |
---|
| 353 | <a name="l00439"></a>00439 <span class="keyword">template</span><<span class="keyword">class</span> T, <span class="keyword">class</span> U> |
---|
| 354 | <a name="l00440"></a><a class="code" href="group__fixed.html#gecc5681a151fc3015f2193180bb3b846">00440</a> <a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<typename ConvertU2T<T, U>::result</a>> <a class="code" href="group__fixed.html#g77ba7ec514a9115a0d560b60de9e0cea" title="Convert Array&lt;U&gt; (real and imaginary parts), where U can be an Array/Vec/Mat...">to</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<U></a> &x) |
---|
| 355 | <a name="l00441"></a>00441 { |
---|
| 356 | <a name="l00442"></a>00442 <a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<typename ConvertU2T<T, U>::result</a>> y(x.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>()); |
---|
| 357 | <a name="l00443"></a>00443 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < x.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>(); i++) { |
---|
| 358 | <a name="l00444"></a>00444 y(i) = to<T>(x(i)); |
---|
| 359 | <a name="l00445"></a>00445 } |
---|
| 360 | <a name="l00446"></a>00446 <span class="keywordflow">return</span> y; |
---|
| 361 | <a name="l00447"></a>00447 } |
---|
| 362 | <a name="l00448"></a>00448 |
---|
| 363 | <a name="l00450"></a>00450 <span class="keyword">template</span><<span class="keyword">class</span> T, <span class="keyword">class</span> U> |
---|
| 364 | <a name="l00451"></a><a class="code" href="group__fixed.html#g77ba7ec514a9115a0d560b60de9e0cea">00451</a> <a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<typename ConvertU2T<T, U>::result</a>> <a class="code" href="group__fixed.html#g77ba7ec514a9115a0d560b60de9e0cea" title="Convert Array&lt;U&gt; (real and imaginary parts), where U can be an Array/Vec/Mat...">to</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<U></a> &<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>, <span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<U></a> &<a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>) |
---|
| 365 | <a name="l00452"></a>00452 { |
---|
| 366 | <a name="l00453"></a>00453 <a class="code" href="group__errorhandlingfunc.html#gb319550e696ee9d824d23c2a176bc3a6" title="Abort if t is not true and NDEBUG is not defined.">it_assert_debug</a>(real.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>() == imag.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>(), <span class="stringliteral">"to: real and imag should have the same size"</span>); |
---|
| 367 | <a name="l00454"></a>00454 <a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<typename ConvertU2T<T, U>::result</a>> y(real.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>()); |
---|
| 368 | <a name="l00455"></a>00455 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < real.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>(); i++) { |
---|
| 369 | <a name="l00456"></a>00456 y(i) = to<T>(<a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>(i), <a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>(i)); |
---|
| 370 | <a name="l00457"></a>00457 } |
---|
| 371 | <a name="l00458"></a>00458 <span class="keywordflow">return</span> y; |
---|
| 372 | <a name="l00459"></a>00459 } |
---|
| 373 | <a name="l00460"></a>00460 |
---|
| 374 | <a name="l00462"></a><a class="code" href="group__fixed.html#g3bc4d7b660d973f9196f5dfba3bead89">00462</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="group__fixed.html#g99e7bb71548be1bc8b50704ac66bbe9a">unfix</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Fix.html" title="Fixed-point data type.">Fix</a> &x) {<span class="keywordflow">return</span> x.<a class="code" href="classitpp_1_1Fix.html#c70b5aad748a582e1ffef293d82e1b58" title="Conversion to double.">unfix</a>();} |
---|
| 375 | <a name="l00464"></a><a class="code" href="group__fixed.html#gc3e1685037bc5a2b5e554168278aae57">00464</a> <span class="keyword">inline</span> std::complex<double> <a class="code" href="group__fixed.html#g99e7bb71548be1bc8b50704ac66bbe9a">unfix</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1CFix.html" title="Complex fixed-point data type.">CFix</a> &x) {<span class="keywordflow">return</span> x.<a class="code" href="classitpp_1_1CFix.html#a50af6275a8ffb446be444b061f05525" title="Conversion to std::complex&lt;double&gt;.">unfix</a>();} |
---|
| 376 | <a name="l00466"></a><a class="code" href="group__fixed.html#gc1eb94870e7f34fd7b66e8e9a9b4f4af">00466</a> <span class="keyword">inline</span> vec <a class="code" href="group__fixed.html#g99e7bb71548be1bc8b50704ac66bbe9a">unfix</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Vec.html" title="Vector Class (Templated).">fixvec</a> &x) {<span class="keywordflow">return</span> <a class="code" href="group__fixed.html#g9e5d027084a2a9e65500a0f5d4cf81a8" title="Converts a fixvec to vec.">to_vec</a>(x);} |
---|
| 377 | <a name="l00468"></a>00468 <span class="keyword">inline</span> cvec <a class="code" href="group__fixed.html#g99e7bb71548be1bc8b50704ac66bbe9a">unfix</a>(<span class="keyword">const</span> <a class="code" href="group__fixed.html#g057e78df9719352a7a2ae36c0e190982" title="Typedef for complex fixed-point vector type.">cfixvec</a> &x) {<span class="keywordflow">return</span> <a class="code" href="group__fixed.html#g3f0aa27746b5d5880f77e96c089498f2" title="Converts a cfixvec to cvec.">to_cvec</a>(x);} |
---|
| 378 | <a name="l00470"></a><a class="code" href="group__fixed.html#gbb4fa35d8620a82c7341dd57e48bf908">00470</a> <span class="keyword">inline</span> mat <a class="code" href="group__fixed.html#g99e7bb71548be1bc8b50704ac66bbe9a">unfix</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Mat.html" title="Matrix Class (Templated).">fixmat</a> &x) {<span class="keywordflow">return</span> <a class="code" href="group__fixed.html#g36d7bf8746a81d073e4db8b0ad3bec86" title="Converts a fixmat to mat.">to_mat</a>(x);} |
---|
| 379 | <a name="l00472"></a>00472 <span class="keyword">inline</span> cmat <a class="code" href="group__fixed.html#g99e7bb71548be1bc8b50704ac66bbe9a">unfix</a>(<span class="keyword">const</span> <a class="code" href="group__fixed.html#g6dd4e3e315ed992df7841744c656afce" title="Typedef for complex fixed-point matrix type.">cfixmat</a> &x) {<span class="keywordflow">return</span> <a class="code" href="group__fixed.html#g6c4d97173a184f3f3b1049214d662582" title="Converts a cfixmat to cmat.">to_cmat</a>(x);} |
---|
| 380 | <a name="l00473"></a>00473 |
---|
| 381 | <a name="l00475"></a><a class="code" href="group__fixed.html#g651eab5bc3c2a4c05224e71db7d7d4ef">00475</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="group__fixed.html#g99e7bb71548be1bc8b50704ac66bbe9a">unfix</a>(<span class="keywordtype">double</span> x) {<span class="keywordflow">return</span> x;} |
---|
| 382 | <a name="l00477"></a><a class="code" href="group__fixed.html#g6bf5704ee0811f077c5ff32b6408a7af">00477</a> <span class="keyword">inline</span> std::complex<double> <a class="code" href="group__fixed.html#g99e7bb71548be1bc8b50704ac66bbe9a">unfix</a>(<span class="keyword">const</span> std::complex<double> &x) {<span class="keywordflow">return</span> x;} |
---|
| 383 | <a name="l00479"></a><a class="code" href="group__fixed.html#gf6e410a226af09a010123aa49e44b78a">00479</a> <span class="keyword">inline</span> vec <a class="code" href="group__fixed.html#g99e7bb71548be1bc8b50704ac66bbe9a">unfix</a>(<span class="keyword">const</span> vec &x) {<span class="keywordflow">return</span> x;} |
---|
| 384 | <a name="l00481"></a><a class="code" href="group__fixed.html#g8c0bb7c08d3e0ea1c9f39a2091da449a">00481</a> <span class="keyword">inline</span> cvec <a class="code" href="group__fixed.html#g99e7bb71548be1bc8b50704ac66bbe9a">unfix</a>(<span class="keyword">const</span> cvec &x) {<span class="keywordflow">return</span> x;} |
---|
| 385 | <a name="l00483"></a><a class="code" href="group__fixed.html#g21193715262824a1ae5eb0bf6f80280a">00483</a> <span class="keyword">inline</span> mat <a class="code" href="group__fixed.html#g99e7bb71548be1bc8b50704ac66bbe9a">unfix</a>(<span class="keyword">const</span> mat &x) {<span class="keywordflow">return</span> x;} |
---|
| 386 | <a name="l00485"></a><a class="code" href="group__fixed.html#ge059915aa6731fe09b0a7a15de9fd657">00485</a> <span class="keyword">inline</span> cmat <a class="code" href="group__fixed.html#g99e7bb71548be1bc8b50704ac66bbe9a">unfix</a>(<span class="keyword">const</span> cmat &x) {<span class="keywordflow">return</span> x;} |
---|
| 387 | <a name="l00486"></a>00486 |
---|
| 388 | <a name="l00488"></a>00488 |
---|
| 389 | <a name="l00490"></a>00490 <span class="keyword">template</span><<span class="keyword">class</span> T> |
---|
| 390 | <a name="l00491"></a>00491 <span class="keyword">class </span>Convert |
---|
| 391 | <a name="l00492"></a>00492 { |
---|
| 392 | <a name="l00493"></a>00493 <span class="keyword">public</span>: |
---|
| 393 | <a name="l00494"></a>00494 <span class="keyword">typedef</span> <span class="keywordtype">double</span> to_double; |
---|
| 394 | <a name="l00495"></a>00495 }; |
---|
| 395 | <a name="l00497"></a>00497 <span class="keyword">template</span><> |
---|
| 396 | <a name="l00498"></a>00498 <span class="keyword">class </span>Convert<CFix> |
---|
| 397 | <a name="l00499"></a>00499 { |
---|
| 398 | <a name="l00500"></a>00500 <span class="keyword">public</span>: |
---|
| 399 | <a name="l00501"></a>00501 <span class="keyword">typedef</span> std::complex<double> to_double; |
---|
| 400 | <a name="l00502"></a>00502 }; |
---|
| 401 | <a name="l00504"></a>00504 <span class="keyword">template</span><<span class="keyword">class</span> T> |
---|
| 402 | <a name="l00505"></a>00505 <span class="keyword">class </span>Convert<std::complex<T> > |
---|
| 403 | <a name="l00506"></a>00506 { |
---|
| 404 | <a name="l00507"></a>00507 <span class="keyword">public</span>: |
---|
| 405 | <a name="l00508"></a>00508 <span class="keyword">typedef</span> std::complex<double> to_double; |
---|
| 406 | <a name="l00509"></a>00509 }; |
---|
| 407 | <a name="l00511"></a>00511 <span class="keyword">template</span><<span class="keyword">class</span> T> |
---|
| 408 | <a name="l00512"></a>00512 <span class="keyword">class </span>Convert<Array<T> > |
---|
| 409 | <a name="l00513"></a>00513 { |
---|
| 410 | <a name="l00514"></a>00514 <span class="keyword">public</span>: |
---|
| 411 | <a name="l00515"></a>00515 <span class="keyword">typedef</span> Array<typename Convert<T>::to_double> to_double; <span class="comment">// Recursive</span> |
---|
| 412 | <a name="l00516"></a>00516 }; |
---|
| 413 | <a name="l00518"></a>00518 <span class="keyword">template</span><<span class="keyword">class</span> T> |
---|
| 414 | <a name="l00519"></a>00519 <span class="keyword">class </span>Convert<Vec<T> > |
---|
| 415 | <a name="l00520"></a>00520 { |
---|
| 416 | <a name="l00521"></a>00521 <span class="keyword">public</span>: |
---|
| 417 | <a name="l00522"></a>00522 <span class="keyword">typedef</span> Vec<typename Convert<T>::to_double> to_double; <span class="comment">// Recursive</span> |
---|
| 418 | <a name="l00523"></a>00523 }; |
---|
| 419 | <a name="l00525"></a>00525 <span class="keyword">template</span><<span class="keyword">class</span> T> |
---|
| 420 | <a name="l00526"></a>00526 <span class="keyword">class </span>Convert<Mat<T> > |
---|
| 421 | <a name="l00527"></a>00527 { |
---|
| 422 | <a name="l00528"></a>00528 <span class="keyword">public</span>: |
---|
| 423 | <a name="l00529"></a>00529 <span class="keyword">typedef</span> Mat<typename Convert<T>::to_double> to_double; <span class="comment">// Recursive</span> |
---|
| 424 | <a name="l00530"></a>00530 }; |
---|
| 425 | <a name="l00531"></a>00531 |
---|
| 426 | <a name="l00533"></a>00533 |
---|
| 427 | <a name="l00535"></a>00535 <span class="keyword">template</span><<span class="keyword">class</span> T> |
---|
| 428 | <a name="l00536"></a><a class="code" href="group__fixed.html#g99e7bb71548be1bc8b50704ac66bbe9a">00536</a> <a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<typename Convert<T>::to_double</a>> <a class="code" href="group__fixed.html#g99e7bb71548be1bc8b50704ac66bbe9a">unfix</a>(<span class="keyword">const</span> <a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<T></a> &x) |
---|
| 429 | <a name="l00537"></a>00537 { |
---|
| 430 | <a name="l00538"></a>00538 <a class="code" href="classitpp_1_1Array.html" title="General array class.">Array<typename Convert<T>::to_double</a>> y(x.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>()); |
---|
| 431 | <a name="l00539"></a>00539 <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < x.<a class="code" href="classitpp_1_1Array.html#ce6bb3089de6f3ff86806d78f35505a4" title="Returns the number of data elements in the array object.">size</a>(); i++) { |
---|
| 432 | <a name="l00540"></a>00540 y(i) = <a class="code" href="group__fixed.html#g99e7bb71548be1bc8b50704ac66bbe9a">unfix</a>(x(i)); |
---|
| 433 | <a name="l00541"></a>00541 } |
---|
| 434 | <a name="l00542"></a>00542 <span class="keywordflow">return</span> y; |
---|
| 435 | <a name="l00543"></a>00543 } |
---|
| 436 | <a name="l00544"></a>00544 |
---|
| 437 | <a name="l00546"></a>00546 Fix <a class="code" href="group__fixed.html#ge0a38d51b2bf99a0ba07f2f8885e6adc" title="Absolute value.">abs</a>(<span class="keyword">const</span> Fix &x); |
---|
| 438 | <a name="l00548"></a>00548 Fix <a class="code" href="group__fixed.html#g58e25b8186a28f9dfd4062c7ed22e358" title="Real part of complex value.">real</a>(<span class="keyword">const</span> CFix &x); |
---|
| 439 | <a name="l00550"></a>00550 Fix <a class="code" href="group__fixed.html#gfaa4104621089388e7bfb218b02aaa77" title="Imaginary part of complex value.">imag</a>(<span class="keyword">const</span> CFix &x); |
---|
| 440 | <a name="l00552"></a>00552 CFix <a class="code" href="group__fixed.html#g42c0e5345d109af3e0f6feee6ededfd4" title="Conjugate of complex value.">conj</a>(<span class="keyword">const</span> CFix &x); |
---|
| 441 | <a name="l00553"></a>00553 |
---|
| 442 | <a name="l00555"></a>00555 |
---|
| 443 | <a name="l00556"></a>00556 } <span class="comment">// namespace itpp</span> |
---|
| 444 | <a name="l00557"></a>00557 |
---|
| 445 | <a name="l00558"></a>00558 <span class="preprocessor">#endif // #ifndef FIX_FUNCTIONS_H</span> |
---|
| 446 | </pre></div></div> |
---|
| 447 | <hr size="1"><address style="text-align: right;"><small>Generated on Tue Jun 2 10:02:11 2009 for mixpp by |
---|
| 448 | <a href="http://www.doxygen.org/index.html"> |
---|
| 449 | <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address> |
---|
| 450 | </body> |
---|
| 451 | </html> |
---|