1 <!-- HTML header for doxygen 1.8.9.1-->
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
5 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
7 <meta name="generator" content="Doxygen 1.8.11"/>
8 <meta name="robots" content="NOINDEX, NOFOLLOW" /> <!-- Prevent indexing by search engines -->
9 <title>Compute Library: constant_expr< T > Struct Template Reference</title>
10 <link href="tabs.css" rel="stylesheet" type="text/css"/>
11 <script type="text/javascript" src="jquery.js"></script>
12 <script type="text/javascript" src="dynsections.js"></script>
13 <link href="navtree.css" rel="stylesheet" type="text/css"/>
14 <script type="text/javascript" src="resize.js"></script>
15 <script type="text/javascript" src="navtreedata.js"></script>
16 <script type="text/javascript" src="navtree.js"></script>
17 <script type="text/javascript">
18 $(document).ready(initResizable);
19 $(window).load(resizeHeight);
21 <link href="search/search.css" rel="stylesheet" type="text/css"/>
22 <script type="text/javascript" src="search/searchdata.js"></script>
23 <script type="text/javascript" src="search/search.js"></script>
24 <script type="text/javascript">
25 $(document).ready(function() { init_search(); });
27 <script type="text/x-mathjax-config">
29 extensions: ["tex2jax.js"],
30 jax: ["input/TeX","output/HTML-CSS"],
32 </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
33 <link href="doxygen.css" rel="stylesheet" type="text/css" />
36 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
38 <table cellspacing="0" cellpadding="0">
40 <tr style="height: 56px;">
41 <td style="padding-left: 0.5em;">
42 <div id="projectname">Compute Library
43  <span id="projectnumber">18.02</span>
50 <!-- end header part -->
51 <!-- Generated by Doxygen 1.8.11 -->
52 <script type="text/javascript">
53 var searchBox = new SearchBox("searchBox", "search",false,'Search');
55 <div id="navrow1" class="tabs">
57 <li><a href="index.xhtml"><span>Main Page</span></a></li>
58 <li><a href="pages.xhtml"><span>Related Pages</span></a></li>
59 <li><a href="namespaces.xhtml"><span>Namespaces</span></a></li>
60 <li class="current"><a href="annotated.xhtml"><span>Data Structures</span></a></li>
61 <li><a href="files.xhtml"><span>Files</span></a></li>
63 <div id="MSearchBox" class="MSearchBoxInactive">
65 <img id="MSearchSelect" src="search/mag_sel.png"
66 onmouseover="return searchBox.OnSearchSelectShow()"
67 onmouseout="return searchBox.OnSearchSelectHide()"
69 <input type="text" id="MSearchField" value="Search" accesskey="S"
70 onfocus="searchBox.OnSearchFieldFocus(true)"
71 onblur="searchBox.OnSearchFieldFocus(false)"
72 onkeyup="searchBox.OnSearchFieldChange(event)"/>
73 </span><span class="right">
74 <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
80 <div id="navrow2" class="tabs2">
82 <li><a href="annotated.xhtml"><span>Data Structures</span></a></li>
83 <li><a href="classes.xhtml"><span>Data Structure Index</span></a></li>
84 <li><a href="inherits.xhtml"><span>Class Hierarchy</span></a></li>
85 <li><a href="functions.xhtml"><span>Data Fields</span></a></li>
89 <div id="side-nav" class="ui-resizable side-nav-resizable">
91 <div id="nav-tree-contents">
92 <div id="nav-sync" class="sync"></div>
95 <div id="splitbar" style="-moz-user-select:none;"
96 class="ui-resizable-handle">
99 <script type="text/javascript">
100 $(document).ready(function(){initNavTree('structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml','');});
102 <div id="doc-content">
103 <!-- window showing the filter options -->
104 <div id="MSearchSelectWindow"
105 onmouseover="return searchBox.OnSearchSelectShow()"
106 onmouseout="return searchBox.OnSearchSelectHide()"
107 onkeydown="return searchBox.OnSearchSelectKey(event)">
110 <!-- iframe showing the search results (closed by default) -->
111 <div id="MSearchResultsWindow">
112 <iframe src="javascript:void(0)" frameborder="0"
113 name="MSearchResults" id="MSearchResults">
118 <div class="summary">
119 <a href="#pub-static-methods">Static Public Member Functions</a> </div>
120 <div class="headertitle">
121 <div class="title">constant_expr< T > Struct Template Reference</div> </div>
123 <div class="contents">
125 <p><code>#include <<a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>></code></p>
126 <table class="memberdecls">
127 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
128 Static Public Member Functions</h2></td></tr>
129 <tr class="memitem:a9c4b593f19fb9053fd52697eaa30c5d7"><td class="memItemLeft" align="right" valign="top">static constexpr T </td><td class="memItemRight" valign="bottom"><a class="el" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a9c4b593f19fb9053fd52697eaa30c5d7">fixed_one</a> (uint8_t p)</td></tr>
130 <tr class="memdesc:a9c4b593f19fb9053fd52697eaa30c5d7"><td class="mdescLeft"> </td><td class="mdescRight">Calculate representation of 1 in fixed point given a fixed point precision. <a href="#a9c4b593f19fb9053fd52697eaa30c5d7">More...</a><br /></td></tr>
131 <tr class="separator:a9c4b593f19fb9053fd52697eaa30c5d7"><td class="memSeparator" colspan="2"> </td></tr>
132 <tr class="memitem:a125e978e1d6df0f6d9f738b0c580f980"><td class="memItemLeft" align="right" valign="top">static constexpr float </td><td class="memItemRight" valign="bottom"><a class="el" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a125e978e1d6df0f6d9f738b0c580f980">fixed_step</a> (uint8_t p)</td></tr>
133 <tr class="memdesc:a125e978e1d6df0f6d9f738b0c580f980"><td class="mdescLeft"> </td><td class="mdescRight">Calculate fixed point precision step given a fixed point precision. <a href="#a125e978e1d6df0f6d9f738b0c580f980">More...</a><br /></td></tr>
134 <tr class="separator:a125e978e1d6df0f6d9f738b0c580f980"><td class="memSeparator" colspan="2"> </td></tr>
135 <tr class="memitem:a995c73a5ff995cc1b4c0c730892c792a"><td class="memItemLeft" align="right" valign="top">static constexpr float </td><td class="memItemRight" valign="bottom"><a class="el" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a995c73a5ff995cc1b4c0c730892c792a">to_float</a> (T val, uint8_t p)</td></tr>
136 <tr class="memdesc:a995c73a5ff995cc1b4c0c730892c792a"><td class="mdescLeft"> </td><td class="mdescRight">Convert a fixed point value to float given its precision. <a href="#a995c73a5ff995cc1b4c0c730892c792a">More...</a><br /></td></tr>
137 <tr class="separator:a995c73a5ff995cc1b4c0c730892c792a"><td class="memSeparator" colspan="2"> </td></tr>
138 <tr class="memitem:a918ab57096fdfe5e2cbf70de5145b9fa"><td class="memItemLeft" align="right" valign="top">static constexpr T </td><td class="memItemRight" valign="bottom"><a class="el" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a918ab57096fdfe5e2cbf70de5145b9fa">to_int</a> (T val, uint8_t p)</td></tr>
139 <tr class="memdesc:a918ab57096fdfe5e2cbf70de5145b9fa"><td class="mdescLeft"> </td><td class="mdescRight">Convert a fixed point value to integer given its precision. <a href="#a918ab57096fdfe5e2cbf70de5145b9fa">More...</a><br /></td></tr>
140 <tr class="separator:a918ab57096fdfe5e2cbf70de5145b9fa"><td class="memSeparator" colspan="2"> </td></tr>
141 <tr class="memitem:a682a2eb8869b48647719e194cbbcb4e1"><td class="memItemLeft" align="right" valign="top">static constexpr T </td><td class="memItemRight" valign="bottom"><a class="el" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a682a2eb8869b48647719e194cbbcb4e1">to_fixed</a> (float val, uint8_t p)</td></tr>
142 <tr class="memdesc:a682a2eb8869b48647719e194cbbcb4e1"><td class="mdescLeft"> </td><td class="mdescRight">Convert a single precision floating point value to a fixed point representation given its precision. <a href="#a682a2eb8869b48647719e194cbbcb4e1">More...</a><br /></td></tr>
143 <tr class="separator:a682a2eb8869b48647719e194cbbcb4e1"><td class="memSeparator" colspan="2"> </td></tr>
144 <tr class="memitem:a996cf0a2779076326d094ef9d75ddd1f"><td class="memItemLeft" align="right" valign="top">static constexpr T </td><td class="memItemRight" valign="bottom"><a class="el" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a996cf0a2779076326d094ef9d75ddd1f">clamp</a> (T val, T <a class="el" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">min</a>, T <a class="el" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ad91bb73431b4de1f4946ed949d444849">max</a>)</td></tr>
145 <tr class="memdesc:a996cf0a2779076326d094ef9d75ddd1f"><td class="mdescLeft"> </td><td class="mdescRight">Clamp value between two ranges. <a href="#a996cf0a2779076326d094ef9d75ddd1f">More...</a><br /></td></tr>
146 <tr class="separator:a996cf0a2779076326d094ef9d75ddd1f"><td class="memSeparator" colspan="2"> </td></tr>
147 <tr class="memitem:a59cfd98dfc03fbc5540092aa196d7187"><td class="memTemplParams" colspan="2">template<typename U > </td></tr>
148 <tr class="memitem:a59cfd98dfc03fbc5540092aa196d7187"><td class="memTemplItemLeft" align="right" valign="top">static constexpr T </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a59cfd98dfc03fbc5540092aa196d7187">saturate_cast</a> (U val)</td></tr>
149 <tr class="memdesc:a59cfd98dfc03fbc5540092aa196d7187"><td class="mdescLeft"> </td><td class="mdescRight">Saturate given number. <a href="#a59cfd98dfc03fbc5540092aa196d7187">More...</a><br /></td></tr>
150 <tr class="separator:a59cfd98dfc03fbc5540092aa196d7187"><td class="memSeparator" colspan="2"> </td></tr>
152 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
153 <div class="textblock"><h3>template<typename T><br />
154 struct arm_compute::test::fixed_point_arithmetic::detail::constant_expr< T ></h3>
157 <p>Definition at line <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00048">48</a> of file <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>.</p>
158 </div><h2 class="groupheader">Member Function Documentation</h2>
159 <a class="anchor" id="a996cf0a2779076326d094ef9d75ddd1f"></a>
160 <div class="memitem">
161 <div class="memproto">
162 <table class="mlabels">
164 <td class="mlabels-left">
165 <table class="memname">
167 <td class="memname">static constexpr T clamp </td>
169 <td class="paramtype">T </td>
170 <td class="paramname"><em>val</em>, </td>
173 <td class="paramkey"></td>
175 <td class="paramtype">T </td>
176 <td class="paramname"><em>min</em>, </td>
179 <td class="paramkey"></td>
181 <td class="paramtype">T </td>
182 <td class="paramname"><em>max</em> </td>
191 <td class="mlabels-right">
192 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
195 </div><div class="memdoc">
197 <p>Clamp value between two ranges. </p>
198 <dl class="params"><dt>Parameters</dt><dd>
199 <table class="params">
200 <tr><td class="paramdir">[in]</td><td class="paramname">val</td><td>Value to clamp </td></tr>
201 <tr><td class="paramdir">[in]</td><td class="paramname">min</td><td>Minimum value to clamp to </td></tr>
202 <tr><td class="paramdir">[in]</td><td class="paramname">max</td><td>Maximum value to clamp to</td></tr>
206 <dl class="section return"><dt>Returns</dt><dd>clamped value </dd></dl>
208 <p>Definition at line <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00349">349</a> of file <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>.</p>
210 <p>References <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00889">arm_compute::test::fixed_point_arithmetic::detail::max()</a>, and <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00884">arm_compute::test::fixed_point_arithmetic::detail::min()</a>.</p>
212 <p>Referenced by <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00498">functions::clamp()</a>.</p>
213 <div class="fragment"><div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  {</div><div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  <span class="keywordflow">return</span> <a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">std::min</a>(<a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ad91bb73431b4de1f4946ed949d444849">std::max</a>(val, <a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">min</a>), <a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ad91bb73431b4de1f4946ed949d444849">max</a>);</div><div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  }</div><div class="ttc" id="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_xhtml_aabcf39e3917f842dbc5fbb0d802f24d5"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">arm_compute::test::fixed_point_arithmetic::detail::min</a></div><div class="ttdeci">fixed_point< T > min(fixed_point< T > x, fixed_point< T > y)</div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00884">FixedPoint.h:884</a></div></div>
214 <div class="ttc" id="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_xhtml_ad91bb73431b4de1f4946ed949d444849"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ad91bb73431b4de1f4946ed949d444849">arm_compute::test::fixed_point_arithmetic::detail::max</a></div><div class="ttdeci">fixed_point< T > max(fixed_point< T > x, fixed_point< T > y)</div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00889">FixedPoint.h:889</a></div></div>
215 </div><!-- fragment -->
218 <a class="anchor" id="a9c4b593f19fb9053fd52697eaa30c5d7"></a>
219 <div class="memitem">
220 <div class="memproto">
221 <table class="mlabels">
223 <td class="mlabels-left">
224 <table class="memname">
226 <td class="memname">static constexpr T fixed_one </td>
228 <td class="paramtype">uint8_t </td>
229 <td class="paramname"><em>p</em></td><td>)</td>
234 <td class="mlabels-right">
235 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
238 </div><div class="memdoc">
240 <p>Calculate representation of 1 in fixed point given a fixed point precision. </p>
241 <dl class="params"><dt>Parameters</dt><dd>
242 <table class="params">
243 <tr><td class="paramdir">[in]</td><td class="paramname">p</td><td>Fixed point precision</td></tr>
247 <dl class="section return"><dt>Returns</dt><dd>Representation of value 1 in fixed point. </dd></dl>
249 <p>Definition at line <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00293">293</a> of file <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>.</p>
250 <div class="fragment"><div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  {</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  <span class="keywordflow">return</span> (1 << p);</div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  }</div></div><!-- fragment -->
253 <a class="anchor" id="a125e978e1d6df0f6d9f738b0c580f980"></a>
254 <div class="memitem">
255 <div class="memproto">
256 <table class="mlabels">
258 <td class="mlabels-left">
259 <table class="memname">
261 <td class="memname">static constexpr float fixed_step </td>
263 <td class="paramtype">uint8_t </td>
264 <td class="paramname"><em>p</em></td><td>)</td>
269 <td class="mlabels-right">
270 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
273 </div><div class="memdoc">
275 <p>Calculate fixed point precision step given a fixed point precision. </p>
276 <dl class="params"><dt>Parameters</dt><dd>
277 <table class="params">
278 <tr><td class="paramdir">[in]</td><td class="paramname">p</td><td>Fixed point precision</td></tr>
282 <dl class="section return"><dt>Returns</dt><dd>Fixed point precision step </dd></dl>
284 <p>Definition at line <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00303">303</a> of file <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>.</p>
285 <div class="fragment"><div class="line"><a name="l00304"></a><span class="lineno"> 304</span>  {</div><div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  <span class="keywordflow">return</span> (1.0f / static_cast<float>(1 << p));</div><div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  }</div></div><!-- fragment -->
288 <a class="anchor" id="a59cfd98dfc03fbc5540092aa196d7187"></a>
289 <div class="memitem">
290 <div class="memproto">
291 <table class="mlabels">
293 <td class="mlabels-left">
294 <table class="memname">
296 <td class="memname">static constexpr T saturate_cast </td>
298 <td class="paramtype">U </td>
299 <td class="paramname"><em>val</em></td><td>)</td>
304 <td class="mlabels-right">
305 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
308 </div><div class="memdoc">
310 <p>Saturate given number. </p>
311 <dl class="params"><dt>Parameters</dt><dd>
312 <table class="params">
313 <tr><td class="paramdir">[in]</td><td class="paramname">val</td><td>Value to saturate</td></tr>
317 <dl class="section return"><dt>Returns</dt><dd>Saturated value </dd></dl>
319 <p>Definition at line <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00360">360</a> of file <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>.</p>
321 <p>References <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00889">arm_compute::test::fixed_point_arithmetic::detail::max()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00884">arm_compute::test::fixed_point_arithmetic::detail::min()</a>, and <a class="el" href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb">arm_compute::U</a>.</p>
323 <p>Referenced by <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00527">functions::add()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00598">functions::div()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00099">fixed_point< T >::fixed_point()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00577">functions::mul()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00509">functions::negate()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00184">fixed_point< T >::operator fixed_point< U >()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00241">fixed_point< T >::rescale()</a>, <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00626">functions::shift_left()</a>, and <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00552">functions::sub()</a>.</p>
324 <div class="fragment"><div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  {</div><div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  <span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T<span class="keyword">></span>(std::min<U>(std::max<U>(val, <span class="keyword">static_cast<</span><a class="code" href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb">U</a><span class="keyword">></span>(<a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">std::numeric_limits<T>::min</a>())), <span class="keyword">static_cast<</span><a class="code" href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb">U</a><span class="keyword">></span>(<a class="code" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ad91bb73431b4de1f4946ed949d444849">std::numeric_limits<T>::max</a>())));</div><div class="line"><a name="l00363"></a><span class="lineno"> 363</span>  }</div><div class="ttc" id="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_xhtml_aabcf39e3917f842dbc5fbb0d802f24d5"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#aabcf39e3917f842dbc5fbb0d802f24d5">arm_compute::test::fixed_point_arithmetic::detail::min</a></div><div class="ttdeci">fixed_point< T > min(fixed_point< T > x, fixed_point< T > y)</div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00884">FixedPoint.h:884</a></div></div>
325 <div class="ttc" id="namespacearm__compute_xhtml_a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb"><div class="ttname"><a href="namespacearm__compute.xhtml#a1ce9b523fd4f3b5bbcadcd796183455aa4c614360da93c0a041b22e537de151eb">arm_compute::Channel::U</a></div><div class="ttdoc">Cb/U channel. </div></div>
326 <div class="ttc" id="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_xhtml_ad91bb73431b4de1f4946ed949d444849"><div class="ttname"><a href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml#ad91bb73431b4de1f4946ed949d444849">arm_compute::test::fixed_point_arithmetic::detail::max</a></div><div class="ttdeci">fixed_point< T > max(fixed_point< T > x, fixed_point< T > y)</div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00889">FixedPoint.h:889</a></div></div>
327 </div><!-- fragment -->
330 <a class="anchor" id="a682a2eb8869b48647719e194cbbcb4e1"></a>
331 <div class="memitem">
332 <div class="memproto">
333 <table class="mlabels">
335 <td class="mlabels-left">
336 <table class="memname">
338 <td class="memname">static constexpr T to_fixed </td>
340 <td class="paramtype">float </td>
341 <td class="paramname"><em>val</em>, </td>
344 <td class="paramkey"></td>
346 <td class="paramtype">uint8_t </td>
347 <td class="paramname"><em>p</em> </td>
356 <td class="mlabels-right">
357 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
360 </div><div class="memdoc">
362 <p>Convert a single precision floating point value to a fixed point representation given its precision. </p>
363 <dl class="params"><dt>Parameters</dt><dd>
364 <table class="params">
365 <tr><td class="paramdir">[in]</td><td class="paramname">val</td><td>Floating point value </td></tr>
366 <tr><td class="paramdir">[in]</td><td class="paramname">p</td><td>Fixed point precision</td></tr>
370 <dl class="section return"><dt>Returns</dt><dd>The raw fixed point representation </dd></dl>
372 <p>Definition at line <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00337">337</a> of file <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>.</p>
374 <p>References <a class="el" href="tests_2_utils_8h_source.xhtml#l00363">arm_compute::test::saturate_cast()</a>.</p>
375 <div class="fragment"><div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  {</div><div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  <span class="keywordflow">return</span> <span class="keyword">static_cast<</span>T<span class="keyword">></span>(<a class="code" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a59cfd98dfc03fbc5540092aa196d7187">saturate_cast</a><<span class="keywordtype">float</span>>(val * <a class="code" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a9c4b593f19fb9053fd52697eaa30c5d7">fixed_one</a>(p) + ((val >= 0) ? 0.5 : -0.5)));</div><div class="line"><a name="l00340"></a><span class="lineno"> 340</span>  }</div><div class="ttc" id="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr_xhtml_a9c4b593f19fb9053fd52697eaa30c5d7"><div class="ttname"><a href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a9c4b593f19fb9053fd52697eaa30c5d7">arm_compute::test::fixed_point_arithmetic::detail::constant_expr::fixed_one</a></div><div class="ttdeci">static constexpr T fixed_one(uint8_t p)</div><div class="ttdoc">Calculate representation of 1 in fixed point given a fixed point precision. </div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00293">FixedPoint.h:293</a></div></div>
376 <div class="ttc" id="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr_xhtml_a59cfd98dfc03fbc5540092aa196d7187"><div class="ttname"><a href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a59cfd98dfc03fbc5540092aa196d7187">arm_compute::test::fixed_point_arithmetic::detail::constant_expr::saturate_cast</a></div><div class="ttdeci">static constexpr T saturate_cast(U val)</div><div class="ttdoc">Saturate given number. </div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00360">FixedPoint.h:360</a></div></div>
377 </div><!-- fragment -->
380 <a class="anchor" id="a995c73a5ff995cc1b4c0c730892c792a"></a>
381 <div class="memitem">
382 <div class="memproto">
383 <table class="mlabels">
385 <td class="mlabels-left">
386 <table class="memname">
388 <td class="memname">static constexpr float to_float </td>
390 <td class="paramtype">T </td>
391 <td class="paramname"><em>val</em>, </td>
394 <td class="paramkey"></td>
396 <td class="paramtype">uint8_t </td>
397 <td class="paramname"><em>p</em> </td>
406 <td class="mlabels-right">
407 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
410 </div><div class="memdoc">
412 <p>Convert a fixed point value to float given its precision. </p>
413 <dl class="params"><dt>Parameters</dt><dd>
414 <table class="params">
415 <tr><td class="paramdir">[in]</td><td class="paramname">val</td><td>Fixed point value </td></tr>
416 <tr><td class="paramdir">[in]</td><td class="paramname">p</td><td>Fixed point precision</td></tr>
420 <dl class="section return"><dt>Returns</dt><dd>Float representation of the fixed point number </dd></dl>
422 <p>Definition at line <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00315">315</a> of file <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>.</p>
424 <p>Referenced by <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00166">fixed_point< T >::operator float()</a>.</p>
425 <div class="fragment"><div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  {</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><span class="keywordtype">float</span><span class="keyword">></span>(val * <a class="code" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a125e978e1d6df0f6d9f738b0c580f980">fixed_step</a>(p));</div><div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  }</div><div class="ttc" id="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr_xhtml_a125e978e1d6df0f6d9f738b0c580f980"><div class="ttname"><a href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml#a125e978e1d6df0f6d9f738b0c580f980">arm_compute::test::fixed_point_arithmetic::detail::constant_expr::fixed_step</a></div><div class="ttdeci">static constexpr float fixed_step(uint8_t p)</div><div class="ttdoc">Calculate fixed point precision step given a fixed point precision. </div><div class="ttdef"><b>Definition:</b> <a href="tests_2validation_2_fixed_point_8h_source.xhtml#l00303">FixedPoint.h:303</a></div></div>
426 </div><!-- fragment -->
429 <a class="anchor" id="a918ab57096fdfe5e2cbf70de5145b9fa"></a>
430 <div class="memitem">
431 <div class="memproto">
432 <table class="mlabels">
434 <td class="mlabels-left">
435 <table class="memname">
437 <td class="memname">static constexpr T to_int </td>
439 <td class="paramtype">T </td>
440 <td class="paramname"><em>val</em>, </td>
443 <td class="paramkey"></td>
445 <td class="paramtype">uint8_t </td>
446 <td class="paramname"><em>p</em> </td>
455 <td class="mlabels-right">
456 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td>
459 </div><div class="memdoc">
461 <p>Convert a fixed point value to integer given its precision. </p>
462 <dl class="params"><dt>Parameters</dt><dd>
463 <table class="params">
464 <tr><td class="paramdir">[in]</td><td class="paramname">val</td><td>Fixed point value </td></tr>
465 <tr><td class="paramdir">[in]</td><td class="paramname">p</td><td>Fixed point precision</td></tr>
469 <dl class="section return"><dt>Returns</dt><dd>Integer of the fixed point number </dd></dl>
471 <p>Definition at line <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00326">326</a> of file <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a>.</p>
473 <p>Referenced by <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00715">functions::exp()</a>, and <a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml#l00175">fixed_point< T >::operator U()</a>.</p>
474 <div class="fragment"><div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  {</div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  <span class="keywordflow">return</span> val >> p;</div><div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  }</div></div><!-- fragment -->
477 <hr/>The documentation for this struct was generated from the following file:<ul>
478 <li>tests/validation/<a class="el" href="tests_2validation_2_fixed_point_8h_source.xhtml">FixedPoint.h</a></li>
480 </div><!-- contents -->
481 </div><!-- doc-content -->
482 <!-- start footer part -->
483 <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
485 <li class="navelem"><a class="el" href="namespacearm__compute.xhtml">arm_compute</a></li><li class="navelem"><a class="el" href="namespacearm__compute_1_1test.xhtml">test</a></li><li class="navelem"><a class="el" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic.xhtml">fixed_point_arithmetic</a></li><li class="navelem"><a class="el" href="namespacearm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail.xhtml">detail</a></li><li class="navelem"><a class="el" href="structarm__compute_1_1test_1_1fixed__point__arithmetic_1_1detail_1_1constant__expr.xhtml">constant_expr</a></li>
486 <li class="footer">Generated on Thu Feb 22 2018 15:45:26 for Compute Library by
487 <a href="http://www.doxygen.org/index.html">
488 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>