Files
ortools-clone/docs/cpp/cp__model__utils_8h_source.html
2021-02-26 14:48:18 +01:00

305 lines
55 KiB
HTML

<!-- 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"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OR-Tools: cp_model_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>
<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
&#160;<span id="projectnumber">8.2</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @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 */
$(document).ready(function(){initNavTree('cp__model__utils_8h_source.html',''); initResizable(); });
/* @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">cp_model_utils.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="cp__model__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-2018 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="preprocessor">#ifndef OR_TOOLS_SAT_CP_MODEL_UTILS_H_</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="preprocessor">#define OR_TOOLS_SAT_CP_MODEL_UTILS_H_</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160; </div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="preprocessor">#include &lt;algorithm&gt;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#include &lt;functional&gt;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#include &lt;string&gt;</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</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">#include &quot;absl/container/flat_hash_set.h&quot;</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="integral__types_8h.html">ortools/base/integral_types.h</a>&quot;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="base_2logging_8h.html">ortools/base/logging.h</a>&quot;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="cp__model_8pb_8h.html">ortools/sat/cp_model.pb.h</a>&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="sorted__interval__list_8h.html">ortools/util/sorted_interval_list.h</a>&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceoperations__research.html">operations_research</a> {</div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="keyword">namespace </span>sat {</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; </div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="comment">// Small utility functions to deal with negative variable/literal references.</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1sat.html#ae0803b8198728cd4f6e58498d9c60091"> 32</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="namespaceoperations__research_1_1sat.html#ae0803b8198728cd4f6e58498d9c60091">NegatedRef</a>(<span class="keywordtype">int</span> ref) { <span class="keywordflow">return</span> -ref - 1; }</div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1sat.html#acdbc8ad33149d45a6e6fcd8b72fd68ed"> 33</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="namespaceoperations__research_1_1sat.html#acdbc8ad33149d45a6e6fcd8b72fd68ed">PositiveRef</a>(<span class="keywordtype">int</span> ref) { <span class="keywordflow">return</span> <a class="code" href="alldiff__cst_8cc.html#a9d0c202d5fdd62f4fa2c613339ff168a">std::max</a>(ref, <a class="code" href="namespaceoperations__research_1_1sat.html#ae0803b8198728cd4f6e58498d9c60091">NegatedRef</a>(ref)); }</div>
<div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1sat.html#a217338425de4389014563f1f24331713"> 34</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceoperations__research_1_1sat.html#a217338425de4389014563f1f24331713">RefIsPositive</a>(<span class="keywordtype">int</span> ref) { <span class="keywordflow">return</span> ref &gt;= 0; }</div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="comment">// Small utility functions to deal with half-reified constraints.</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1sat.html#a42a3b266d8c6dfab1c14baa6c04e2333"> 37</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceoperations__research_1_1sat.html#a42a3b266d8c6dfab1c14baa6c04e2333">HasEnforcementLiteral</a>(<span class="keyword">const</span> ConstraintProto&amp; <a class="code" href="demon__profiler_8cc.html#a05da18ca9c7b657a4a6ea24e07c9b695">ct</a>) {</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; <span class="keywordflow">return</span> !<a class="code" href="demon__profiler_8cc.html#a05da18ca9c7b657a4a6ea24e07c9b695">ct</a>.enforcement_literal().empty();</div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;}</div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1sat.html#adff14ec933b464328de54c33e81429a9"> 40</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="namespaceoperations__research_1_1sat.html#adff14ec933b464328de54c33e81429a9">EnforcementLiteral</a>(<span class="keyword">const</span> ConstraintProto&amp; <a class="code" href="demon__profiler_8cc.html#a05da18ca9c7b657a4a6ea24e07c9b695">ct</a>) {</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; <span class="keywordflow">return</span> <a class="code" href="demon__profiler_8cc.html#a05da18ca9c7b657a4a6ea24e07c9b695">ct</a>.enforcement_literal(0);</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;}</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; </div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="comment">// Fills the target as negated ref.</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespaceoperations__research_1_1sat.html#a22efb1995471e34caa35927a9032f5f3">SetToNegatedLinearExpression</a>(<span class="keyword">const</span> LinearExpressionProto&amp; input_expr,</div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; LinearExpressionProto* output_negated_expr);</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; </div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="comment">// Collects all the references used by a constraint. This function is used in a</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="comment">// few places to have a &quot;generic&quot; code dealing with constraints. Note that the</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160;<span class="comment">// enforcement_literal is NOT counted here and that the vectors can have</span></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;<span class="comment">// duplicates.</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_index_references.html"> 52</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structoperations__research_1_1sat_1_1_index_references.html">IndexReferences</a> {</div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_index_references.html#a0821f58cb944376b1f8919327f202443"> 53</a></span>&#160; std::vector&lt;int&gt; <a class="code" href="structoperations__research_1_1sat_1_1_index_references.html#a0821f58cb944376b1f8919327f202443">variables</a>;</div>
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_index_references.html#a404c06a2a9a7b2290466f5d5423093d4"> 54</a></span>&#160; std::vector&lt;int&gt; <a class="code" href="structoperations__research_1_1sat_1_1_index_references.html#a404c06a2a9a7b2290466f5d5423093d4">literals</a>;</div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;};</div>
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160;<a class="code" href="structoperations__research_1_1sat_1_1_index_references.html">IndexReferences</a> <a class="code" href="namespaceoperations__research_1_1sat.html#aba8e3465fc58d3b287e05451d5230bae">GetReferencesUsedByConstraint</a>(<span class="keyword">const</span> ConstraintProto&amp; <a class="code" href="demon__profiler_8cc.html#a05da18ca9c7b657a4a6ea24e07c9b695">ct</a>);</div>
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; </div>
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160;<span class="comment">// Applies the given function to all variables/literals/intervals indices of the</span></div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160;<span class="comment">// constraint. This function is used in a few places to have a &quot;generic&quot; code</span></div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;<span class="comment">// dealing with constraints.</span></div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespaceoperations__research_1_1sat.html#ab5f94367fbf4ab2c03bd6bef412c41f7">ApplyToAllVariableIndices</a>(<span class="keyword">const</span> std::function&lt;<span class="keywordtype">void</span>(<span class="keywordtype">int</span>*)&gt;&amp; <span class="keyword">function</span>,</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; ConstraintProto* <a class="code" href="demon__profiler_8cc.html#a05da18ca9c7b657a4a6ea24e07c9b695">ct</a>);</div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespaceoperations__research_1_1sat.html#a6d4dc38d28f20c0c1bbbe71fff0803e7">ApplyToAllLiteralIndices</a>(<span class="keyword">const</span> std::function&lt;<span class="keywordtype">void</span>(<span class="keywordtype">int</span>*)&gt;&amp; <span class="keyword">function</span>,</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; ConstraintProto* <a class="code" href="demon__profiler_8cc.html#a05da18ca9c7b657a4a6ea24e07c9b695">ct</a>);</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespaceoperations__research_1_1sat.html#a81b6165b5a5412969f351d0d343166b9">ApplyToAllIntervalIndices</a>(<span class="keyword">const</span> std::function&lt;<span class="keywordtype">void</span>(<span class="keywordtype">int</span>*)&gt;&amp; <span class="keyword">function</span>,</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; ConstraintProto* <a class="code" href="demon__profiler_8cc.html#a05da18ca9c7b657a4a6ea24e07c9b695">ct</a>);</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160;<span class="comment">// Returns the name of the ConstraintProto::ConstraintCase oneof enum.</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;<span class="comment">// Note(user): There is no such function in the proto API as of 16/01/2017.</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;std::string <a class="code" href="namespaceoperations__research_1_1sat.html#acf5b1cbffc494f14e8b87c672d5dda5f">ConstraintCaseName</a>(ConstraintProto::ConstraintCase constraint_case);</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; </div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160;<span class="comment">// Returns the sorted list of variables used by a constraint.</span></div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;<span class="comment">// Note that this include variable used as a literal.</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160;std::vector&lt;int&gt; <a class="code" href="namespaceoperations__research_1_1sat.html#a1d467595ed8fe5b85dc95328ee1c2770">UsedVariables</a>(<span class="keyword">const</span> ConstraintProto&amp; <a class="code" href="demon__profiler_8cc.html#a05da18ca9c7b657a4a6ea24e07c9b695">ct</a>);</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; </div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160;<span class="comment">// Returns the sorted list of interval used by a constraint.</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;std::vector&lt;int&gt; <a class="code" href="namespaceoperations__research_1_1sat.html#a217ba4c51953c701a68d6572d79801f1">UsedIntervals</a>(<span class="keyword">const</span> ConstraintProto&amp; <a class="code" href="demon__profiler_8cc.html#a05da18ca9c7b657a4a6ea24e07c9b695">ct</a>);</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;<span class="comment">// Returns true if a proto.domain() contain the given value.</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;<span class="comment">// The domain is expected to be encoded as a sorted disjoint interval list.</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ProtoWithDomain&gt;</div>
<div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1sat.html#ac52c02e968c262e71312e8e8462013ac"> 82</a></span>&#160;<span class="keywordtype">bool</span> <a class="code" href="namespaceoperations__research_1_1sat.html#ac52c02e968c262e71312e8e8462013ac">DomainInProtoContains</a>(<span class="keyword">const</span> ProtoWithDomain&amp; <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>, <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> <a class="code" href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a>) {</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>.domain_size(); i += 2) {</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a> &gt;= <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>.domain(i) &amp;&amp; <a class="code" href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a> &lt;= <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>.domain(i + 1)) <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; }</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160;}</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; </div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;<span class="comment">// Serializes a Domain into the domain field of a proto.</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ProtoWithDomain&gt;</div>
<div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1sat.html#a901c19b12842f8af153e588a689a90b5"> 91</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="namespaceoperations__research_1_1sat.html#a901c19b12842f8af153e588a689a90b5">FillDomainInProto</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1_domain.html">Domain</a>&amp; domain, ProtoWithDomain* <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>) {</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>-&gt;clear_domain();</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>-&gt;mutable_domain()-&gt;Reserve(domain.<a class="code" href="classoperations__research_1_1_domain.html#a3dcbf23ccbed61ee64ec08a934f57a9c">NumIntervals</a>());</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keywordflow">for</span> (<span class="keyword">const</span> <a class="code" href="structoperations__research_1_1_closed_interval.html">ClosedInterval</a>&amp; <a class="code" href="resource_8cc.html#af92a8383a05fdf586a52263d358f5ada">interval</a> : domain) {</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>-&gt;add_domain(<a class="code" href="resource_8cc.html#af92a8383a05fdf586a52263d358f5ada">interval</a>.start);</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>-&gt;add_domain(<a class="code" href="resource_8cc.html#af92a8383a05fdf586a52263d358f5ada">interval</a>.end);</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; }</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;}</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; </div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160;<span class="comment">// Reads a Domain from the domain field of a proto.</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ProtoWithDomain&gt;</div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1sat.html#ab1240060466ba48a36a4b36379bce26a"> 102</a></span>&#160;<a class="code" href="classoperations__research_1_1_domain.html">Domain</a> <a class="code" href="namespaceoperations__research_1_1sat.html#ab1240060466ba48a36a4b36379bce26a">ReadDomainFromProto</a>(<span class="keyword">const</span> ProtoWithDomain&amp; <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>) {</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160;<span class="preprocessor">#if defined(__PORTABLE_PLATFORM__)</span></div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classoperations__research_1_1_domain.html#a0c9af6e6de7c550ed05a79bc6d8ea0c4">Domain::FromFlatIntervals</a>(</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; {<a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>.domain().begin(), <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>.domain().end()});</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160; <span class="keywordflow">return</span> <a class="code" href="classoperations__research_1_1_domain.html#ad5b21b2341279b91b5265e649f3f1402">Domain::FromFlatSpanOfIntervals</a>(<a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>.domain());</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;}</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;<span class="comment">// Returns the list of values in a given domain.</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;<span class="comment">// This will fail if the domain contains more than one millions values.</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;<span class="comment">// TODO(user): work directly on the Domain class instead.</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;<span class="keyword">template</span> &lt;<span class="keyword">typename</span> ProtoWithDomain&gt;</div>
<div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1sat.html#a53ea253d542bce5e351062a445dc929b"> 116</a></span>&#160;std::vector&lt;int64&gt; <a class="code" href="namespaceoperations__research_1_1sat.html#a53ea253d542bce5e351062a445dc929b">AllValuesInDomain</a>(<span class="keyword">const</span> ProtoWithDomain&amp; <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>) {</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; std::vector&lt;int64&gt; result;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>.domain_size(); i += 2) {</div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keywordflow">for</span> (<a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> v = <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>.domain(i); v &lt;= <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>.domain(i + 1); ++v) {</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <a class="code" href="base_2logging_8h.html#ae4db23f10f5d4aad6d735f5a74cd6f8c">CHECK_LE</a>(result.size(), 1e6);</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; result.push_back(v);</div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; }</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; }</div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160; <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;}</div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; </div>
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160;<span class="comment">// Scales back a objective value to a double value from the original model.</span></div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1sat.html#a764814ea1f9e5a90d17660156b13f818"> 128</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="namespaceoperations__research_1_1sat.html#a764814ea1f9e5a90d17660156b13f818">ScaleObjectiveValue</a>(<span class="keyword">const</span> CpObjectiveProto&amp; <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>, <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> <a class="code" href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a>) {</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="keywordtype">double</span> result = <span class="keyword">static_cast&lt;</span><span class="keywordtype">double</span><span class="keyword">&gt;</span>(<a class="code" href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a>);</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a> == <a class="code" href="integral__types_8h.html#af458164b470cbba416d5ed579e00ff60">kint64min</a>) result = -std::numeric_limits&lt;double&gt;::infinity();</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a> == <a class="code" href="integral__types_8h.html#a74ea76ea27f48fb1b6e148e1577b3719">kint64max</a>) result = std::numeric_limits&lt;double&gt;::infinity();</div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; result += <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>.offset();</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>.scaling_factor() == 0) <span class="keywordflow">return</span> result;</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; <span class="keywordflow">return</span> <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>.scaling_factor() * result;</div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160;}</div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; </div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160;<span class="comment">// Removes the objective scaling and offset from the given value.</span></div>
<div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1sat.html#a1ff712b32e44ffd2e7f40042330bf2ad"> 138</a></span>&#160;<span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="namespaceoperations__research_1_1sat.html#a1ff712b32e44ffd2e7f40042330bf2ad">UnscaleObjectiveValue</a>(<span class="keyword">const</span> CpObjectiveProto&amp; <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>,</div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <span class="keywordtype">double</span> <a class="code" href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a>) {</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="keywordtype">double</span> result = <a class="code" href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a>;</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; <span class="keywordflow">if</span> (<a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>.scaling_factor() != 0) {</div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; result /= <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>.scaling_factor();</div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; }</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <span class="keywordflow">return</span> result - <a class="code" href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a>.offset();</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160;}</div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; </div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;<span class="comment">// Computes the &quot;inner&quot; objective of a response that contains a solution.</span></div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;<span class="comment">// This is the objective without offset and scaling. Call ScaleObjectiveValue()</span></div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;<span class="comment">// to get the user facing objective.</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;<a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> <a class="code" href="namespaceoperations__research_1_1sat.html#a44f635d04529be503aa7f14917185a37">ComputeInnerObjective</a>(<span class="keyword">const</span> CpObjectiveProto&amp; objective,</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="keyword">const</span> CpSolverResponse&amp; <a class="code" href="cp__model__solver_8cc.html#abcd33b18ce6d5a90a4ba5c37cfa58829">response</a>);</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; </div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160;} <span class="comment">// namespace sat</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160;} <span class="comment">// namespace operations_research</span></div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; </div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160;<span class="preprocessor">#endif </span><span class="comment">// OR_TOOLS_SAT_CP_MODEL_UTILS_H_</span></div>
<div class="ttc" id="aalldiff__cst_8cc_html_a9d0c202d5fdd62f4fa2c613339ff168a"><div class="ttname"><a href="alldiff__cst_8cc.html#a9d0c202d5fdd62f4fa2c613339ff168a">max</a></div><div class="ttdeci">int64 max</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="abase_2logging_8h_html"><div class="ttname"><a href="base_2logging_8h.html">logging.h</a></div></div>
<div class="ttc" id="abase_2logging_8h_html_ae4db23f10f5d4aad6d735f5a74cd6f8c"><div class="ttname"><a href="base_2logging_8h.html#ae4db23f10f5d4aad6d735f5a74cd6f8c">CHECK_LE</a></div><div class="ttdeci">#define CHECK_LE(val1, val2)</div><div class="ttdef"><b>Definition:</b> <a href="base_2logging_8h_source.html#l00699">base/logging.h:699</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1_domain_html"><div class="ttname"><a href="classoperations__research_1_1_domain.html">operations_research::Domain</a></div><div class="ttdoc">We call domain any subset of Int64 = [kint64min, kint64max].</div><div class="ttdef"><b>Definition:</b> <a href="sorted__interval__list_8h_source.html#l00081">sorted_interval_list.h:81</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1_domain_html_a0c9af6e6de7c550ed05a79bc6d8ea0c4"><div class="ttname"><a href="classoperations__research_1_1_domain.html#a0c9af6e6de7c550ed05a79bc6d8ea0c4">operations_research::Domain::FromFlatIntervals</a></div><div class="ttdeci">static Domain FromFlatIntervals(const std::vector&lt; int64 &gt; &amp;flat_intervals)</div><div class="ttdoc">This method is available in Python, Java and .NET.</div><div class="ttdef"><b>Definition:</b> <a href="sorted__interval__list_8cc_source.html#l00171">sorted_interval_list.cc:171</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1_domain_html_a3dcbf23ccbed61ee64ec08a934f57a9c"><div class="ttname"><a href="classoperations__research_1_1_domain.html#a3dcbf23ccbed61ee64ec08a934f57a9c">operations_research::Domain::NumIntervals</a></div><div class="ttdeci">int NumIntervals() const</div><div class="ttdoc">Basic read-only std::vector&lt;&gt; wrapping to view a Domain as a sorted list of non-adjacent intervals.</div><div class="ttdef"><b>Definition:</b> <a href="sorted__interval__list_8h_source.html#l00339">sorted_interval_list.h:339</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1_domain_html_ad5b21b2341279b91b5265e649f3f1402"><div class="ttname"><a href="classoperations__research_1_1_domain.html#ad5b21b2341279b91b5265e649f3f1402">operations_research::Domain::FromFlatSpanOfIntervals</a></div><div class="ttdeci">static Domain FromFlatSpanOfIntervals(absl::Span&lt; const int64 &gt; flat_intervals)</div><div class="ttdoc">Same as FromIntervals() for a flattened representation (start, end, start, end, .....</div><div class="ttdef"><b>Definition:</b> <a href="sorted__interval__list_8cc_source.html#l00159">sorted_interval_list.cc:159</a></div></div>
<div class="ttc" id="acp__model_8pb_8h_html"><div class="ttname"><a href="cp__model_8pb_8h.html">cp_model.pb.h</a></div></div>
<div class="ttc" id="acp__model__fz__solver_8cc_html_aed003f5eb5197bc586b7ef2c36a63da2"><div class="ttname"><a href="cp__model__fz__solver_8cc.html#aed003f5eb5197bc586b7ef2c36a63da2">proto</a></div><div class="ttdeci">CpModelProto proto</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__fz__solver_8cc_source.html#l00107">cp_model_fz_solver.cc:107</a></div></div>
<div class="ttc" id="acp__model__solver_8cc_html_abcd33b18ce6d5a90a4ba5c37cfa58829"><div class="ttname"><a href="cp__model__solver_8cc.html#abcd33b18ce6d5a90a4ba5c37cfa58829">response</a></div><div class="ttdeci">SharedResponseManager * response</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__solver_8cc_source.html#l02118">cp_model_solver.cc:2118</a></div></div>
<div class="ttc" id="ademon__profiler_8cc_html_a05da18ca9c7b657a4a6ea24e07c9b695"><div class="ttname"><a href="demon__profiler_8cc.html#a05da18ca9c7b657a4a6ea24e07c9b695">ct</a></div><div class="ttdeci">const Constraint * ct</div><div class="ttdef"><b>Definition:</b> <a href="demon__profiler_8cc_source.html#l00042">demon_profiler.cc:42</a></div></div>
<div class="ttc" id="ademon__profiler_8cc_html_a21edc7ca4cc5802c8779d68556bc09cf"><div class="ttname"><a href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a></div><div class="ttdeci">int64 value</div><div class="ttdef"><b>Definition:</b> <a href="demon__profiler_8cc_source.html#l00043">demon_profiler.cc:43</a></div></div>
<div class="ttc" id="aintegral__types_8h_html"><div class="ttname"><a href="integral__types_8h.html">integral_types.h</a></div></div>
<div class="ttc" id="aintegral__types_8h_html_a74ea76ea27f48fb1b6e148e1577b3719"><div class="ttname"><a href="integral__types_8h.html#a74ea76ea27f48fb1b6e148e1577b3719">kint64max</a></div><div class="ttdeci">static const int64 kint64max</div><div class="ttdef"><b>Definition:</b> <a href="integral__types_8h_source.html#l00053">integral_types.h:53</a></div></div>
<div class="ttc" id="aintegral__types_8h_html_a7cde0074dfd288f2d70c0e035dacb28a"><div class="ttname"><a href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a></div><div class="ttdeci">int64_t int64</div><div class="ttdef"><b>Definition:</b> <a href="integral__types_8h_source.html#l00034">integral_types.h:34</a></div></div>
<div class="ttc" id="aintegral__types_8h_html_af458164b470cbba416d5ed579e00ff60"><div class="ttname"><a href="integral__types_8h.html#af458164b470cbba416d5ed579e00ff60">kint64min</a></div><div class="ttdeci">static const int64 kint64min</div><div class="ttdef"><b>Definition:</b> <a href="integral__types_8h_source.html#l00052">integral_types.h:52</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a1d467595ed8fe5b85dc95328ee1c2770"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a1d467595ed8fe5b85dc95328ee1c2770">operations_research::sat::UsedVariables</a></div><div class="ttdeci">std::vector&lt; int &gt; UsedVariables(const ConstraintProto &amp;ct)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8cc_source.html#l00459">cp_model_utils.cc:459</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a1ff712b32e44ffd2e7f40042330bf2ad"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a1ff712b32e44ffd2e7f40042330bf2ad">operations_research::sat::UnscaleObjectiveValue</a></div><div class="ttdeci">double UnscaleObjectiveValue(const CpObjectiveProto &amp;proto, double value)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8h_source.html#l00138">cp_model_utils.h:138</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a217338425de4389014563f1f24331713"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a217338425de4389014563f1f24331713">operations_research::sat::RefIsPositive</a></div><div class="ttdeci">bool RefIsPositive(int ref)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8h_source.html#l00034">cp_model_utils.h:34</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a217ba4c51953c701a68d6572d79801f1"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a217ba4c51953c701a68d6572d79801f1">operations_research::sat::UsedIntervals</a></div><div class="ttdeci">std::vector&lt; int &gt; UsedIntervals(const ConstraintProto &amp;ct)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8cc_source.html#l00474">cp_model_utils.cc:474</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a22efb1995471e34caa35927a9032f5f3"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a22efb1995471e34caa35927a9032f5f3">operations_research::sat::SetToNegatedLinearExpression</a></div><div class="ttdeci">void SetToNegatedLinearExpression(const LinearExpressionProto &amp;input_expr, LinearExpressionProto *output_negated_expr)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8cc_source.html#l00030">cp_model_utils.cc:30</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a42a3b266d8c6dfab1c14baa6c04e2333"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a42a3b266d8c6dfab1c14baa6c04e2333">operations_research::sat::HasEnforcementLiteral</a></div><div class="ttdeci">bool HasEnforcementLiteral(const ConstraintProto &amp;ct)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8h_source.html#l00037">cp_model_utils.h:37</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a44f635d04529be503aa7f14917185a37"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a44f635d04529be503aa7f14917185a37">operations_research::sat::ComputeInnerObjective</a></div><div class="ttdeci">int64 ComputeInnerObjective(const CpObjectiveProto &amp;objective, const CpSolverResponse &amp;response)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8cc_source.html#l00538">cp_model_utils.cc:538</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a53ea253d542bce5e351062a445dc929b"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a53ea253d542bce5e351062a445dc929b">operations_research::sat::AllValuesInDomain</a></div><div class="ttdeci">std::vector&lt; int64 &gt; AllValuesInDomain(const ProtoWithDomain &amp;proto)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8h_source.html#l00116">cp_model_utils.h:116</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a6d4dc38d28f20c0c1bbbe71fff0803e7"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a6d4dc38d28f20c0c1bbbe71fff0803e7">operations_research::sat::ApplyToAllLiteralIndices</a></div><div class="ttdeci">void ApplyToAllLiteralIndices(const std::function&lt; void(int *)&gt; &amp;f, ConstraintProto *ct)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8cc_source.html#l00166">cp_model_utils.cc:166</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a764814ea1f9e5a90d17660156b13f818"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a764814ea1f9e5a90d17660156b13f818">operations_research::sat::ScaleObjectiveValue</a></div><div class="ttdeci">double ScaleObjectiveValue(const CpObjectiveProto &amp;proto, int64 value)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8h_source.html#l00128">cp_model_utils.h:128</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a81b6165b5a5412969f351d0d343166b9"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a81b6165b5a5412969f351d0d343166b9">operations_research::sat::ApplyToAllIntervalIndices</a></div><div class="ttdeci">void ApplyToAllIntervalIndices(const std::function&lt; void(int *)&gt; &amp;f, ConstraintProto *ct)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8cc_source.html#l00336">cp_model_utils.cc:336</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a901c19b12842f8af153e588a689a90b5"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a901c19b12842f8af153e588a689a90b5">operations_research::sat::FillDomainInProto</a></div><div class="ttdeci">void FillDomainInProto(const Domain &amp;domain, ProtoWithDomain *proto)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8h_source.html#l00091">cp_model_utils.h:91</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_ab1240060466ba48a36a4b36379bce26a"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#ab1240060466ba48a36a4b36379bce26a">operations_research::sat::ReadDomainFromProto</a></div><div class="ttdeci">Domain ReadDomainFromProto(const ProtoWithDomain &amp;proto)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8h_source.html#l00102">cp_model_utils.h:102</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_ab5f94367fbf4ab2c03bd6bef412c41f7"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#ab5f94367fbf4ab2c03bd6bef412c41f7">operations_research::sat::ApplyToAllVariableIndices</a></div><div class="ttdeci">void ApplyToAllVariableIndices(const std::function&lt; void(int *)&gt; &amp;f, ConstraintProto *ct)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8cc_source.html#l00233">cp_model_utils.cc:233</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_aba8e3465fc58d3b287e05451d5230bae"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#aba8e3465fc58d3b287e05451d5230bae">operations_research::sat::GetReferencesUsedByConstraint</a></div><div class="ttdeci">IndexReferences GetReferencesUsedByConstraint(const ConstraintProto &amp;ct)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8cc_source.html#l00040">cp_model_utils.cc:40</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_ac52c02e968c262e71312e8e8462013ac"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#ac52c02e968c262e71312e8e8462013ac">operations_research::sat::DomainInProtoContains</a></div><div class="ttdeci">bool DomainInProtoContains(const ProtoWithDomain &amp;proto, int64 value)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8h_source.html#l00082">cp_model_utils.h:82</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_acdbc8ad33149d45a6e6fcd8b72fd68ed"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#acdbc8ad33149d45a6e6fcd8b72fd68ed">operations_research::sat::PositiveRef</a></div><div class="ttdeci">int PositiveRef(int ref)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8h_source.html#l00033">cp_model_utils.h:33</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_acf5b1cbffc494f14e8b87c672d5dda5f"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#acf5b1cbffc494f14e8b87c672d5dda5f">operations_research::sat::ConstraintCaseName</a></div><div class="ttdeci">std::string ConstraintCaseName(ConstraintProto::ConstraintCase constraint_case)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8cc_source.html#l00401">cp_model_utils.cc:401</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_adff14ec933b464328de54c33e81429a9"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#adff14ec933b464328de54c33e81429a9">operations_research::sat::EnforcementLiteral</a></div><div class="ttdeci">int EnforcementLiteral(const ConstraintProto &amp;ct)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8h_source.html#l00040">cp_model_utils.h:40</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_ae0803b8198728cd4f6e58498d9c60091"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#ae0803b8198728cd4f6e58498d9c60091">operations_research::sat::NegatedRef</a></div><div class="ttdeci">int NegatedRef(int ref)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8h_source.html#l00032">cp_model_utils.h:32</a></div></div>
<div class="ttc" id="anamespaceoperations__research_html"><div class="ttname"><a href="namespaceoperations__research.html">operations_research</a></div><div class="ttdoc">The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...</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="aresource_8cc_html_af92a8383a05fdf586a52263d358f5ada"><div class="ttname"><a href="resource_8cc.html#af92a8383a05fdf586a52263d358f5ada">interval</a></div><div class="ttdeci">IntervalVar * interval</div><div class="ttdef"><b>Definition:</b> <a href="resource_8cc_source.html#l00098">resource.cc:98</a></div></div>
<div class="ttc" id="asorted__interval__list_8h_html"><div class="ttname"><a href="sorted__interval__list_8h.html">sorted_interval_list.h</a></div></div>
<div class="ttc" id="astructoperations__research_1_1_closed_interval_html"><div class="ttname"><a href="structoperations__research_1_1_closed_interval.html">operations_research::ClosedInterval</a></div><div class="ttdoc">Represents a closed interval [start, end].</div><div class="ttdef"><b>Definition:</b> <a href="sorted__interval__list_8h_source.html#l00033">sorted_interval_list.h:33</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1_index_references_html"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_index_references.html">operations_research::sat::IndexReferences</a></div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8h_source.html#l00052">cp_model_utils.h:52</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1_index_references_html_a0821f58cb944376b1f8919327f202443"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_index_references.html#a0821f58cb944376b1f8919327f202443">operations_research::sat::IndexReferences::variables</a></div><div class="ttdeci">std::vector&lt; int &gt; variables</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8h_source.html#l00053">cp_model_utils.h:53</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1_index_references_html_a404c06a2a9a7b2290466f5d5423093d4"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_index_references.html#a404c06a2a9a7b2290466f5d5423093d4">operations_research::sat::IndexReferences::literals</a></div><div class="ttdeci">std::vector&lt; int &gt; literals</div><div class="ttdef"><b>Definition:</b> <a href="cp__model__utils_8h_source.html#l00054">cp_model_utils.h:54</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- 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_dddac007a45022d9da6ea1dee012c3b9.html">sat</a></li><li class="navelem"><a class="el" href="cp__model__utils_8h.html">cp_model_utils.h</a></li>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.9.1 </li>
</ul>
</div>
</body>
</html>