Files
ortools-clone/docs/cpp/fp__utils_8h_source.html

137 lines
60 KiB
HTML
Raw Normal View History

2020-09-01 16:00:33 +02:00
<!-- HTML header for doxygen 1.8.18-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
2021-09-20 15:57:27 +02:00
<meta name="generator" content="Doxygen 1.8.15"/>
2020-09-01 16:00:33 +02:00
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OR-Tools: fp_utils.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
2021-09-20 15:57:27 +02:00
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(initResizable);
/* @license-end */</script>
2020-09-01 16:00:33 +02:00
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="styleSheet.tmp.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="orLogo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">OR-Tools
2021-09-20 15:57:27 +02:00
&#160;<span id="projectnumber">9.1</span>
2020-09-01 16:00:33 +02:00
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
2021-09-20 15:57:27 +02:00
<!-- Generated by Doxygen 1.8.15 -->
2020-09-01 16:00:33 +02:00
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
2021-09-20 15:57:27 +02:00
var searchBox = new SearchBox("searchBox", "search",false,'Search');
2020-09-01 16:00:33 +02:00
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
2021-09-20 15:57:27 +02:00
$(document).ready(function(){initNavTree('fp__utils_8h_source.html','');});
2020-09-01 16:00:33 +02:00
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">fp_utils.h</div> </div>
</div><!--header-->
<div class="contents">
2021-09-20 15:57:27 +02:00
<a href="fp__utils_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">// Copyright 2010-2021 Google LLC</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">// you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">// You may obtain a copy of the License at</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment">// distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment">// See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment">// limitations under the License.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;</div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="comment">// Utility functions on IEEE floating-point numbers.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment">// Implemented on float, double, and long double.</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment">// Also a placeholder for tools controlling and checking FPU rounding modes.</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="comment">//</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="comment">// IMPORTANT NOTICE: you need to compile your binary with -frounding-math if</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="comment">// you want to use rounding modes.</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#ifndef OR_TOOLS_UTIL_FP_UTILS_H_</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#define OR_TOOLS_UTIL_FP_UTILS_H_</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#if defined(_MSC_VER)</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#pragma fenv_access(on) // NOLINT</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#else</span></div><
<div class="ttc" id="namespaceoperations__research_html_a2adddfecac47612f1da312dbb80d91b7"><div class="ttname"><a href="namespaceoperations__research.html#a2adddfecac47612f1da312dbb80d91b7">operations_research::Interpolate</a></div><div class="ttdeci">FloatType Interpolate(FloatType x, FloatType y, FloatType alpha)</div><div class="ttdef"><b>Definition:</b> <a href="fp__utils_8h_source.html#l00246">fp_utils.h:246</a></div></div>
<div class="ttc" id="alldiff__cst_8cc_html_ad10edae0a852d72fb76afb1c77735045"><div class="ttname"><a href="alldiff__cst_8cc.html#ad10edae0a852d72fb76afb1c77735045">min</a></div><div class="ttdeci">int64_t min</div><div class="ttdef"><b>Definition:</b> <a href="alldiff__cst_8cc_source.html#l00139">alldiff_cst.cc:139</a></div></div>
<div class="ttc" id="classoperations__research_1_1_scoped_floating_point_env_html"><div class="ttname"><a href="classoperations__research_1_1_scoped_floating_point_env.html">operations_research::ScopedFloatingPointEnv</a></div><div class="ttdef"><b>Definition:</b> <a href="fp__utils_8h_source.html#l00064">fp_utils.h:64</a></div></div>
<div class="ttc" id="namespaceoperations__research_html_a096ed4f933f943ccb8859e0dc08b06ca"><div class="ttname"><a href="namespaceoperations__research.html#a096ed4f933f943ccb8859e0dc08b06ca">operations_research::IsSmallerWithinTolerance</a></div><div class="ttdeci">bool IsSmallerWithinTolerance(FloatType x, FloatType y, FloatType tolerance)</div><div class="ttdef"><b>Definition:</b> <a href="fp__utils_8h_source.html#l00157">fp_utils.h:157</a></div></div>
<div class="ttc" id="namespaceoperations__research_html_a46f21c3da23685e58b31d880b2144458"><div class="ttname"><a href="namespaceoperations__research.html#a46f21c3da23685e58b31d880b2144458">operations_research::ComputeScalingErrors</a></div><div class="ttdeci">void ComputeScalingErrors(const std::vector&lt; double &gt; &amp;input, const std::vector&lt; double &gt; &amp;lb, const std::vector&lt; double &gt; &amp;ub, double scaling_factor, double *max_relative_coeff_error, double *max_scaled_sum_error)</div><div class="ttdef"><b>Definition:</b> <a href="fp__utils_8cc_source.html#l00170">fp_utils.cc:170</a></div></div>
<div class="ttc" id="base_2logging_8h_html_ab4f56aa24c4c9cddc47a6abd2d747f9a"><div class="ttname"><a href="base_2logging_8h.html#ab4f56aa24c4c9cddc47a6abd2d747f9a">DCHECK_GT</a></div><div class="ttdeci">#define DCHECK_GT(val1, val2)</div><div class="ttdef"><b>Definition:</b> <a href="base_2logging_8h_source.html#l00891">base/logging.h:891</a></div></div>
<div class="ttc" id="namespaceoperations__research_html_a1181732aa2f4c08e28ea32b1c7c6f256"><div class="ttname"><a href="namespaceoperations__research.html#a1181732aa2f4c08e28ea32b1c7c6f256">operations_research::IsIntegerWithinTolerance</a></div><div class="ttdeci">bool IsIntegerWithinTolerance(FloatType x, FloatType tolerance)</div><div class="ttdef"><b>Definition:</b> <a href="fp__utils_8h_source.html#l00165">fp_utils.h:165</a></div></div>
<div class="ttc" id="namespaceoperations__research_html_aae3359f1c2367d44e5cf9be5d5abc89f"><div class="ttname"><a href="namespaceoperations__research.html#aae3359f1c2367d44e5cf9be5d5abc89f">operations_research::GetBestScalingOfDoublesToInt64</a></div><div class="ttdeci">double GetBestScalingOfDoublesToInt64(const std::vector&lt; double &gt; &amp;input, const std::vector&lt; double &gt; &amp;lb, const std::vector&lt; double &gt; &amp;ub, int64_t max_absolute_sum)</div><div class="ttdef"><b>Definition:</b> <a href="fp__utils_8cc_source.html#l00179">fp_utils.cc:179</a></div></div>
<div class="ttc" id="sat_2lp__utils_8cc_html_a2a1a02478d02cd8e42a1afece079d4a2"><div class="ttname"><a href="sat_2lp__utils_8cc.html#a2a1a02478d02cd8e42a1afece079d4a2">max_relative_coeff_error</a></div><div class="ttdeci">double max_relative_coeff_error</div><div class="ttdef"><b>Definition:</b> <a href="sat_2lp__utils_8cc_source.html#l00489">sat/lp_utils.cc:489</a></div></div>
<div class="ttc" id="namespaceoperations__research_html_a5550c9e9dfe6d29df888acafa85c790e"><div class="ttname"><a href="namespaceoperations__research.html#a5550c9e9dfe6d29df888acafa85c790e">operations_research::fast_scalbn</a></div><div class="ttdeci">double fast_scalbn(double value, int exponent)</div><div class="ttdef"><b>Definition:</b> <a href="fp__utils_8cc_source.html#l00235">fp_utils.cc:235</a></div></div>
<div class="ttc" id="integral__types_8h_html"><div class="ttname"><a href="integral__types_8h.html">integral_types.h</a></div></div>
<div class="ttc" id="alldiff__cst_8cc_html_a26e6db9bcc64b584051ecc28171ed11f"><div class="ttname"><a href="alldiff__cst_8cc.html#a26e6db9bcc64b584051ecc28171ed11f">max</a></div><div class="ttdeci">int64_t max</div><div class="ttdef"><b>Definition:</b> <a href="alldiff__cst_8cc_source.html#l00140">alldiff_cst.cc:140</a></div></div>
<div class="ttc" id="namespaceoperations__research_html_aae2e6ed909e0cd5f240b885800f55c87"><div class="ttname"><a href="namespaceoperations__research.html#aae2e6ed909e0cd5f240b885800f55c87">operations_research::ComputeGcdOfRoundedDoubles</a></div><div class="ttdeci">int64_t ComputeGcdOfRoundedDoubles(const std::vector&lt; double &gt; &amp;x, double scaling_factor)</div><div class="ttdef"><b>Definition:</b> <a href="fp__utils_8cc_source.html#l00200">fp_utils.cc:200</a></div></div>
<div class="ttc" id="classoperations__research_1_1_scoped_floating_point_env_html_af6753cac2c8e1464f3e816f15a9c99e7"><div class="ttname"><a href="classoperations__research_1_1_scoped_floating_point_env.html#af6753cac2c8e1464f3e816f15a9c99e7">operations_research::ScopedFloatingPointEnv::~ScopedFloatingPointEnv</a></div><div class="ttdeci">~ScopedFloatingPointEnv()</div><div class="ttdef"><b>Definition:</b> <a href="fp__utils_8h_source.html#l00074">fp_utils.h:74</a></div></div>
<div class="ttc" id="namespaceoperations__research_html_a705ecff17f450f06856ceec064725b8d"><div class="ttname"><a href="namespaceoperations__research.html#a705ecff17f450f06856ceec064725b8d">operations_research::AreWithinAbsoluteTolerance</a></div><div class="ttdeci">bool AreWithinAbsoluteTolerance(FloatType x, FloatType y, FloatType absolute_tolerance)</div><div class="ttdef"><b>Definition:</b> <a href="fp__utils_8h_source.html#l00145">fp_utils.h:145</a></div></div>
<div class="ttc" id="parser_8yy_8cc_html_a5a634cf4429798b1c921a81de8250051"><div class="ttname"><a href="parser_8yy_8cc.html#a5a634cf4429798b1c921a81de8250051">input</a></div><div class="ttdeci">static int input(yyscan_t yyscanner)</div></div>
<div class="ttc" id="base_2logging_8h_html_a7c0ce053b28d53aa4eaf3eb7fb71663b"><div class="ttname"><a href="base_2logging_8h.html#a7c0ce053b28d53aa4eaf3eb7fb71663b">CHECK_EQ</a></div><div class="ttdeci">#define CHECK_EQ(val1, val2)</div><div class="ttdef"><b>Definition:</b> <a href="base_2logging_8h_source.html#l00698">base/logging.h:698</a></div></div>
<div class="ttc" id="base_2logging_8h_html"><div class="ttname"><a href="base_2logging_8h.html">logging.h</a></div></div>
<div class="ttc" id="namespaceoperations__research_html_addb09ab3f085b1424ee43c8565494b40"><div class="ttname"><a href="namespaceoperations__research.html#addb09ab3f085b1424ee43c8565494b40">operations_research::IsPositiveOrNegativeInfinity</a></div><div class="ttdeci">bool IsPositiveOrNegativeInfinity(FloatType x)</div><div class="ttdef"><b>Definition:</b> <a href="fp__utils_8h_source.html#l00111">fp_utils.h:111</a></div></div>
<div class="ttc" id="classoperations__research_1_1_scoped_floating_point_env_html_a842438c1192d9044a7b244958355241b"><div class="ttname"><a href="classoperations__research_1_1_scoped_floating_point_env.html#a842438c1192d9044a7b244958355241b">operations_research::ScopedFloatingPointEnv::EnableExceptions</a></div><div class="ttdeci">void EnableExceptions(int excepts)</div><div class="ttdef"><b>Definition:</b> <a href="fp__utils_8h_source.html#l00082">fp_utils.h:82</a></div></div>
<div class="ttc" id="namespaceoperations__research_html_a4175e34e3e7f573a9dd0187b199afc24"><div class="ttname"><a href="namespaceoperations__research.html#a4175e34e3e7f573a9dd0187b199afc24">operations_research::AreWithinAbsoluteOrRelativeTolerances</a></div><div class="ttdeci">bool AreWithinAbsoluteOrRelativeTolerances(FloatType x, FloatType y, FloatType relative_tolerance, FloatType absolute_tolerance)</div><div class="ttdef"><b>Definition:</b> <a href="fp__utils_8h_source.html#l00124">fp_utils.h:124</a></div></div>
<div class="ttc" id="base_2logging_8h_html_a4395e95bab44e222cb2e77251017a0e2"><div class="ttname"><a href="base_2logging_8h.html#a4395e95bab44e222cb2e77251017a0e2">DCHECK_LE</a></div><div class="ttdeci">#define DCHECK_LE(val1, val2)</div><div class="ttdef"><b>Definition:</b> <a href="base_2logging_8h_source.html#l00888">base/logging.h:888</a></div></div>
<div class="ttc" id="namespaceoperations__research_html"><div class="ttname"><a href="namespaceoperations__research.html">operations_research</a></div><div class="ttdoc">Collection of objects used to extend the Constraint Solver library.</div><div class="ttdef"><b>Definition:</b> <a href="dense__doubly__linked__list_8h_source.html#l00021">dense_doubly_linked_list.h:21</a></div></div>
<div class="ttc" id="classoperations__research_1_1_scoped_floating_point_env_html_a0c44a9a38a2a14a048fddc986e3e78c4"><div class="ttname"><a href="classoperations__research_1_1_scoped_floating_point_env.html#a0c44a9a38a2a14a048fddc986e3e78c4">operations_research::ScopedFloatingPointEnv::ScopedFloatingPointEnv</a></div><div class="ttdeci">ScopedFloatingPointEnv()</div><div class="ttdef"><b>Definition:</b> <a href="fp__utils_8h_source.html#l00066">fp_utils.h:66</a></div></div>
<div class="ttc" id="namespaceoperations__research_html_a01cc8a711d189115758c50170038904f"><div class="ttname"><a href="namespaceoperations__research.html#a01cc8a711d189115758c50170038904f">operations_research::fast_ilogb</a></div><div class="ttdeci">int fast_ilogb(double value)</div><div class="ttdef"><b>Definition:</b> <a href="fp__utils_8cc_source.html#l00222">fp_utils.cc:222</a></div></div>
<div class="ttc" id="demon__profiler_8cc_html_ac072af30c4ffbc834bb4c681f6ecb514"><div class="ttname"><a href="demon__profiler_8cc.html#ac072af30c4ffbc834bb4c681f6ecb514">value</a></div><div class="ttdeci">int64_t value</div><div class="ttdef"><b>Definition:</b> <a href="demon__profiler_8cc_source.html#l00044">demon_profiler.cc:44</a></div></div>
2021-01-26 11:28:50 +01:00
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
2020-09-01 16:00:33 +02:00
<!-- HTML footer for doxygen 1.8.18-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_a7cc1eeded8f693d0da6c729bc88c45a.html">ortools</a></li><li class="navelem"><a class="el" href="dir_a3328a0ea67a2aaa160c2783ffbaa5dc.html">util</a></li><li class="navelem"><a class="el" href="fp__utils_8h.html">fp_utils.h</a></li>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
2021-09-20 15:57:27 +02:00
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.15 </li>
2020-09-01 16:00:33 +02:00
</ul>
</div>
</body>
</html>