966 lines
205 KiB
HTML
966 lines
205 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.8.20"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>OR-Tools: pb_constraint.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
|
|
 <span id="projectnumber">8.0</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.20 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
/* @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&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&dn=gpl-2.0.txt GPL-v2 */
|
|
$(document).ready(function(){initNavTree('pb__constraint_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">pb_constraint.h</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="pb__constraint_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> <span class="comment">// Copyright 2010-2018 Google LLC</span></div>
|
|
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></div>
|
|
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <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> <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> <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <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> <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <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> <span class="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></div>
|
|
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <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> <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> <span class="comment">// limitations under the License.</span></div>
|
|
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>  </div>
|
|
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="preprocessor">#ifndef OR_TOOLS_SAT_PB_CONSTRAINT_H_</span></div>
|
|
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#define OR_TOOLS_SAT_PB_CONSTRAINT_H_</span></div>
|
|
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>  </div>
|
|
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#include <algorithm></span></div>
|
|
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include <limits></span></div>
|
|
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include <memory></span></div>
|
|
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include <string></span></div>
|
|
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include <vector></span></div>
|
|
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>  </div>
|
|
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include "absl/container/flat_hash_map.h"</span></div>
|
|
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include "absl/types/span.h"</span></div>
|
|
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include "<a class="code" href="int__type_8h.html">ortools/base/int_type.h</a>"</span></div>
|
|
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include "<a class="code" href="int__type__indexed__vector_8h.html">ortools/base/int_type_indexed_vector.h</a>"</span></div>
|
|
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "<a class="code" href="integral__types_8h.html">ortools/base/integral_types.h</a>"</span></div>
|
|
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include "<a class="code" href="base_2logging_8h.html">ortools/base/logging.h</a>"</span></div>
|
|
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include "<a class="code" href="macros_8h.html">ortools/base/macros.h</a>"</span></div>
|
|
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include "<a class="code" href="sat_2model_8h.html">ortools/sat/model.h</a>"</span></div>
|
|
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#include "<a class="code" href="sat__base_8h.html">ortools/sat/sat_base.h</a>"</span></div>
|
|
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include "<a class="code" href="sat__parameters_8pb_8h.html">ortools/sat/sat_parameters.pb.h</a>"</span></div>
|
|
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#include "<a class="code" href="bitset_8h.html">ortools/util/bitset.h</a>"</span></div>
|
|
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#include "<a class="code" href="stats_8h.html">ortools/util/stats.h</a>"</span></div>
|
|
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  </div>
|
|
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">namespace </span><a class="code" href="namespaceoperations__research.html">operations_research</a> {</div>
|
|
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="keyword">namespace </span>sat {</div>
|
|
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  </div>
|
|
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="comment">// The type of the integer coefficients in a pseudo-Boolean constraint.</span></div>
|
|
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="comment">// This is also used for the current value of a constraint or its bounds.</span></div>
|
|
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1sat.html#a517c2297268e9c4c87cfd717d76dbaeb"> 41</a></span> <a class="code" href="namespaceoperations__research_1_1sat.html#a84a0f65f1ec460c487789fe6a7620f77">DEFINE_INT_TYPE</a>(Coefficient, <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a>);</div>
|
|
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  </div>
|
|
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment">// IMPORTANT: We can't use numeric_limits<Coefficient>::max() which will compile</span></div>
|
|
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="comment">// but just returns zero!!</span></div>
|
|
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1sat.html#afd482f2c4b9533b4d1f7379a578e9b18"> 45</a></span> <span class="keyword">const</span> Coefficient <a class="code" href="namespaceoperations__research_1_1sat.html#afd482f2c4b9533b4d1f7379a578e9b18">kCoefficientMax</a>(</div>
|
|
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <a class="code" href="alldiff__cst_8cc.html#a9d0c202d5fdd62f4fa2c613339ff168a">std::numeric_limits<Coefficient::ValueType>::max</a>());</div>
|
|
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  </div>
|
|
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="comment">// Represents a term in a pseudo-Boolean formula.</span></div>
|
|
<div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html"> 49</a></span> <span class="keyword">struct </span><a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html">LiteralWithCoeff</a> {</div>
|
|
<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#a9c8a1b84df9dd447ccd80db948eb5085"> 50</a></span>  <a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#a9c8a1b84df9dd447ccd80db948eb5085">LiteralWithCoeff</a>() {}</div>
|
|
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#ab5052c90c60767f4e16e79ea8d0bffb4"> 51</a></span>  <a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#ab5052c90c60767f4e16e79ea8d0bffb4">LiteralWithCoeff</a>(<a class="code" href="classoperations__research_1_1sat_1_1_literal.html">Literal</a> l, Coefficient c) : <a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#af63dcc00f2023fdf498e0829e6fb8a6b">literal</a>(l), <a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#ada84a5c84452210dd2919b83deb58ca3">coefficient</a>(c) {}</div>
|
|
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#a168a81a82b65c695d194352ab194eff5"> 52</a></span>  <a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#a168a81a82b65c695d194352ab194eff5">LiteralWithCoeff</a>(<a class="code" href="classoperations__research_1_1sat_1_1_literal.html">Literal</a> l, <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> c) : <a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#af63dcc00f2023fdf498e0829e6fb8a6b">literal</a>(l), <a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#ada84a5c84452210dd2919b83deb58ca3">coefficient</a>(c) {}</div>
|
|
<div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#af63dcc00f2023fdf498e0829e6fb8a6b"> 53</a></span>  <a class="code" href="classoperations__research_1_1sat_1_1_literal.html">Literal</a> <a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#af63dcc00f2023fdf498e0829e6fb8a6b">literal</a>;</div>
|
|
<div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#ada84a5c84452210dd2919b83deb58ca3"> 54</a></span>  Coefficient <a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#ada84a5c84452210dd2919b83deb58ca3">coefficient</a>;</div>
|
|
<div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#a262cd3d45828aaec895b772bd50002d5"> 55</a></span>  <span class="keywordtype">bool</span> <a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#a262cd3d45828aaec895b772bd50002d5">operator==</a>(<span class="keyword">const</span> <a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html">LiteralWithCoeff</a>& other)<span class="keyword"> const </span>{</div>
|
|
<div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="keywordflow">return</span> <a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#af63dcc00f2023fdf498e0829e6fb8a6b">literal</a>.<a class="code" href="classoperations__research_1_1sat_1_1_literal.html#a4a11c7c4d7706c09de5e18707c3b5c62">Index</a>() == other.<a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#af63dcc00f2023fdf498e0829e6fb8a6b">literal</a>.<a class="code" href="classoperations__research_1_1sat_1_1_literal.html#a4a11c7c4d7706c09de5e18707c3b5c62">Index</a>() &&</div>
|
|
<div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#ada84a5c84452210dd2919b83deb58ca3">coefficient</a> == other.<a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#ada84a5c84452210dd2919b83deb58ca3">coefficient</a>;</div>
|
|
<div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  }</div>
|
|
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span> };</div>
|
|
<div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1sat.html#a388142a765e4a889892760e0961b9a5d"> 60</a></span> <span class="keyword">inline</span> std::ostream& <a class="code" href="namespaceoperations__research_1_1sat.html#a15ca399ada8a279dc92f693ede7e4004">operator<<</a>(std::ostream& os, <a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html">LiteralWithCoeff</a> term) {</div>
|
|
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  os << term.<a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#ada84a5c84452210dd2919b83deb58ca3">coefficient</a> << <span class="stringliteral">"["</span> << term.<a class="code" href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#af63dcc00f2023fdf498e0829e6fb8a6b">literal</a>.<a class="code" href="classoperations__research_1_1sat_1_1_literal.html#a764be64f3029f8b8e23511061d8de355">DebugString</a>() << <span class="stringliteral">"]"</span>;</div>
|
|
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <span class="keywordflow">return</span> os;</div>
|
|
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span> }</div>
|
|
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  </div>
|
|
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="comment">// Puts the given Boolean linear expression in canonical form:</span></div>
|
|
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="comment">// - Merge all the literal corresponding to the same variable.</span></div>
|
|
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="comment">// - Remove zero coefficients.</span></div>
|
|
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="comment">// - Make all the coefficients positive.</span></div>
|
|
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="comment">// - Sort the terms by increasing coefficient values.</span></div>
|
|
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="comment">// This function also computes:</span></div>
|
|
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="comment">// - max_value: the maximum possible value of the formula.</span></div>
|
|
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="comment">// - bound_shift: which allows to updates initial bounds. That is, if an</span></div>
|
|
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="comment">// initial pseudo-Boolean constraint was</span></div>
|
|
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="comment">// lhs < initial_pb_formula < rhs</span></div>
|
|
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span> <span class="comment">// then the new one is:</span></div>
|
|
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <span class="comment">// lhs + bound_shift < canonical_form < rhs + bound_shift</span></div>
|
|
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span> <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="comment">// Finally, this will return false, if some integer overflow or underflow</span></div>
|
|
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="comment">// occurred during the reduction to the canonical form.</span></div>
|
|
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceoperations__research_1_1sat.html#a8860b588974cb8ffaf2ac97eafd67b3e">ComputeBooleanLinearExpressionCanonicalForm</a>(</div>
|
|
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  std::vector<LiteralWithCoeff>* cst, Coefficient* bound_shift,</div>
|
|
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  Coefficient* max_value);</div>
|
|
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  </div>
|
|
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="comment">// Maps all the literals of the given constraint using the given mapping. The</span></div>
|
|
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span> <span class="comment">// mapping may map a literal index to kTrueLiteralIndex or kFalseLiteralIndex in</span></div>
|
|
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span> <span class="comment">// which case the literal will be considered fixed to the appropriate value.</span></div>
|
|
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span> <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span> <span class="comment">// Note that this function also canonicalizes the constraint and updates</span></div>
|
|
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span> <span class="comment">// bound_shift and max_value like ComputeBooleanLinearExpressionCanonicalForm()</span></div>
|
|
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span> <span class="comment">// does.</span></div>
|
|
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span> <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span> <span class="comment">// Finally, this will return false if some integer overflow or underflow</span></div>
|
|
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span> <span class="comment">// occurred during the constraint simplification.</span></div>
|
|
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceoperations__research_1_1sat.html#a736df4a48666566457c579534cb73d42">ApplyLiteralMapping</a>(</div>
|
|
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="keyword">const</span> <a class="code" href="classgtl_1_1_i_t_i_vector.html">gtl::ITIVector<LiteralIndex, LiteralIndex></a>& mapping,</div>
|
|
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  std::vector<LiteralWithCoeff>* cst, Coefficient* bound_shift,</div>
|
|
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  Coefficient* max_value);</div>
|
|
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  </div>
|
|
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span> <span class="comment">// From a constraint 'expr <= ub' and the result (bound_shift, max_value) of</span></div>
|
|
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span> <span class="comment">// calling ComputeBooleanLinearExpressionCanonicalForm() on 'expr', this returns</span></div>
|
|
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span> <span class="comment">// a new rhs such that 'canonical expression <= rhs' is an equivalent</span></div>
|
|
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span> <span class="comment">// constraint. This function deals with all the possible overflow corner cases.</span></div>
|
|
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span> <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span> <span class="comment">// The result will be in [-1, max_value] where -1 means unsatisfiable and</span></div>
|
|
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span> <span class="comment">// max_value means trivialy satisfiable.</span></div>
|
|
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span> Coefficient <a class="code" href="namespaceoperations__research_1_1sat.html#a01c76d0c46e2975d10e45ab04877f4ac">ComputeCanonicalRhs</a>(Coefficient upper_bound,</div>
|
|
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  Coefficient bound_shift, Coefficient max_value);</div>
|
|
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  </div>
|
|
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span> <span class="comment">// Same as ComputeCanonicalRhs(), but uses the initial constraint lower bound</span></div>
|
|
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <span class="comment">// instead. From a constraint 'lb <= expression', this returns a rhs such that</span></div>
|
|
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span> <span class="comment">// 'canonical expression with literals negated <= rhs'.</span></div>
|
|
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span> <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span> <span class="comment">// Note that the range is also [-1, max_value] with the same meaning.</span></div>
|
|
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span> Coefficient <a class="code" href="namespaceoperations__research_1_1sat.html#a5c5399274f079c718ec46bf4b3032d27">ComputeNegatedCanonicalRhs</a>(Coefficient lower_bound,</div>
|
|
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  Coefficient bound_shift,</div>
|
|
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  Coefficient max_value);</div>
|
|
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  </div>
|
|
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span> <span class="comment">// Returns true iff the Boolean linear expression is in canonical form.</span></div>
|
|
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceoperations__research_1_1sat.html#acf18431db5241d6ae15e5db2470d9079">BooleanLinearExpressionIsCanonical</a>(</div>
|
|
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="keyword">const</span> std::vector<LiteralWithCoeff>& cst);</div>
|
|
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  </div>
|
|
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span> <span class="comment">// Given a Boolean linear constraint in canonical form, simplify its</span></div>
|
|
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span> <span class="comment">// coefficients using simple heuristics.</span></div>
|
|
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="keywordtype">void</span> <a class="code" href="namespaceoperations__research_1_1sat.html#a740bdf0c6c84d1fd07e8405fac06e04e">SimplifyCanonicalBooleanLinearConstraint</a>(</div>
|
|
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  std::vector<LiteralWithCoeff>* cst, Coefficient* rhs);</div>
|
|
<div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  </div>
|
|
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span> <span class="comment">// Holds a set of boolean linear constraints in canonical form:</span></div>
|
|
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span> <span class="comment">// - The constraint is a linear sum of LiteralWithCoeff <= rhs.</span></div>
|
|
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span> <span class="comment">// - The linear sum satisfies the properties described in</span></div>
|
|
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span> <span class="comment">// ComputeBooleanLinearExpressionCanonicalForm().</span></div>
|
|
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span> <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span> <span class="comment">// TODO(user): Simplify further the constraints.</span></div>
|
|
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span> <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span> <span class="comment">// TODO(user): Remove the duplication between this and what the sat solver</span></div>
|
|
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span> <span class="comment">// is doing in AddLinearConstraint() which is basically the same.</span></div>
|
|
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span> <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span> <span class="comment">// TODO(user): Remove duplicate constraints? some problems have them, and</span></div>
|
|
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span> <span class="comment">// this is not ideal for the symmetry computation since it leads to a lot of</span></div>
|
|
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span> <span class="comment">// symmetries of the associated graph that are not useful.</span></div>
|
|
<div class="line"><a name="l00141"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html"> 141</a></span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html">CanonicalBooleanLinearProblem</a> {</div>
|
|
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  <span class="keyword">public</span>:</div>
|
|
<div class="line"><a name="l00143"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html#a284a9b03285c5c0a835e07aba4f77b6f"> 143</a></span>  <a class="code" href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html#a284a9b03285c5c0a835e07aba4f77b6f">CanonicalBooleanLinearProblem</a>() {}</div>
|
|
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  </div>
|
|
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="comment">// Adds a new constraint to the problem. The bounds are inclusive.</span></div>
|
|
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  <span class="comment">// Returns false in case of a possible overflow or if the constraint is</span></div>
|
|
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="comment">// never satisfiable.</span></div>
|
|
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="comment">// TODO(user): Use a return status to distinguish errors if needed.</span></div>
|
|
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html#a05c49a95f6af6f8d873c96cae6ab6653">AddLinearConstraint</a>(<span class="keywordtype">bool</span> use_lower_bound, Coefficient lower_bound,</div>
|
|
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="keywordtype">bool</span> use_upper_bound, Coefficient upper_bound,</div>
|
|
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  std::vector<LiteralWithCoeff>* cst);</div>
|
|
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  </div>
|
|
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  <span class="comment">// Getters. All the constraints are guaranteed to be in canonical form.</span></div>
|
|
<div class="line"><a name="l00155"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html#a03666f2e70e42a9560aa9ce7416d2644"> 155</a></span>  <span class="keywordtype">int</span> <a class="code" href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html#a03666f2e70e42a9560aa9ce7416d2644">NumConstraints</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> constraints_.size(); }</div>
|
|
<div class="line"><a name="l00156"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html#a7391d0c784872207477f474cf28f65a5"> 156</a></span>  <span class="keyword">const</span> Coefficient <a class="code" href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html#a7391d0c784872207477f474cf28f65a5">Rhs</a>(<span class="keywordtype">int</span> i)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rhs_[i]; }</div>
|
|
<div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html#a95128a258b1f7d9a4058362edfd2158b"> 157</a></span>  <span class="keyword">const</span> std::vector<LiteralWithCoeff>& <a class="code" href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html#a95128a258b1f7d9a4058362edfd2158b">Constraint</a>(<span class="keywordtype">int</span> i)<span class="keyword"> const </span>{</div>
|
|
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <span class="keywordflow">return</span> constraints_[i];</div>
|
|
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  }</div>
|
|
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  </div>
|
|
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keyword">private</span>:</div>
|
|
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  <span class="keywordtype">bool</span> AddConstraint(<span class="keyword">const</span> std::vector<LiteralWithCoeff>& cst,</div>
|
|
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  Coefficient max_value, Coefficient rhs);</div>
|
|
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  </div>
|
|
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  std::vector<Coefficient> rhs_;</div>
|
|
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  std::vector<std::vector<LiteralWithCoeff>> constraints_;</div>
|
|
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  DISALLOW_COPY_AND_ASSIGN(<a class="code" href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html">CanonicalBooleanLinearProblem</a>);</div>
|
|
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span> };</div>
|
|
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  </div>
|
|
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span> <span class="comment">// Encode a constraint sum term <= rhs, where each term is a positive</span></div>
|
|
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span> <span class="comment">// Coefficient times a literal. This class allows efficient modification of the</span></div>
|
|
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span> <span class="comment">// constraint and is used during pseudo-Boolean resolution.</span></div>
|
|
<div class="line"><a name="l00173"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html"> 173</a></span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html">MutableUpperBoundedLinearConstraint</a> {</div>
|
|
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  <span class="keyword">public</span>:</div>
|
|
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <span class="comment">// This must be called before any other functions is used with an higher</span></div>
|
|
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <span class="comment">// variable index.</span></div>
|
|
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#ac85244c6eaf57970b2057657ae70ee17">ClearAndResize</a>(<span class="keywordtype">int</span> num_variables);</div>
|
|
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  </div>
|
|
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>  <span class="comment">// Reset the constraint to 0 <= 0.</span></div>
|
|
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>  <span class="comment">// Note that the contraint size stays the same.</span></div>
|
|
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#aa7d76b766faf39c1652b6617eac5fe20">ClearAll</a>();</div>
|
|
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>  </div>
|
|
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>  <span class="comment">// Returns the coefficient (>= 0) of the given variable.</span></div>
|
|
<div class="line"><a name="l00184"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#ad87ff40755cf420a0b8ead1f7f9f0489"> 184</a></span>  Coefficient <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#ad87ff40755cf420a0b8ead1f7f9f0489">GetCoefficient</a>(BooleanVariable <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>)<span class="keyword"> const </span>{</div>
|
|
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>  <span class="keywordflow">return</span> AbsCoefficient(terms_[<a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>]);</div>
|
|
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  }</div>
|
|
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  </div>
|
|
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="comment">// Returns the literal under which the given variable appear in the</span></div>
|
|
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <span class="comment">// constraint. Note that if GetCoefficient(var) == 0 this just returns</span></div>
|
|
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  <span class="comment">// Literal(var, true).</span></div>
|
|
<div class="line"><a name="l00191"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a2296cbfc427d1ccfb3ecc7d0ced18b01"> 191</a></span>  <a class="code" href="classoperations__research_1_1sat_1_1_literal.html">Literal</a> <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a2296cbfc427d1ccfb3ecc7d0ced18b01">GetLiteral</a>(BooleanVariable <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>)<span class="keyword"> const </span>{</div>
|
|
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="keywordflow">return</span> <a class="code" href="classoperations__research_1_1sat_1_1_literal.html">Literal</a>(<a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>, terms_[<a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>] > 0);</div>
|
|
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  }</div>
|
|
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  </div>
|
|
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="comment">// If we have a lower bounded constraint sum terms >= rhs, then it is trivial</span></div>
|
|
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <span class="comment">// to see that the coefficient of any term can be reduced to rhs if it is</span></div>
|
|
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  <span class="comment">// bigger. This does exactly this operation, but on the upper bounded</span></div>
|
|
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <span class="comment">// representation.</span></div>
|
|
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  <span class="comment">// If we take a constraint sum ci.xi <= rhs, take its negation and add max_sum</span></div>
|
|
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <span class="comment">// on both side, we have sum ci.(1 - xi) >= max_sum - rhs</span></div>
|
|
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="comment">// So every ci > (max_sum - rhs) can be replacend by (max_sum - rhs).</span></div>
|
|
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="comment">// Not that this operation also change the original rhs of the constraint.</span></div>
|
|
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a16645beea614ddea591b722904131da9">ReduceCoefficients</a>();</div>
|
|
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  </div>
|
|
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <span class="comment">// Same as ReduceCoefficients() but only consider the coefficient of the given</span></div>
|
|
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <span class="comment">// variable.</span></div>
|
|
<div class="line"><a name="l00208"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a8a9bf7ca1aaa88ead85b1e5e0b812a8b"> 208</a></span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a8a9bf7ca1aaa88ead85b1e5e0b812a8b">ReduceGivenCoefficient</a>(BooleanVariable <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>) {</div>
|
|
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <span class="keyword">const</span> Coefficient <a class="code" href="routing__search_8cc.html#a204f9b990226e8288e1aaecbb496cbf8">bound</a> = max_sum_ - rhs_;</div>
|
|
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  <span class="keyword">const</span> Coefficient diff = <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#ad87ff40755cf420a0b8ead1f7f9f0489">GetCoefficient</a>(<a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>) - <a class="code" href="routing__search_8cc.html#a204f9b990226e8288e1aaecbb496cbf8">bound</a>;</div>
|
|
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="keywordflow">if</span> (diff > 0) {</div>
|
|
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  rhs_ -= diff;</div>
|
|
<div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  max_sum_ -= diff;</div>
|
|
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  terms_[<a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>] = (terms_[<a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>] > 0) ? <a class="code" href="routing__search_8cc.html#a204f9b990226e8288e1aaecbb496cbf8">bound</a> : -<a class="code" href="routing__search_8cc.html#a204f9b990226e8288e1aaecbb496cbf8">bound</a>;</div>
|
|
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  }</div>
|
|
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  }</div>
|
|
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  </div>
|
|
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <span class="comment">// Compute the constraint slack assuming that only the variables with index <</span></div>
|
|
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="comment">// trail_index are assigned.</span></div>
|
|
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  Coefficient <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a3061094c37b507ae2834cb7d86fbcf39">ComputeSlackForTrailPrefix</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>& trail,</div>
|
|
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="keywordtype">int</span> trail_index) <span class="keyword">const</span>;</div>
|
|
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  </div>
|
|
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  <span class="comment">// Same as ReduceCoefficients() followed by ComputeSlackForTrailPrefix(). It</span></div>
|
|
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="comment">// allows to loop only once over all the terms of the constraint instead of</span></div>
|
|
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="comment">// doing it twice. This helps since doing that can be the main bottleneck.</span></div>
|
|
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  <span class="comment">// Note that this function assumes that the returned slack will be negative.</span></div>
|
|
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <span class="comment">// This allow to DCHECK some assumptions on what coefficients can be reduced</span></div>
|
|
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  <span class="comment">// or not.</span></div>
|
|
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  <span class="comment">// TODO(user): Ideally the slack should be maitainable incrementally.</span></div>
|
|
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  Coefficient <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a34a2ab35db64cd0574f980eb99d34a89">ReduceCoefficientsAndComputeSlackForTrailPrefix</a>(</div>
|
|
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>& trail, <span class="keywordtype">int</span> trail_index);</div>
|
|
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  </div>
|
|
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  <span class="comment">// Relaxes the constraint so that:</span></div>
|
|
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  <span class="comment">// - ComputeSlackForTrailPrefix(trail, trail_index) == target;</span></div>
|
|
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  <span class="comment">// - All the variables that were propagated given the assignment < trail_index</span></div>
|
|
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>  <span class="comment">// are still propagated.</span></div>
|
|
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>  <span class="comment">// As a precondition, ComputeSlackForTrailPrefix(trail, trail_index) >= target</span></div>
|
|
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  <span class="comment">// Note that nothing happen if the slack is already equals to target.</span></div>
|
|
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  <span class="comment">// Algorithm: Let diff = slack - target (>= 0). We will split the constraint</span></div>
|
|
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  <span class="comment">// linear expression in 3 parts:</span></div>
|
|
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>  <span class="comment">// - P1: the true variables (only the one assigned < trail_index).</span></div>
|
|
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>  <span class="comment">// - P2: the other variables with a coeff > diff.</span></div>
|
|
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>  <span class="comment">// Note that all these variables were the propagated ones.</span></div>
|
|
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>  <span class="comment">// - P3: the other variables with a coeff <= diff.</span></div>
|
|
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>  <span class="comment">// We can then transform P1 + P2 + P3 <= rhs_ into P1 + P2' <= rhs_ - diff</span></div>
|
|
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  <span class="comment">// Where P2' is the same sum as P2 with all the coefficient reduced by diff.</span></div>
|
|
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  <span class="comment">// Proof: Given the old constraint, we want to show that the relaxed one is</span></div>
|
|
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  <span class="comment">// always true. If all the variable in P2' are false, then</span></div>
|
|
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  <span class="comment">// P1 <= rhs_ - slack <= rhs_ - diff is always true. If at least one of the</span></div>
|
|
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  <span class="comment">// P2' variable is true, then P2 >= P2' + diff and we have</span></div>
|
|
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  <span class="comment">// P1 + P2' + diff <= P1 + P2 <= rhs_.</span></div>
|
|
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a3d589ce2855e8e0e57354f33d73123e2">ReduceSlackTo</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>& trail, <span class="keywordtype">int</span> trail_index,</div>
|
|
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  Coefficient initial_slack, Coefficient target);</div>
|
|
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  </div>
|
|
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  <span class="comment">// Copies this constraint into a vector<LiteralWithCoeff> representation.</span></div>
|
|
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#ad49fd13bba7789f08d81d6c71d856082">CopyIntoVector</a>(std::vector<LiteralWithCoeff>* output);</div>
|
|
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  </div>
|
|
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <span class="comment">// Adds a non-negative value to this constraint Rhs().</span></div>
|
|
<div class="line"><a name="l00264"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#ac4fb16d0641ccef0502adb8bbe3909af"> 264</a></span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#ac4fb16d0641ccef0502adb8bbe3909af">AddToRhs</a>(Coefficient <a class="code" href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a>) {</div>
|
|
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  CHECK_GE(<a class="code" href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a>, 0);</div>
|
|
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>  rhs_ += <a class="code" href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a>;</div>
|
|
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  }</div>
|
|
<div class="line"><a name="l00268"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a4556e82417879ecf2bf14a4ee7bfce9e"> 268</a></span>  Coefficient <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a4556e82417879ecf2bf14a4ee7bfce9e">Rhs</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rhs_; }</div>
|
|
<div class="line"><a name="l00269"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a2017fd2cf382a2d3e8989cbeccf4cd1b"> 269</a></span>  Coefficient <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a2017fd2cf382a2d3e8989cbeccf4cd1b">MaxSum</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> max_sum_; }</div>
|
|
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  </div>
|
|
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  <span class="comment">// Adds a term to this constraint. This is in the .h for efficiency.</span></div>
|
|
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  <span class="comment">// The encoding used internally is described below in the terms_ comment.</span></div>
|
|
<div class="line"><a name="l00273"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#aaff50cb53673c51920c6bcb567ca8806"> 273</a></span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#aaff50cb53673c51920c6bcb567ca8806">AddTerm</a>(<a class="code" href="classoperations__research_1_1sat_1_1_literal.html">Literal</a> <a class="code" href="optimization_8cc.html#af63dcc00f2023fdf498e0829e6fb8a6b">literal</a>, Coefficient coeff) {</div>
|
|
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  CHECK_GT(coeff, 0);</div>
|
|
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  <span class="keyword">const</span> BooleanVariable <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a> = <a class="code" href="optimization_8cc.html#af63dcc00f2023fdf498e0829e6fb8a6b">literal</a>.Variable();</div>
|
|
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  <span class="keyword">const</span> Coefficient term_encoding = <a class="code" href="optimization_8cc.html#af63dcc00f2023fdf498e0829e6fb8a6b">literal</a>.IsPositive() ? coeff : -coeff;</div>
|
|
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  <span class="keywordflow">if</span> (<a class="code" href="optimization_8cc.html#af63dcc00f2023fdf498e0829e6fb8a6b">literal</a> != <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a2296cbfc427d1ccfb3ecc7d0ced18b01">GetLiteral</a>(<a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>)) {</div>
|
|
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  <span class="comment">// The two terms are of opposite sign, a "cancelation" happens.</span></div>
|
|
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  <span class="comment">// We need to change the encoding of the lower magnitude term.</span></div>
|
|
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  <span class="comment">// - If term > 0, term . x -> term . (x - 1) + term</span></div>
|
|
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  <span class="comment">// - If term < 0, term . (x - 1) -> term . x - term</span></div>
|
|
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  <span class="comment">// In both cases, rhs -= abs(term).</span></div>
|
|
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  rhs_ -= <a class="code" href="alldiff__cst_8cc.html#a021e695f54a13bd809c34b2f4ca87c37">std::min</a>(coeff, AbsCoefficient(terms_[<a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>]));</div>
|
|
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  max_sum_ += AbsCoefficient(term_encoding + terms_[<a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>]) -</div>
|
|
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  AbsCoefficient(terms_[<a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>]);</div>
|
|
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  } <span class="keywordflow">else</span> {</div>
|
|
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  <span class="comment">// Both terms are of the same sign (or terms_[var] is zero).</span></div>
|
|
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  max_sum_ += coeff;</div>
|
|
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  }</div>
|
|
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  CHECK_GE(max_sum_, 0) << <span class="stringliteral">"Overflow"</span>;</div>
|
|
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  terms_[<a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>] += term_encoding;</div>
|
|
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  non_zeros_.<a class="code" href="classoperations__research_1_1_sparse_bitset.html#a41f798a04019147982b29c576ff9d8b7">Set</a>(<a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>);</div>
|
|
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  }</div>
|
|
<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="comment">// Returns the "cancelation" amount of AddTerm(literal, coeff).</span></div>
|
|
<div class="line"><a name="l00296"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a7af7a846335222cba297cb30a41c6525"> 296</a></span>  Coefficient <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a7af7a846335222cba297cb30a41c6525">CancelationAmount</a>(<a class="code" href="classoperations__research_1_1sat_1_1_literal.html">Literal</a> <a class="code" href="optimization_8cc.html#af63dcc00f2023fdf498e0829e6fb8a6b">literal</a>, Coefficient coeff)<span class="keyword"> const </span>{</div>
|
|
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  DCHECK_GT(coeff, 0);</div>
|
|
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  <span class="keyword">const</span> BooleanVariable <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a> = <a class="code" href="optimization_8cc.html#af63dcc00f2023fdf498e0829e6fb8a6b">literal</a>.Variable();</div>
|
|
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  <span class="keywordflow">if</span> (<a class="code" href="optimization_8cc.html#af63dcc00f2023fdf498e0829e6fb8a6b">literal</a> == <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a2296cbfc427d1ccfb3ecc7d0ced18b01">GetLiteral</a>(<a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>)) <span class="keywordflow">return</span> Coefficient(0);</div>
|
|
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  <span class="keywordflow">return</span> <a class="code" href="alldiff__cst_8cc.html#a021e695f54a13bd809c34b2f4ca87c37">std::min</a>(coeff, AbsCoefficient(terms_[<a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>]));</div>
|
|
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>  }</div>
|
|
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  </div>
|
|
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  <span class="comment">// Returns a set of positions that contains all the non-zeros terms of the</span></div>
|
|
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>  <span class="comment">// constraint. Note that this set can also contains some zero terms.</span></div>
|
|
<div class="line"><a name="l00305"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a5a8bf8a7daa44c4c35f8aa05a84c19ba"> 305</a></span>  <span class="keyword">const</span> std::vector<BooleanVariable>& <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a5a8bf8a7daa44c4c35f8aa05a84c19ba">PossibleNonZeros</a>()<span class="keyword"> const </span>{</div>
|
|
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  <span class="keywordflow">return</span> non_zeros_.<a class="code" href="classoperations__research_1_1_sparse_bitset.html#a1e5ae9fb14fd6b25919148ae8bbaf050">PositionsSetAtLeastOnce</a>();</div>
|
|
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  }</div>
|
|
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  </div>
|
|
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  <span class="comment">// Returns a string representation of the constraint.</span></div>
|
|
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  std::string <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a6097c48821f010becb9a6910f4c39288">DebugString</a>();</div>
|
|
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  </div>
|
|
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  <span class="keyword">private</span>:</div>
|
|
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  Coefficient AbsCoefficient(Coefficient <a class="code" href="constraint__solver_2table_8cc.html#af730895c6c6ef6e03caaf6251192dfd2">a</a>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="constraint__solver_2table_8cc.html#af730895c6c6ef6e03caaf6251192dfd2">a</a> > 0 ? <a class="code" href="constraint__solver_2table_8cc.html#af730895c6c6ef6e03caaf6251192dfd2">a</a> : -<a class="code" href="constraint__solver_2table_8cc.html#af730895c6c6ef6e03caaf6251192dfd2">a</a>; }</div>
|
|
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  </div>
|
|
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  <span class="comment">// Only used for DCHECK_EQ(max_sum_, ComputeMaxSum());</span></div>
|
|
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  Coefficient ComputeMaxSum() <span class="keyword">const</span>;</div>
|
|
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  </div>
|
|
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  <span class="comment">// The encoding is special:</span></div>
|
|
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  <span class="comment">// - If terms_[x] > 0, then the associated term is 'terms_[x] . x'</span></div>
|
|
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  <span class="comment">// - If terms_[x] < 0, then the associated term is 'terms_[x] . (x - 1)'</span></div>
|
|
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  <a class="code" href="classgtl_1_1_i_t_i_vector.html">gtl::ITIVector<BooleanVariable, Coefficient></a> terms_;</div>
|
|
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  </div>
|
|
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  <span class="comment">// The right hand side of the constraint (sum terms <= rhs_).</span></div>
|
|
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  Coefficient rhs_;</div>
|
|
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  </div>
|
|
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  <span class="comment">// The constraint maximum sum (i.e. sum of the absolute term coefficients).</span></div>
|
|
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  <span class="comment">// Note that checking the integer overflow on this sum is enough.</span></div>
|
|
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  Coefficient max_sum_;</div>
|
|
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  </div>
|
|
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  <span class="comment">// Contains the possibly non-zeros terms_ value.</span></div>
|
|
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  <a class="code" href="classoperations__research_1_1_sparse_bitset.html">SparseBitset<BooleanVariable></a> non_zeros_;</div>
|
|
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span> };</div>
|
|
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  </div>
|
|
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span> <span class="comment">// A simple "helper" class to enqueue a propagated literal on the trail and</span></div>
|
|
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span> <span class="comment">// keep the information needed to explain it when requested.</span></div>
|
|
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span> <span class="keyword">class </span>UpperBoundedLinearConstraint;</div>
|
|
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  </div>
|
|
<div class="line"><a name="l00338"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html"> 338</a></span> <span class="keyword">struct </span><a class="code" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html">PbConstraintsEnqueueHelper</a> {</div>
|
|
<div class="line"><a name="l00339"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html#a80f73afb7f3e4965def965261750bc86"> 339</a></span>  <span class="keywordtype">void</span> <a class="code" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html#a80f73afb7f3e4965def965261750bc86">Enqueue</a>(<a class="code" href="classoperations__research_1_1sat_1_1_literal.html">Literal</a> l, <span class="keywordtype">int</span> source_trail_index,</div>
|
|
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>  <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html">UpperBoundedLinearConstraint</a>* <a class="code" href="demon__profiler_8cc.html#a05da18ca9c7b657a4a6ea24e07c9b695">ct</a>, <a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>* trail) {</div>
|
|
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  <a class="code" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html#a2b537e8bba9403eef4d626a7a8b921a1">reasons</a>[trail-><a class="code" href="classoperations__research_1_1sat_1_1_trail.html#a8ef12397d1682615bc3108c397734179">Index</a>()] = {source_trail_index, <a class="code" href="demon__profiler_8cc.html#a05da18ca9c7b657a4a6ea24e07c9b695">ct</a>};</div>
|
|
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>  trail-><a class="code" href="classoperations__research_1_1sat_1_1_trail.html#a12c36a7cb228d80bcad42fa38a103f92">Enqueue</a>(l, <a class="code" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html#ac12cf291d1c4f67f024ecd26b791507d">propagator_id</a>);</div>
|
|
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>  }</div>
|
|
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>  </div>
|
|
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>  <span class="comment">// The propagator id of PbConstraints.</span></div>
|
|
<div class="line"><a name="l00346"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html#ac12cf291d1c4f67f024ecd26b791507d"> 346</a></span>  <span class="keywordtype">int</span> <a class="code" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html#ac12cf291d1c4f67f024ecd26b791507d">propagator_id</a>;</div>
|
|
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  </div>
|
|
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  <span class="comment">// A temporary vector to store the last conflict.</span></div>
|
|
<div class="line"><a name="l00349"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html#aaae88a70725a09afe173932f040c49a1"> 349</a></span>  std::vector<Literal> <a class="code" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html#aaae88a70725a09afe173932f040c49a1">conflict</a>;</div>
|
|
<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="comment">// Information needed to recover the reason of an Enqueue().</span></div>
|
|
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  <span class="comment">// Indexed by trail_index.</span></div>
|
|
<div class="line"><a name="l00353"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper_1_1_reason_info.html"> 353</a></span>  <span class="keyword">struct </span><a class="code" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper_1_1_reason_info.html">ReasonInfo</a> {</div>
|
|
<div class="line"><a name="l00354"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper_1_1_reason_info.html#a423024af9357cc1dff15aa424e022d9d"> 354</a></span>  <span class="keywordtype">int</span> <a class="code" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper_1_1_reason_info.html#a423024af9357cc1dff15aa424e022d9d">source_trail_index</a>;</div>
|
|
<div class="line"><a name="l00355"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper_1_1_reason_info.html#afe52c2c26c7ea4bb701d2e051c0f3833"> 355</a></span>  <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html">UpperBoundedLinearConstraint</a>* <a class="code" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper_1_1_reason_info.html#afe52c2c26c7ea4bb701d2e051c0f3833">pb_constraint</a>;</div>
|
|
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  };</div>
|
|
<div class="line"><a name="l00357"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html#a2b537e8bba9403eef4d626a7a8b921a1"> 357</a></span>  std::vector<ReasonInfo> <a class="code" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html#a2b537e8bba9403eef4d626a7a8b921a1">reasons</a>;</div>
|
|
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span> };</div>
|
|
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  </div>
|
|
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span> <span class="comment">// This class contains half the propagation logic for a constraint of the form</span></div>
|
|
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span> <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span> <span class="comment">// sum ci * li <= rhs, ci positive coefficients, li literals.</span></div>
|
|
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span> <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span> <span class="comment">// The other half is implemented by the PbConstraints class below which takes</span></div>
|
|
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span> <span class="comment">// care of updating the 'threshold' value of this constraint:</span></div>
|
|
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span> <span class="comment">// - 'slack' is rhs minus all the ci of the variables xi assigned to</span></div>
|
|
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span> <span class="comment">// true. Note that it is not updated as soon as xi is assigned, but only</span></div>
|
|
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span> <span class="comment">// later when this assignment is "processed" by the PbConstraints class.</span></div>
|
|
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span> <span class="comment">// - 'threshold' is the distance from 'slack' to the largest coefficient ci</span></div>
|
|
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span> <span class="comment">// smaller or equal to slack. By definition, all the literals with</span></div>
|
|
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span> <span class="comment">// even larger coefficients that are yet 'processed' must be false for the</span></div>
|
|
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span> <span class="comment">// constraint to be satisfiable.</span></div>
|
|
<div class="line"><a name="l00373"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html"> 373</a></span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html">UpperBoundedLinearConstraint</a> {</div>
|
|
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  <span class="keyword">public</span>:</div>
|
|
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  <span class="comment">// Takes a pseudo-Boolean formula in canonical form.</span></div>
|
|
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  <span class="keyword">explicit</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#aaf167a7e47f0e21f2b67ba9af023530a">UpperBoundedLinearConstraint</a>(</div>
|
|
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>  <span class="keyword">const</span> std::vector<LiteralWithCoeff>& cst);</div>
|
|
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>  </div>
|
|
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>  <span class="comment">// Returns true if the given terms are the same as the one in this constraint.</span></div>
|
|
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>  <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a32f963abf423028dcbb4d1c3daf8086d">HasIdenticalTerms</a>(<span class="keyword">const</span> std::vector<LiteralWithCoeff>& cst);</div>
|
|
<div class="line"><a name="l00381"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a4556e82417879ecf2bf14a4ee7bfce9e"> 381</a></span>  Coefficient <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a4556e82417879ecf2bf14a4ee7bfce9e">Rhs</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rhs_; }</div>
|
|
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>  </div>
|
|
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>  <span class="comment">// Sets the rhs of this constraint. Compute the initial threshold value using</span></div>
|
|
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  <span class="comment">// only the literal with a trail index smaller than the given one. Enqueues on</span></div>
|
|
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>  <span class="comment">// the trail any propagated literals.</span></div>
|
|
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>  <span class="comment">// Returns false if the preconditions described in</span></div>
|
|
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>  <span class="comment">// PbConstraints::AddConstraint() are not meet.</span></div>
|
|
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>  <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a40669a5dba9b3618272a2881174aee5c">InitializeRhs</a>(Coefficient rhs, <span class="keywordtype">int</span> trail_index, Coefficient* threshold,</div>
|
|
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>  <a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>* trail, <a class="code" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html">PbConstraintsEnqueueHelper</a>* helper);</div>
|
|
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>  </div>
|
|
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>  <span class="comment">// Tests for propagation and enqueues propagated literals on the trail.</span></div>
|
|
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>  <span class="comment">// Returns false if a conflict was detected, in which case conflict is filled.</span></div>
|
|
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>  <span class="comment">// Preconditions:</span></div>
|
|
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>  <span class="comment">// - For each "processed" literal, the given threshold value must have been</span></div>
|
|
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  <span class="comment">// decreased by its associated coefficient in the constraint. It must now</span></div>
|
|
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>  <span class="comment">// be stricly negative.</span></div>
|
|
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>  <span class="comment">// - The given trail_index is the index of a true literal in the trail which</span></div>
|
|
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>  <span class="comment">// just caused threshold to become stricly negative. All literals with</span></div>
|
|
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>  <span class="comment">// smaller index must have been "processed". All assigned literals with</span></div>
|
|
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>  <span class="comment">// greater trail index are not yet "processed".</span></div>
|
|
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>  <span class="comment">// The threshold is updated to its new value.</span></div>
|
|
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>  <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a1d503b84c8c90bca31afd5a89b6db0ba">Propagate</a>(<span class="keywordtype">int</span> trail_index, Coefficient* threshold, <a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>* trail,</div>
|
|
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>  <a class="code" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html">PbConstraintsEnqueueHelper</a>* helper);</div>
|
|
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>  </div>
|
|
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>  <span class="comment">// Updates the given threshold and the internal state. This is the opposite of</span></div>
|
|
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>  <span class="comment">// Propagate(). Each time a literal in unassigned, the threshold value must</span></div>
|
|
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>  <span class="comment">// have been increased by its coefficient. This update the threshold to its</span></div>
|
|
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span>  <span class="comment">// new value.</span></div>
|
|
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a63931731d764c40e4c80ec59a553a0f1">Untrail</a>(Coefficient* threshold, <span class="keywordtype">int</span> trail_index);</div>
|
|
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>  </div>
|
|
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>  <span class="comment">// Provided that the literal with given source_trail_index was the one that</span></div>
|
|
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>  <span class="comment">// propagated the conflict or the literal we wants to explain, then this will</span></div>
|
|
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>  <span class="comment">// compute the reason.</span></div>
|
|
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>  <span class="comment">// Some properties of the reason:</span></div>
|
|
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>  <span class="comment">// - Literals of level 0 are removed.</span></div>
|
|
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>  <span class="comment">// - It will always contain the literal with given source_trail_index (except</span></div>
|
|
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>  <span class="comment">// if it is of level 0).</span></div>
|
|
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>  <span class="comment">// - We make the reason more compact by greedily removing terms with small</span></div>
|
|
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>  <span class="comment">// coefficients that would not have changed the propagation.</span></div>
|
|
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>  <span class="comment">// TODO(user): Maybe it is possible to derive a better reason by using more</span></div>
|
|
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span>  <span class="comment">// information. For instance one could use the mask of literals that are</span></div>
|
|
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>  <span class="comment">// better to use during conflict minimization (namely the one already in the</span></div>
|
|
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>  <span class="comment">// 1-UIP conflict).</span></div>
|
|
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a2c809e3ff1236e74ebaaafb7864aca94">FillReason</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>& trail, <span class="keywordtype">int</span> source_trail_index,</div>
|
|
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>  BooleanVariable propagated_variable,</div>
|
|
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>  std::vector<Literal>* reason);</div>
|
|
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  </div>
|
|
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>  <span class="comment">// Same operation as SatSolver::ResolvePBConflict(), the only difference is</span></div>
|
|
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>  <span class="comment">// that here the reason for var is *this.</span></div>
|
|
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a40517ccc9af91f2423cb14c508371ba1">ResolvePBConflict</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>& trail, BooleanVariable <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>,</div>
|
|
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>  <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html">MutableUpperBoundedLinearConstraint</a>* conflict,</div>
|
|
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>  Coefficient* conflict_slack);</div>
|
|
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>  </div>
|
|
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>  <span class="comment">// Adds this pb constraint into the given mutable one.</span></div>
|
|
<div class="line"><a name="l00440"></a><span class="lineno"> 440</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>  <span class="comment">// TODO(user): Provides instead an easy to use iterator over an</span></div>
|
|
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>  <span class="comment">// UpperBoundedLinearConstraint and move this function to</span></div>
|
|
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>  <span class="comment">// MutableUpperBoundedLinearConstraint.</span></div>
|
|
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a79bc25526bc335587dd8b8c433d19306">AddToConflict</a>(<a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html">MutableUpperBoundedLinearConstraint</a>* conflict);</div>
|
|
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span>  </div>
|
|
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>  <span class="comment">// Compute the sum of the "cancelation" in AddTerm() if *this is added to</span></div>
|
|
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>  <span class="comment">// the given conflict. The sum doesn't take into account literal assigned with</span></div>
|
|
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>  <span class="comment">// a trail index smaller than the given one.</span></div>
|
|
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>  <span class="comment">// Note(user): Currently, this is only used in DCHECKs.</span></div>
|
|
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>  Coefficient <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a103f8fd98c381df722712e1782af52d4">ComputeCancelation</a>(</div>
|
|
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>  <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>& trail, <span class="keywordtype">int</span> trail_index,</div>
|
|
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>  <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html">MutableUpperBoundedLinearConstraint</a>& conflict);</div>
|
|
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span>  </div>
|
|
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>  <span class="comment">// API to mark a constraint for deletion before actually deleting it.</span></div>
|
|
<div class="line"><a name="l00456"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#ae232e8f1d65c7223588645585811d018"> 456</a></span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#ae232e8f1d65c7223588645585811d018">MarkForDeletion</a>() { is_marked_for_deletion_ = <span class="keyword">true</span>; }</div>
|
|
<div class="line"><a name="l00457"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#af5bdeba7aab357b3a8e987dc9c527856"> 457</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#af5bdeba7aab357b3a8e987dc9c527856">is_marked_for_deletion</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> is_marked_for_deletion_; }</div>
|
|
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>  </div>
|
|
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>  <span class="comment">// Only learned constraints are considered for deletion during the constraint</span></div>
|
|
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>  <span class="comment">// cleanup phase. We also can't delete variables used as a reason.</span></div>
|
|
<div class="line"><a name="l00461"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a27e53a30d14b2ece60bfbad8aca43cfb"> 461</a></span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a27e53a30d14b2ece60bfbad8aca43cfb">set_is_learned</a>(<span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a7e8ee12f0eae3b9e348b88e6675438d7">is_learned</a>) { is_learned_ = <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a7e8ee12f0eae3b9e348b88e6675438d7">is_learned</a>; }</div>
|
|
<div class="line"><a name="l00462"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a7e8ee12f0eae3b9e348b88e6675438d7"> 462</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a7e8ee12f0eae3b9e348b88e6675438d7">is_learned</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> is_learned_; }</div>
|
|
<div class="line"><a name="l00463"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#ac05fae50934252485d3b8addda1e0695"> 463</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#ac05fae50934252485d3b8addda1e0695">is_used_as_a_reason</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> first_reason_trail_index_ != -1; }</div>
|
|
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span>  </div>
|
|
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>  <span class="comment">// Activity of the constraint. Only low activity constraint will be deleted</span></div>
|
|
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span>  <span class="comment">// during the constraint cleanup phase.</span></div>
|
|
<div class="line"><a name="l00467"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a033e8db16a2a7516bc261c80d1e6ed0f"> 467</a></span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a033e8db16a2a7516bc261c80d1e6ed0f">set_activity</a>(<span class="keywordtype">double</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#add3bd69a358a7351a31f0a12a4bf16b0">activity</a>) { activity_ = <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#add3bd69a358a7351a31f0a12a4bf16b0">activity</a>; }</div>
|
|
<div class="line"><a name="l00468"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#add3bd69a358a7351a31f0a12a4bf16b0"> 468</a></span>  <span class="keywordtype">double</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#add3bd69a358a7351a31f0a12a4bf16b0">activity</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> activity_; }</div>
|
|
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>  </div>
|
|
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span>  <span class="comment">// Returns a fingerprint of the constraint linear expression (without rhs).</span></div>
|
|
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>  <span class="comment">// This is used for duplicate detection.</span></div>
|
|
<div class="line"><a name="l00472"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#ac9bb5e79c2e9a44957f5b14c94f5101d"> 472</a></span>  <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#ac9bb5e79c2e9a44957f5b14c94f5101d">hash</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> hash_; }</div>
|
|
<div class="line"><a name="l00473"></a><span class="lineno"> 473</span>  </div>
|
|
<div class="line"><a name="l00474"></a><span class="lineno"> 474</span>  <span class="comment">// This is used to get statistics of the number of literals inspected by</span></div>
|
|
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>  <span class="comment">// a Propagate() call.</span></div>
|
|
<div class="line"><a name="l00476"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a5f65c8b6b41bb6b090435d4aa3d7d30b"> 476</a></span>  <span class="keywordtype">int</span> <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a5f65c8b6b41bb6b090435d4aa3d7d30b">already_propagated_end</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> already_propagated_end_; }</div>
|
|
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span>  </div>
|
|
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>  <span class="keyword">private</span>:</div>
|
|
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>  Coefficient GetSlackFromThreshold(Coefficient threshold) {</div>
|
|
<div class="line"><a name="l00480"></a><span class="lineno"> 480</span>  <span class="keywordflow">return</span> (index_ < 0) ? threshold : coeffs_[index_] + threshold;</div>
|
|
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span>  }</div>
|
|
<div class="line"><a name="l00482"></a><span class="lineno"> 482</span>  <span class="keywordtype">void</span> Update(Coefficient slack, Coefficient* threshold) {</div>
|
|
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>  *threshold = (index_ < 0) ? slack : slack - coeffs_[index_];</div>
|
|
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>  already_propagated_end_ = starts_[index_ + 1];</div>
|
|
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>  }</div>
|
|
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span>  </div>
|
|
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span>  <span class="comment">// Constraint management fields.</span></div>
|
|
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>  <span class="comment">// TODO(user): Rearrange and specify bit size to minimize memory usage.</span></div>
|
|
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>  <span class="keywordtype">bool</span> is_marked_for_deletion_;</div>
|
|
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span>  <span class="keywordtype">bool</span> is_learned_;</div>
|
|
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>  <span class="keywordtype">int</span> first_reason_trail_index_;</div>
|
|
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span>  <span class="keywordtype">double</span> activity_;</div>
|
|
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span>  </div>
|
|
<div class="line"><a name="l00494"></a><span class="lineno"> 494</span>  <span class="comment">// Constraint propagation fields.</span></div>
|
|
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>  <span class="keywordtype">int</span> index_;</div>
|
|
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span>  <span class="keywordtype">int</span> already_propagated_end_;</div>
|
|
<div class="line"><a name="l00497"></a><span class="lineno"> 497</span>  </div>
|
|
<div class="line"><a name="l00498"></a><span class="lineno"> 498</span>  <span class="comment">// In the internal representation, we merge the terms with the same</span></div>
|
|
<div class="line"><a name="l00499"></a><span class="lineno"> 499</span>  <span class="comment">// coefficient.</span></div>
|
|
<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>  <span class="comment">// - literals_ contains all the literal of the constraint sorted by</span></div>
|
|
<div class="line"><a name="l00501"></a><span class="lineno"> 501</span>  <span class="comment">// increasing coefficients.</span></div>
|
|
<div class="line"><a name="l00502"></a><span class="lineno"> 502</span>  <span class="comment">// - coeffs_ contains unique increasing coefficients.</span></div>
|
|
<div class="line"><a name="l00503"></a><span class="lineno"> 503</span>  <span class="comment">// - starts_[i] is the index in literals_ of the first literal with</span></div>
|
|
<div class="line"><a name="l00504"></a><span class="lineno"> 504</span>  <span class="comment">// coefficient coeffs_[i].</span></div>
|
|
<div class="line"><a name="l00505"></a><span class="lineno"> 505</span>  std::vector<Coefficient> coeffs_;</div>
|
|
<div class="line"><a name="l00506"></a><span class="lineno"> 506</span>  std::vector<int> starts_;</div>
|
|
<div class="line"><a name="l00507"></a><span class="lineno"> 507</span>  std::vector<Literal> literals_;</div>
|
|
<div class="line"><a name="l00508"></a><span class="lineno"> 508</span>  Coefficient rhs_;</div>
|
|
<div class="line"><a name="l00509"></a><span class="lineno"> 509</span>  </div>
|
|
<div class="line"><a name="l00510"></a><span class="lineno"> 510</span>  <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> hash_;</div>
|
|
<div class="line"><a name="l00511"></a><span class="lineno"> 511</span> };</div>
|
|
<div class="line"><a name="l00512"></a><span class="lineno"> 512</span>  </div>
|
|
<div class="line"><a name="l00513"></a><span class="lineno"> 513</span> <span class="comment">// Class responsible for managing a set of pseudo-Boolean constraints and their</span></div>
|
|
<div class="line"><a name="l00514"></a><span class="lineno"> 514</span> <span class="comment">// propagation.</span></div>
|
|
<div class="line"><a name="l00515"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_pb_constraints.html"> 515</a></span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html">PbConstraints</a> : <span class="keyword">public</span> <a class="code" href="classoperations__research_1_1sat_1_1_sat_propagator.html">SatPropagator</a> {</div>
|
|
<div class="line"><a name="l00516"></a><span class="lineno"> 516</span>  <span class="keyword">public</span>:</div>
|
|
<div class="line"><a name="l00517"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_pb_constraints.html#aaef19c229ed09dad5e49d53096e7be46"> 517</a></span>  <span class="keyword">explicit</span> <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#aaef19c229ed09dad5e49d53096e7be46">PbConstraints</a>(<a class="code" href="classoperations__research_1_1sat_1_1_model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>)</div>
|
|
<div class="line"><a name="l00518"></a><span class="lineno"> 518</span>  : <a class="code" href="classoperations__research_1_1sat_1_1_sat_propagator.html">SatPropagator</a>(<span class="stringliteral">"PbConstraints"</span>),</div>
|
|
<div class="line"><a name="l00519"></a><span class="lineno"> 519</span>  conflicting_constraint_index_(-1),</div>
|
|
<div class="line"><a name="l00520"></a><span class="lineno"> 520</span>  num_learned_constraint_before_cleanup_(0),</div>
|
|
<div class="line"><a name="l00521"></a><span class="lineno"> 521</span>  constraint_activity_increment_(1.0),</div>
|
|
<div class="line"><a name="l00522"></a><span class="lineno"> 522</span>  parameters_(<a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>->GetOrCreate<SatParameters>()),</div>
|
|
<div class="line"><a name="l00523"></a><span class="lineno"> 523</span>  stats_(<span class="stringliteral">"PbConstraints"</span>),</div>
|
|
<div class="line"><a name="l00524"></a><span class="lineno"> 524</span>  num_constraint_lookups_(0),</div>
|
|
<div class="line"><a name="l00525"></a><span class="lineno"> 525</span>  num_inspected_constraint_literals_(0),</div>
|
|
<div class="line"><a name="l00526"></a><span class="lineno"> 526</span>  num_threshold_updates_(0) {</div>
|
|
<div class="line"><a name="l00527"></a><span class="lineno"> 527</span>  <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>->GetOrCreate<<a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>>()->RegisterPropagator(<span class="keyword">this</span>);</div>
|
|
<div class="line"><a name="l00528"></a><span class="lineno"> 528</span>  }</div>
|
|
<div class="line"><a name="l00529"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a22d7b8d009ec7b8ccef8cd662d4bac7e"> 529</a></span>  <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a22d7b8d009ec7b8ccef8cd662d4bac7e">~PbConstraints</a>()<span class="keyword"> override </span>{</div>
|
|
<div class="line"><a name="l00530"></a><span class="lineno"> 530</span>  <a class="code" href="stats_8h.html#a3c3e6b102f0d91c523099325c98e1887">IF_STATS_ENABLED</a>({</div>
|
|
<div class="line"><a name="l00531"></a><span class="lineno"> 531</span>  LOG(INFO) << stats_.<a class="code" href="classoperations__research_1_1_stats_group.html#af9bc435481ae9e6e60d66a65d5394a7f">StatString</a>();</div>
|
|
<div class="line"><a name="l00532"></a><span class="lineno"> 532</span>  LOG(INFO) << <span class="stringliteral">"num_constraint_lookups_: "</span> << num_constraint_lookups_;</div>
|
|
<div class="line"><a name="l00533"></a><span class="lineno"> 533</span>  LOG(INFO) << <span class="stringliteral">"num_threshold_updates_: "</span> << num_threshold_updates_;</div>
|
|
<div class="line"><a name="l00534"></a><span class="lineno"> 534</span>  });</div>
|
|
<div class="line"><a name="l00535"></a><span class="lineno"> 535</span>  }</div>
|
|
<div class="line"><a name="l00536"></a><span class="lineno"> 536</span>  </div>
|
|
<div class="line"><a name="l00537"></a><span class="lineno"> 537</span>  <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a1f591be5334541874ba049873235f0a9">Propagate</a>(<a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>* trail) <span class="keyword">final</span>;</div>
|
|
<div class="line"><a name="l00538"></a><span class="lineno"> 538</span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#ae20e3965a974e3a5fe816c033a94e568">Untrail</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>& trail, <span class="keywordtype">int</span> trail_index) <span class="keyword">final</span>;</div>
|
|
<div class="line"><a name="l00539"></a><span class="lineno"> 539</span>  absl::Span<const Literal> <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a5aa25e6e306c7158c11d2053170379a2">Reason</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>& trail,</div>
|
|
<div class="line"><a name="l00540"></a><span class="lineno"> 540</span>  <span class="keywordtype">int</span> trail_index) <span class="keyword">const</span> <span class="keyword">final</span>;</div>
|
|
<div class="line"><a name="l00541"></a><span class="lineno"> 541</span>  </div>
|
|
<div class="line"><a name="l00542"></a><span class="lineno"> 542</span>  <span class="comment">// Changes the number of variables.</span></div>
|
|
<div class="line"><a name="l00543"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_pb_constraints.html#af7fbbd00f0e631ce361b5ce6636b2017"> 543</a></span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#af7fbbd00f0e631ce361b5ce6636b2017">Resize</a>(<span class="keywordtype">int</span> num_variables) {</div>
|
|
<div class="line"><a name="l00544"></a><span class="lineno"> 544</span>  <span class="comment">// Note that we avoid using up memory in the common case where there are no</span></div>
|
|
<div class="line"><a name="l00545"></a><span class="lineno"> 545</span>  <span class="comment">// pb constraints at all. If there is 10 million variables, this vector</span></div>
|
|
<div class="line"><a name="l00546"></a><span class="lineno"> 546</span>  <span class="comment">// alone will take 480 MB!</span></div>
|
|
<div class="line"><a name="l00547"></a><span class="lineno"> 547</span>  <span class="keywordflow">if</span> (!constraints_.empty()) {</div>
|
|
<div class="line"><a name="l00548"></a><span class="lineno"> 548</span>  to_update_.<a class="code" href="classgtl_1_1_i_t_i_vector.html#a4e3670a285a3642eaa07f66766cffa72">resize</a>(num_variables << 1);</div>
|
|
<div class="line"><a name="l00549"></a><span class="lineno"> 549</span>  enqueue_helper_.<a class="code" href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html#a2b537e8bba9403eef4d626a7a8b921a1">reasons</a>.resize(num_variables);</div>
|
|
<div class="line"><a name="l00550"></a><span class="lineno"> 550</span>  }</div>
|
|
<div class="line"><a name="l00551"></a><span class="lineno"> 551</span>  }</div>
|
|
<div class="line"><a name="l00552"></a><span class="lineno"> 552</span>  </div>
|
|
<div class="line"><a name="l00553"></a><span class="lineno"> 553</span>  <span class="comment">// Adds a constraint in canonical form to the set of managed constraints. Note</span></div>
|
|
<div class="line"><a name="l00554"></a><span class="lineno"> 554</span>  <span class="comment">// that this detects constraints with exactly the same terms. In this case,</span></div>
|
|
<div class="line"><a name="l00555"></a><span class="lineno"> 555</span>  <span class="comment">// the constraint rhs is updated if the new one is lower or nothing is done</span></div>
|
|
<div class="line"><a name="l00556"></a><span class="lineno"> 556</span>  <span class="comment">// otherwise.</span></div>
|
|
<div class="line"><a name="l00557"></a><span class="lineno"> 557</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00558"></a><span class="lineno"> 558</span>  <span class="comment">// There are some preconditions, and the function will return false if they</span></div>
|
|
<div class="line"><a name="l00559"></a><span class="lineno"> 559</span>  <span class="comment">// are not met. The constraint can be added when the trail is not empty,</span></div>
|
|
<div class="line"><a name="l00560"></a><span class="lineno"> 560</span>  <span class="comment">// however given the current propagated assignment:</span></div>
|
|
<div class="line"><a name="l00561"></a><span class="lineno"> 561</span>  <span class="comment">// - The constraint cannot be conflicting.</span></div>
|
|
<div class="line"><a name="l00562"></a><span class="lineno"> 562</span>  <span class="comment">// - The constraint cannot have propagated at an earlier decision level.</span></div>
|
|
<div class="line"><a name="l00563"></a><span class="lineno"> 563</span>  <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a668f93c96cd8a83dd4bf3da35ba8b7b0">AddConstraint</a>(<span class="keyword">const</span> std::vector<LiteralWithCoeff>& cst, Coefficient rhs,</div>
|
|
<div class="line"><a name="l00564"></a><span class="lineno"> 564</span>  <a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>* trail);</div>
|
|
<div class="line"><a name="l00565"></a><span class="lineno"> 565</span>  </div>
|
|
<div class="line"><a name="l00566"></a><span class="lineno"> 566</span>  <span class="comment">// Same as AddConstraint(), but also marks the added constraint as learned</span></div>
|
|
<div class="line"><a name="l00567"></a><span class="lineno"> 567</span>  <span class="comment">// so that it can be deleted during the constraint cleanup phase.</span></div>
|
|
<div class="line"><a name="l00568"></a><span class="lineno"> 568</span>  <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#afea0121eba5886052ba91716acf7f29f">AddLearnedConstraint</a>(<span class="keyword">const</span> std::vector<LiteralWithCoeff>& cst,</div>
|
|
<div class="line"><a name="l00569"></a><span class="lineno"> 569</span>  Coefficient rhs, <a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>* trail);</div>
|
|
<div class="line"><a name="l00570"></a><span class="lineno"> 570</span>  </div>
|
|
<div class="line"><a name="l00571"></a><span class="lineno"> 571</span>  <span class="comment">// Returns the number of constraints managed by this class.</span></div>
|
|
<div class="line"><a name="l00572"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a18ab319435ed80315e0c35ca40a7c2a0"> 572</a></span>  <span class="keywordtype">int</span> <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a18ab319435ed80315e0c35ca40a7c2a0">NumberOfConstraints</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> constraints_.size(); }</div>
|
|
<div class="line"><a name="l00573"></a><span class="lineno"> 573</span>  </div>
|
|
<div class="line"><a name="l00574"></a><span class="lineno"> 574</span>  <span class="comment">// ConflictingConstraint() returns the last PB constraint that caused a</span></div>
|
|
<div class="line"><a name="l00575"></a><span class="lineno"> 575</span>  <span class="comment">// conflict. Calling ClearConflictingConstraint() reset this to nullptr.</span></div>
|
|
<div class="line"><a name="l00576"></a><span class="lineno"> 576</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00577"></a><span class="lineno"> 577</span>  <span class="comment">// TODO(user): This is a hack to get the PB conflict, because the rest of</span></div>
|
|
<div class="line"><a name="l00578"></a><span class="lineno"> 578</span>  <span class="comment">// the solver API assume only clause conflict. Find a cleaner way?</span></div>
|
|
<div class="line"><a name="l00579"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a5116e268e9144cf6ee197450e0eda486"> 579</a></span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a5116e268e9144cf6ee197450e0eda486">ClearConflictingConstraint</a>() { conflicting_constraint_index_ = -1; }</div>
|
|
<div class="line"><a name="l00580"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_pb_constraints.html#aa3bdbedb1d2e7db11727770605cee8cc"> 580</a></span>  <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html">UpperBoundedLinearConstraint</a>* <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#aa3bdbedb1d2e7db11727770605cee8cc">ConflictingConstraint</a>() {</div>
|
|
<div class="line"><a name="l00581"></a><span class="lineno"> 581</span>  <span class="keywordflow">if</span> (conflicting_constraint_index_ == -1) <span class="keywordflow">return</span> <span class="keyword">nullptr</span>;</div>
|
|
<div class="line"><a name="l00582"></a><span class="lineno"> 582</span>  <span class="keywordflow">return</span> constraints_[conflicting_constraint_index_.value()].get();</div>
|
|
<div class="line"><a name="l00583"></a><span class="lineno"> 583</span>  }</div>
|
|
<div class="line"><a name="l00584"></a><span class="lineno"> 584</span>  </div>
|
|
<div class="line"><a name="l00585"></a><span class="lineno"> 585</span>  <span class="comment">// Returns the underlying UpperBoundedLinearConstraint responsible for</span></div>
|
|
<div class="line"><a name="l00586"></a><span class="lineno"> 586</span>  <span class="comment">// assigning the literal at given trail index.</span></div>
|
|
<div class="line"><a name="l00587"></a><span class="lineno"> 587</span>  <a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html">UpperBoundedLinearConstraint</a>* <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#ab00d5c5d5edf37a9568363ba39e02c11">ReasonPbConstraint</a>(<span class="keywordtype">int</span> trail_index) <span class="keyword">const</span>;</div>
|
|
<div class="line"><a name="l00588"></a><span class="lineno"> 588</span>  </div>
|
|
<div class="line"><a name="l00589"></a><span class="lineno"> 589</span>  <span class="comment">// Activity update functions.</span></div>
|
|
<div class="line"><a name="l00590"></a><span class="lineno"> 590</span>  <span class="comment">// TODO(user): Remove duplication with other activity update functions.</span></div>
|
|
<div class="line"><a name="l00591"></a><span class="lineno"> 591</span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#ae087fb0f8731e64e65fb00e517fe8966">BumpActivity</a>(<a class="code" href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html">UpperBoundedLinearConstraint</a>* constraint);</div>
|
|
<div class="line"><a name="l00592"></a><span class="lineno"> 592</span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a2aab5f0b8a516d308939c4cad97fc634">RescaleActivities</a>(<span class="keywordtype">double</span> scaling_factor);</div>
|
|
<div class="line"><a name="l00593"></a><span class="lineno"> 593</span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#ad064f7982ad8af720e437b82380b629f">UpdateActivityIncrement</a>();</div>
|
|
<div class="line"><a name="l00594"></a><span class="lineno"> 594</span>  </div>
|
|
<div class="line"><a name="l00595"></a><span class="lineno"> 595</span>  <span class="comment">// Only used for testing.</span></div>
|
|
<div class="line"><a name="l00596"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a9bea7e159036a792452a1ef3d7d45c8b"> 596</a></span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a9bea7e159036a792452a1ef3d7d45c8b">DeleteConstraint</a>(<span class="keywordtype">int</span> <a class="code" href="pack_8cc.html#a750b5d744c39a06bfb13e6eb010e35d0">index</a>) {</div>
|
|
<div class="line"><a name="l00597"></a><span class="lineno"> 597</span>  constraints_[<a class="code" href="pack_8cc.html#a750b5d744c39a06bfb13e6eb010e35d0">index</a>]->MarkForDeletion();</div>
|
|
<div class="line"><a name="l00598"></a><span class="lineno"> 598</span>  DeleteConstraintMarkedForDeletion();</div>
|
|
<div class="line"><a name="l00599"></a><span class="lineno"> 599</span>  }</div>
|
|
<div class="line"><a name="l00600"></a><span class="lineno"> 600</span>  </div>
|
|
<div class="line"><a name="l00601"></a><span class="lineno"> 601</span>  <span class="comment">// Some statistics.</span></div>
|
|
<div class="line"><a name="l00602"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a991506896584b01b214102ac3ed2ddb5"> 602</a></span>  <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a991506896584b01b214102ac3ed2ddb5">num_constraint_lookups</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> num_constraint_lookups_; }</div>
|
|
<div class="line"><a name="l00603"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a9699443a7a311c163aa4ef9990f493a4"> 603</a></span>  <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a9699443a7a311c163aa4ef9990f493a4">num_inspected_constraint_literals</a>()<span class="keyword"> const </span>{</div>
|
|
<div class="line"><a name="l00604"></a><span class="lineno"> 604</span>  <span class="keywordflow">return</span> num_inspected_constraint_literals_;</div>
|
|
<div class="line"><a name="l00605"></a><span class="lineno"> 605</span>  }</div>
|
|
<div class="line"><a name="l00606"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a31db3a3e839ea89186d44f0f3025f506"> 606</a></span>  <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> <a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#a31db3a3e839ea89186d44f0f3025f506">num_threshold_updates</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> num_threshold_updates_; }</div>
|
|
<div class="line"><a name="l00607"></a><span class="lineno"> 607</span>  </div>
|
|
<div class="line"><a name="l00608"></a><span class="lineno"> 608</span>  <span class="keyword">private</span>:</div>
|
|
<div class="line"><a name="l00609"></a><span class="lineno"> 609</span>  <span class="keywordtype">bool</span> PropagateNext(<a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>* trail);</div>
|
|
<div class="line"><a name="l00610"></a><span class="lineno"> 610</span>  </div>
|
|
<div class="line"><a name="l00611"></a><span class="lineno"> 611</span>  <span class="comment">// Same function as the clause related one is SatSolver().</span></div>
|
|
<div class="line"><a name="l00612"></a><span class="lineno"> 612</span>  <span class="comment">// TODO(user): Remove duplication.</span></div>
|
|
<div class="line"><a name="l00613"></a><span class="lineno"> 613</span>  <span class="keywordtype">void</span> ComputeNewLearnedConstraintLimit();</div>
|
|
<div class="line"><a name="l00614"></a><span class="lineno"> 614</span>  <span class="keywordtype">void</span> DeleteSomeLearnedConstraintIfNeeded();</div>
|
|
<div class="line"><a name="l00615"></a><span class="lineno"> 615</span>  </div>
|
|
<div class="line"><a name="l00616"></a><span class="lineno"> 616</span>  <span class="comment">// Deletes all the UpperBoundedLinearConstraint for which</span></div>
|
|
<div class="line"><a name="l00617"></a><span class="lineno"> 617</span>  <span class="comment">// is_marked_for_deletion() is true. This is relatively slow in O(number of</span></div>
|
|
<div class="line"><a name="l00618"></a><span class="lineno"> 618</span>  <span class="comment">// terms in all constraints).</span></div>
|
|
<div class="line"><a name="l00619"></a><span class="lineno"> 619</span>  <span class="keywordtype">void</span> DeleteConstraintMarkedForDeletion();</div>
|
|
<div class="line"><a name="l00620"></a><span class="lineno"> 620</span>  </div>
|
|
<div class="line"><a name="l00621"></a><span class="lineno"> 621</span>  <span class="comment">// Each constraint managed by this class is associated with an index.</span></div>
|
|
<div class="line"><a name="l00622"></a><span class="lineno"> 622</span>  <span class="comment">// The set of indices is always [0, num_constraints_).</span></div>
|
|
<div class="line"><a name="l00623"></a><span class="lineno"> 623</span>  <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00624"></a><span class="lineno"> 624</span>  <span class="comment">// Note(user): this complicate things during deletion, but the propagation is</span></div>
|
|
<div class="line"><a name="l00625"></a><span class="lineno"> 625</span>  <span class="comment">// about two times faster with this implementation than one with direct</span></div>
|
|
<div class="line"><a name="l00626"></a><span class="lineno"> 626</span>  <span class="comment">// pointer to an UpperBoundedLinearConstraint. The main reason for this is</span></div>
|
|
<div class="line"><a name="l00627"></a><span class="lineno"> 627</span>  <span class="comment">// probably that the thresholds_ vector is a lot more efficient cache-wise.</span></div>
|
|
<div class="line"><a name="l00628"></a><span class="lineno"> 628</span>  DEFINE_INT_TYPE(ConstraintIndex, <a class="code" href="integral__types_8h.html#a56f1a81c92849566ae864511088eb7e8">int32</a>);</div>
|
|
<div class="line"><a name="l00629"></a><span class="lineno"> 629</span>  <span class="keyword">struct </span>ConstraintIndexWithCoeff {</div>
|
|
<div class="line"><a name="l00630"></a><span class="lineno"> 630</span>  ConstraintIndexWithCoeff() {} <span class="comment">// Needed for vector.resize()</span></div>
|
|
<div class="line"><a name="l00631"></a><span class="lineno"> 631</span>  ConstraintIndexWithCoeff(<span class="keywordtype">bool</span> n, ConstraintIndex i, Coefficient c)</div>
|
|
<div class="line"><a name="l00632"></a><span class="lineno"> 632</span>  : need_untrail_inspection(n), <a class="code" href="pack_8cc.html#a750b5d744c39a06bfb13e6eb010e35d0">index</a>(i), <a class="code" href="routing__search_8cc.html#ab66ad179c8a6fcf1adb958cb51f4c7cb">coefficient</a>(c) {}</div>
|
|
<div class="line"><a name="l00633"></a><span class="lineno"> 633</span>  <span class="keywordtype">bool</span> need_untrail_inspection;</div>
|
|
<div class="line"><a name="l00634"></a><span class="lineno"> 634</span>  ConstraintIndex <a class="code" href="pack_8cc.html#a750b5d744c39a06bfb13e6eb010e35d0">index</a>;</div>
|
|
<div class="line"><a name="l00635"></a><span class="lineno"> 635</span>  Coefficient <a class="code" href="routing__search_8cc.html#ab66ad179c8a6fcf1adb958cb51f4c7cb">coefficient</a>;</div>
|
|
<div class="line"><a name="l00636"></a><span class="lineno"> 636</span>  };</div>
|
|
<div class="line"><a name="l00637"></a><span class="lineno"> 637</span>  </div>
|
|
<div class="line"><a name="l00638"></a><span class="lineno"> 638</span>  <span class="comment">// The set of all pseudo-boolean constraint managed by this class.</span></div>
|
|
<div class="line"><a name="l00639"></a><span class="lineno"> 639</span>  std::vector<std::unique_ptr<UpperBoundedLinearConstraint>> constraints_;</div>
|
|
<div class="line"><a name="l00640"></a><span class="lineno"> 640</span>  </div>
|
|
<div class="line"><a name="l00641"></a><span class="lineno"> 641</span>  <span class="comment">// The current value of the threshold for each constraints.</span></div>
|
|
<div class="line"><a name="l00642"></a><span class="lineno"> 642</span>  <a class="code" href="classgtl_1_1_i_t_i_vector.html">gtl::ITIVector<ConstraintIndex, Coefficient></a> thresholds_;</div>
|
|
<div class="line"><a name="l00643"></a><span class="lineno"> 643</span>  </div>
|
|
<div class="line"><a name="l00644"></a><span class="lineno"> 644</span>  <span class="comment">// For each literal, the list of all the constraints that contains it together</span></div>
|
|
<div class="line"><a name="l00645"></a><span class="lineno"> 645</span>  <span class="comment">// with the literal coefficient in these constraints.</span></div>
|
|
<div class="line"><a name="l00646"></a><span class="lineno"> 646</span>  <a class="code" href="classgtl_1_1_i_t_i_vector.html">gtl::ITIVector<LiteralIndex, std::vector<ConstraintIndexWithCoeff></a>></div>
|
|
<div class="line"><a name="l00647"></a><span class="lineno"> 647</span>  to_update_;</div>
|
|
<div class="line"><a name="l00648"></a><span class="lineno"> 648</span>  </div>
|
|
<div class="line"><a name="l00649"></a><span class="lineno"> 649</span>  <span class="comment">// Bitset used to optimize the Untrail() function.</span></div>
|
|
<div class="line"><a name="l00650"></a><span class="lineno"> 650</span>  SparseBitset<ConstraintIndex> to_untrail_;</div>
|
|
<div class="line"><a name="l00651"></a><span class="lineno"> 651</span>  </div>
|
|
<div class="line"><a name="l00652"></a><span class="lineno"> 652</span>  <span class="comment">// Pointers to the constraints grouped by their hash.</span></div>
|
|
<div class="line"><a name="l00653"></a><span class="lineno"> 653</span>  <span class="comment">// This is used to find duplicate constraints by AddConstraint().</span></div>
|
|
<div class="line"><a name="l00654"></a><span class="lineno"> 654</span>  absl::flat_hash_map<int64, std::vector<UpperBoundedLinearConstraint*>></div>
|
|
<div class="line"><a name="l00655"></a><span class="lineno"> 655</span>  possible_duplicates_;</div>
|
|
<div class="line"><a name="l00656"></a><span class="lineno"> 656</span>  </div>
|
|
<div class="line"><a name="l00657"></a><span class="lineno"> 657</span>  <span class="comment">// Helper to enqueue propagated literals on the trail and store their reasons.</span></div>
|
|
<div class="line"><a name="l00658"></a><span class="lineno"> 658</span>  PbConstraintsEnqueueHelper enqueue_helper_;</div>
|
|
<div class="line"><a name="l00659"></a><span class="lineno"> 659</span>  </div>
|
|
<div class="line"><a name="l00660"></a><span class="lineno"> 660</span>  <span class="comment">// Last conflicting PB constraint index. This is reset to -1 when</span></div>
|
|
<div class="line"><a name="l00661"></a><span class="lineno"> 661</span>  <span class="comment">// ClearConflictingConstraint() is called.</span></div>
|
|
<div class="line"><a name="l00662"></a><span class="lineno"> 662</span>  ConstraintIndex conflicting_constraint_index_;</div>
|
|
<div class="line"><a name="l00663"></a><span class="lineno"> 663</span>  </div>
|
|
<div class="line"><a name="l00664"></a><span class="lineno"> 664</span>  <span class="comment">// Used for the constraint cleaning policy.</span></div>
|
|
<div class="line"><a name="l00665"></a><span class="lineno"> 665</span>  <span class="keywordtype">int</span> target_number_of_learned_constraint_;</div>
|
|
<div class="line"><a name="l00666"></a><span class="lineno"> 666</span>  <span class="keywordtype">int</span> num_learned_constraint_before_cleanup_;</div>
|
|
<div class="line"><a name="l00667"></a><span class="lineno"> 667</span>  <span class="keywordtype">double</span> constraint_activity_increment_;</div>
|
|
<div class="line"><a name="l00668"></a><span class="lineno"> 668</span>  </div>
|
|
<div class="line"><a name="l00669"></a><span class="lineno"> 669</span>  <span class="comment">// Algorithm parameters.</span></div>
|
|
<div class="line"><a name="l00670"></a><span class="lineno"> 670</span>  SatParameters* parameters_;</div>
|
|
<div class="line"><a name="l00671"></a><span class="lineno"> 671</span>  </div>
|
|
<div class="line"><a name="l00672"></a><span class="lineno"> 672</span>  <span class="comment">// Some statistics.</span></div>
|
|
<div class="line"><a name="l00673"></a><span class="lineno"> 673</span>  <span class="keyword">mutable</span> StatsGroup stats_;</div>
|
|
<div class="line"><a name="l00674"></a><span class="lineno"> 674</span>  <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> num_constraint_lookups_;</div>
|
|
<div class="line"><a name="l00675"></a><span class="lineno"> 675</span>  <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> num_inspected_constraint_literals_;</div>
|
|
<div class="line"><a name="l00676"></a><span class="lineno"> 676</span>  <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> num_threshold_updates_;</div>
|
|
<div class="line"><a name="l00677"></a><span class="lineno"> 677</span>  DISALLOW_COPY_AND_ASSIGN(<a class="code" href="classoperations__research_1_1sat_1_1_pb_constraints.html#aaef19c229ed09dad5e49d53096e7be46">PbConstraints</a>);</div>
|
|
<div class="line"><a name="l00678"></a><span class="lineno"> 678</span> };</div>
|
|
<div class="line"><a name="l00679"></a><span class="lineno"> 679</span>  </div>
|
|
<div class="line"><a name="l00680"></a><span class="lineno"> 680</span> <span class="comment">// Boolean linear constraints can propagate a lot of literals at the same time.</span></div>
|
|
<div class="line"><a name="l00681"></a><span class="lineno"> 681</span> <span class="comment">// As a result, all these literals will have exactly the same reason. It is</span></div>
|
|
<div class="line"><a name="l00682"></a><span class="lineno"> 682</span> <span class="comment">// important to take advantage of that during the conflict</span></div>
|
|
<div class="line"><a name="l00683"></a><span class="lineno"> 683</span> <span class="comment">// computation/minimization. On some problem, this can have a huge impact.</span></div>
|
|
<div class="line"><a name="l00684"></a><span class="lineno"> 684</span> <span class="comment">//</span></div>
|
|
<div class="line"><a name="l00685"></a><span class="lineno"> 685</span> <span class="comment">// TODO(user): With the new SAME_REASON_AS mechanism, this is more general so</span></div>
|
|
<div class="line"><a name="l00686"></a><span class="lineno"> 686</span> <span class="comment">// move out of pb_constraint.</span></div>
|
|
<div class="line"><a name="l00687"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_variable_with_same_reason_identifier.html"> 687</a></span> <span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1_variable_with_same_reason_identifier.html">VariableWithSameReasonIdentifier</a> {</div>
|
|
<div class="line"><a name="l00688"></a><span class="lineno"> 688</span>  <span class="keyword">public</span>:</div>
|
|
<div class="line"><a name="l00689"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_variable_with_same_reason_identifier.html#aa687d6493ab5b27058da0667efaeccdd"> 689</a></span>  <span class="keyword">explicit</span> <a class="code" href="classoperations__research_1_1sat_1_1_variable_with_same_reason_identifier.html#aa687d6493ab5b27058da0667efaeccdd">VariableWithSameReasonIdentifier</a>(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>& trail)</div>
|
|
<div class="line"><a name="l00690"></a><span class="lineno"> 690</span>  : trail_(trail) {}</div>
|
|
<div class="line"><a name="l00691"></a><span class="lineno"> 691</span>  </div>
|
|
<div class="line"><a name="l00692"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_variable_with_same_reason_identifier.html#af7fbbd00f0e631ce361b5ce6636b2017"> 692</a></span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_variable_with_same_reason_identifier.html#af7fbbd00f0e631ce361b5ce6636b2017">Resize</a>(<span class="keywordtype">int</span> num_variables) {</div>
|
|
<div class="line"><a name="l00693"></a><span class="lineno"> 693</span>  first_variable_.<a class="code" href="classgtl_1_1_i_t_i_vector.html#a4e3670a285a3642eaa07f66766cffa72">resize</a>(num_variables);</div>
|
|
<div class="line"><a name="l00694"></a><span class="lineno"> 694</span>  seen_.<a class="code" href="classoperations__research_1_1_sparse_bitset.html#ae09e38958e558d2c776bc555a0dc2fc7">ClearAndResize</a>(BooleanVariable(num_variables));</div>
|
|
<div class="line"><a name="l00695"></a><span class="lineno"> 695</span>  }</div>
|
|
<div class="line"><a name="l00696"></a><span class="lineno"> 696</span>  </div>
|
|
<div class="line"><a name="l00697"></a><span class="lineno"> 697</span>  <span class="comment">// Clears the cache. Call this before each conflict analysis.</span></div>
|
|
<div class="line"><a name="l00698"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_variable_with_same_reason_identifier.html#aa71d36872f416feaa853788a7a7a7ef8"> 698</a></span>  <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_variable_with_same_reason_identifier.html#aa71d36872f416feaa853788a7a7a7ef8">Clear</a>() { seen_.<a class="code" href="classoperations__research_1_1_sparse_bitset.html#aa7d76b766faf39c1652b6617eac5fe20">ClearAll</a>(); }</div>
|
|
<div class="line"><a name="l00699"></a><span class="lineno"> 699</span>  </div>
|
|
<div class="line"><a name="l00700"></a><span class="lineno"> 700</span>  <span class="comment">// Returns the first variable with exactly the same reason as 'var' on which</span></div>
|
|
<div class="line"><a name="l00701"></a><span class="lineno"> 701</span>  <span class="comment">// this function was called since the last Clear(). Note that if no variable</span></div>
|
|
<div class="line"><a name="l00702"></a><span class="lineno"> 702</span>  <span class="comment">// had the same reason, then var is returned.</span></div>
|
|
<div class="line"><a name="l00703"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_variable_with_same_reason_identifier.html#a85a00c2877e3b249951022638dda5642"> 703</a></span>  BooleanVariable <a class="code" href="classoperations__research_1_1sat_1_1_variable_with_same_reason_identifier.html#a85a00c2877e3b249951022638dda5642">FirstVariableWithSameReason</a>(BooleanVariable <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>) {</div>
|
|
<div class="line"><a name="l00704"></a><span class="lineno"> 704</span>  <span class="keywordflow">if</span> (seen_[<a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>]) <span class="keywordflow">return</span> first_variable_[<a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>];</div>
|
|
<div class="line"><a name="l00705"></a><span class="lineno"> 705</span>  <span class="keyword">const</span> BooleanVariable reference_var =</div>
|
|
<div class="line"><a name="l00706"></a><span class="lineno"> 706</span>  trail_.<a class="code" href="classoperations__research_1_1sat_1_1_trail.html#a89ab9ae41ab13f8847ac18e8beac37ed">ReferenceVarWithSameReason</a>(<a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>);</div>
|
|
<div class="line"><a name="l00707"></a><span class="lineno"> 707</span>  <span class="keywordflow">if</span> (reference_var == <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>) <span class="keywordflow">return</span> <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>;</div>
|
|
<div class="line"><a name="l00708"></a><span class="lineno"> 708</span>  <span class="keywordflow">if</span> (seen_[reference_var]) <span class="keywordflow">return</span> first_variable_[reference_var];</div>
|
|
<div class="line"><a name="l00709"></a><span class="lineno"> 709</span>  seen_.<a class="code" href="classoperations__research_1_1_sparse_bitset.html#a41f798a04019147982b29c576ff9d8b7">Set</a>(reference_var);</div>
|
|
<div class="line"><a name="l00710"></a><span class="lineno"> 710</span>  first_variable_[reference_var] = <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>;</div>
|
|
<div class="line"><a name="l00711"></a><span class="lineno"> 711</span>  <span class="keywordflow">return</span> <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>;</div>
|
|
<div class="line"><a name="l00712"></a><span class="lineno"> 712</span>  }</div>
|
|
<div class="line"><a name="l00713"></a><span class="lineno"> 713</span>  </div>
|
|
<div class="line"><a name="l00714"></a><span class="lineno"> 714</span>  <span class="keyword">private</span>:</div>
|
|
<div class="line"><a name="l00715"></a><span class="lineno"> 715</span>  <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1sat_1_1_trail.html">Trail</a>& trail_;</div>
|
|
<div class="line"><a name="l00716"></a><span class="lineno"> 716</span>  <a class="code" href="classgtl_1_1_i_t_i_vector.html">gtl::ITIVector<BooleanVariable, BooleanVariable></a> first_variable_;</div>
|
|
<div class="line"><a name="l00717"></a><span class="lineno"> 717</span>  <a class="code" href="classoperations__research_1_1_sparse_bitset.html">SparseBitset<BooleanVariable></a> seen_;</div>
|
|
<div class="line"><a name="l00718"></a><span class="lineno"> 718</span>  </div>
|
|
<div class="line"><a name="l00719"></a><span class="lineno"> 719</span>  DISALLOW_COPY_AND_ASSIGN(<a class="code" href="classoperations__research_1_1sat_1_1_variable_with_same_reason_identifier.html">VariableWithSameReasonIdentifier</a>);</div>
|
|
<div class="line"><a name="l00720"></a><span class="lineno"> 720</span> };</div>
|
|
<div class="line"><a name="l00721"></a><span class="lineno"> 721</span>  </div>
|
|
<div class="line"><a name="l00722"></a><span class="lineno"> 722</span> } <span class="comment">// namespace sat</span></div>
|
|
<div class="line"><a name="l00723"></a><span class="lineno"> 723</span> } <span class="comment">// namespace operations_research</span></div>
|
|
<div class="line"><a name="l00724"></a><span class="lineno"> 724</span>  </div>
|
|
<div class="line"><a name="l00725"></a><span class="lineno"> 725</span> <span class="preprocessor">#endif // OR_TOOLS_SAT_PB_CONSTRAINT_H_</span></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<div class="ttc" id="aexpr__array_8cc_html_a472a99923cbe11ae7b5a5d157d9ad465"><div class="ttname"><a href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a></div><div class="ttdeci">IntVar * var</div><div class="ttdef"><b>Definition:</b> <a href="expr__array_8cc_source.html#l01858">expr_array.cc:1858</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1sat_1_1_literal_with_coeff_html_af63dcc00f2023fdf498e0829e6fb8a6b"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#af63dcc00f2023fdf498e0829e6fb8a6b">operations_research::sat::LiteralWithCoeff::literal</a></div><div class="ttdeci">Literal literal</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00053">pb_constraint.h:53</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_a22d7b8d009ec7b8ccef8cd662d4bac7e"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#a22d7b8d009ec7b8ccef8cd662d4bac7e">operations_research::sat::PbConstraints::~PbConstraints</a></div><div class="ttdeci">~PbConstraints() override</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00529">pb_constraint.h:529</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_a5aa25e6e306c7158c11d2053170379a2"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#a5aa25e6e306c7158c11d2053170379a2">operations_research::sat::PbConstraints::Reason</a></div><div class="ttdeci">absl::Span< const Literal > Reason(const Trail &trail, int trail_index) const final</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00965">pb_constraint.cc:965</a></div></div>
|
|
<div class="ttc" id="aalldiff__cst_8cc_html_a021e695f54a13bd809c34b2f4ca87c37"><div class="ttname"><a href="alldiff__cst_8cc.html#a021e695f54a13bd809c34b2f4ca87c37">min</a></div><div class="ttdeci">int64 min</div><div class="ttdef"><b>Definition:</b> <a href="alldiff__cst_8cc_source.html#l00138">alldiff_cst.cc:138</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="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="astructoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper_1_1_reason_info_html"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper_1_1_reason_info.html">operations_research::sat::PbConstraintsEnqueueHelper::ReasonInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00353">pb_constraint.h:353</a></div></div>
|
|
<div class="ttc" id="astats_8h_html_a3c3e6b102f0d91c523099325c98e1887"><div class="ttname"><a href="stats_8h.html#a3c3e6b102f0d91c523099325c98e1887">IF_STATS_ENABLED</a></div><div class="ttdeci">#define IF_STATS_ENABLED(instructions)</div><div class="ttdef"><b>Definition:</b> <a href="stats_8h_source.html#l00435">stats.h:435</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_sparse_bitset_html_ae09e38958e558d2c776bc555a0dc2fc7"><div class="ttname"><a href="classoperations__research_1_1_sparse_bitset.html#ae09e38958e558d2c776bc555a0dc2fc7">operations_research::SparseBitset::ClearAndResize</a></div><div class="ttdeci">void ClearAndResize(IntegerType size)</div><div class="ttdef"><b>Definition:</b> <a href="bitset_8h_source.html#l00780">bitset.h:780</a></div></div>
|
|
<div class="ttc" id="arouting__search_8cc_html_a204f9b990226e8288e1aaecbb496cbf8"><div class="ttname"><a href="routing__search_8cc.html#a204f9b990226e8288e1aaecbb496cbf8">bound</a></div><div class="ttdeci">int64 bound</div><div class="ttdef"><b>Definition:</b> <a href="routing__search_8cc_source.html#l00972">routing_search.cc:972</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_ae087fb0f8731e64e65fb00e517fe8966"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#ae087fb0f8731e64e65fb00e517fe8966">operations_research::sat::PbConstraints::BumpActivity</a></div><div class="ttdeci">void BumpActivity(UpperBoundedLinearConstraint *constraint)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l01066">pb_constraint.cc:1066</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_variable_with_same_reason_identifier_html_af7fbbd00f0e631ce361b5ce6636b2017"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_variable_with_same_reason_identifier.html#af7fbbd00f0e631ce361b5ce6636b2017">operations_research::sat::VariableWithSameReasonIdentifier::Resize</a></div><div class="ttdeci">void Resize(int num_variables)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00692">pb_constraint.h:692</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1sat_1_1_literal_with_coeff_html_a168a81a82b65c695d194352ab194eff5"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#a168a81a82b65c695d194352ab194eff5">operations_research::sat::LiteralWithCoeff::LiteralWithCoeff</a></div><div class="ttdeci">LiteralWithCoeff(Literal l, int64 c)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00052">pb_constraint.h:52</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_variable_with_same_reason_identifier_html_aa71d36872f416feaa853788a7a7a7ef8"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_variable_with_same_reason_identifier.html#aa71d36872f416feaa853788a7a7a7ef8">operations_research::sat::VariableWithSameReasonIdentifier::Clear</a></div><div class="ttdeci">void Clear()</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00698">pb_constraint.h:698</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_a40669a5dba9b3618272a2881174aee5c"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a40669a5dba9b3618272a2881174aee5c">operations_research::sat::UpperBoundedLinearConstraint::InitializeRhs</a></div><div class="ttdeci">bool InitializeRhs(Coefficient rhs, int trail_index, Coefficient *threshold, Trail *trail, PbConstraintsEnqueueHelper *helper)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00458">pb_constraint.cc:458</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_literal_html_a764be64f3029f8b8e23511061d8de355"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_literal.html#a764be64f3029f8b8e23511061d8de355">operations_research::sat::Literal::DebugString</a></div><div class="ttdeci">std::string DebugString() const</div><div class="ttdef"><b>Definition:</b> <a href="sat__base_8h_source.html#l00093">sat_base.h:93</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_a5116e268e9144cf6ee197450e0eda486"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#a5116e268e9144cf6ee197450e0eda486">operations_research::sat::PbConstraints::ClearConflictingConstraint</a></div><div class="ttdeci">void ClearConflictingConstraint()</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00579">pb_constraint.h:579</a></div></div>
|
|
<div class="ttc" id="aclassgtl_1_1_i_t_i_vector_html"><div class="ttname"><a href="classgtl_1_1_i_t_i_vector.html">gtl::ITIVector< LiteralIndex, LiteralIndex ></a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_a9699443a7a311c163aa4ef9990f493a4"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#a9699443a7a311c163aa4ef9990f493a4">operations_research::sat::PbConstraints::num_inspected_constraint_literals</a></div><div class="ttdeci">int64 num_inspected_constraint_literals() const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00603">pb_constraint.h:603</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper_html"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html">operations_research::sat::PbConstraintsEnqueueHelper</a></div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00338">pb_constraint.h:338</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="astructoperations__research_1_1sat_1_1_literal_with_coeff_html_a9c8a1b84df9dd447ccd80db948eb5085"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#a9c8a1b84df9dd447ccd80db948eb5085">operations_research::sat::LiteralWithCoeff::LiteralWithCoeff</a></div><div class="ttdeci">LiteralWithCoeff()</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00050">pb_constraint.h:50</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1sat_1_1_literal_with_coeff_html_ada84a5c84452210dd2919b83deb58ca3"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#ada84a5c84452210dd2919b83deb58ca3">operations_research::sat::LiteralWithCoeff::coefficient</a></div><div class="ttdeci">Coefficient coefficient</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00054">pb_constraint.h:54</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html_ad49fd13bba7789f08d81d6c71d856082"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#ad49fd13bba7789f08d81d6c71d856082">operations_research::sat::MutableUpperBoundedLinearConstraint::CopyIntoVector</a></div><div class="ttdeci">void CopyIntoVector(std::vector< LiteralWithCoeff > *output)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00369">pb_constraint.cc:369</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_canonical_boolean_linear_problem_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html">operations_research::sat::CanonicalBooleanLinearProblem</a></div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00141">pb_constraint.h:141</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html_a3061094c37b507ae2834cb7d86fbcf39"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a3061094c37b507ae2834cb7d86fbcf39">operations_research::sat::MutableUpperBoundedLinearConstraint::ComputeSlackForTrailPrefix</a></div><div class="ttdeci">Coefficient ComputeSlackForTrailPrefix(const Trail &trail, int trail_index) const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00289">pb_constraint.cc:289</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="anamespaceoperations__research_1_1sat_html_a736df4a48666566457c579534cb73d42"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a736df4a48666566457c579534cb73d42">operations_research::sat::ApplyLiteralMapping</a></div><div class="ttdeci">bool ApplyLiteralMapping(const gtl::ITIVector< LiteralIndex, LiteralIndex > &mapping, std::vector< LiteralWithCoeff > *cst, Coefficient *bound_shift, Coefficient *max_value)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00102">pb_constraint.cc:102</a></div></div>
|
|
<div class="ttc" id="asat_2model_8h_html"><div class="ttname"><a href="sat_2model_8h.html">model.h</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_a79bc25526bc335587dd8b8c433d19306"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a79bc25526bc335587dd8b8c433d19306">operations_research::sat::UpperBoundedLinearConstraint::AddToConflict</a></div><div class="ttdeci">void AddToConflict(MutableUpperBoundedLinearConstraint *conflict)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00430">pb_constraint.cc:430</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_trail_html_a89ab9ae41ab13f8847ac18e8beac37ed"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_trail.html#a89ab9ae41ab13f8847ac18e8beac37ed">operations_research::sat::Trail::ReferenceVarWithSameReason</a></div><div class="ttdeci">BooleanVariable ReferenceVarWithSameReason(BooleanVariable var) const</div><div class="ttdef"><b>Definition:</b> <a href="sat__base_8h_source.html#l00559">sat_base.h:559</a></div></div>
|
|
<div class="ttc" id="amacros_8h_html"><div class="ttname"><a href="macros_8h.html">macros.h</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html_ac85244c6eaf57970b2057657ae70ee17"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#ac85244c6eaf57970b2057657ae70ee17">operations_research::sat::MutableUpperBoundedLinearConstraint::ClearAndResize</a></div><div class="ttdeci">void ClearAndResize(int num_variables)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00238">pb_constraint.cc:238</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_canonical_boolean_linear_problem_html_a7391d0c784872207477f474cf28f65a5"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html#a7391d0c784872207477f474cf28f65a5">operations_research::sat::CanonicalBooleanLinearProblem::Rhs</a></div><div class="ttdeci">const Coefficient Rhs(int i) const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00156">pb_constraint.h:156</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="aclassoperations__research_1_1sat_1_1_pb_constraints_html_afea0121eba5886052ba91716acf7f29f"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#afea0121eba5886052ba91716acf7f29f">operations_research::sat::PbConstraints::AddLearnedConstraint</a></div><div class="ttdeci">bool AddLearnedConstraint(const std::vector< LiteralWithCoeff > &cst, Coefficient rhs, Trail *trail)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00884">pb_constraint.cc:884</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_a9bea7e159036a792452a1ef3d7d45c8b"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#a9bea7e159036a792452a1ef3d7d45c8b">operations_research::sat::PbConstraints::DeleteConstraint</a></div><div class="ttdeci">void DeleteConstraint(int index)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00596">pb_constraint.h:596</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_canonical_boolean_linear_problem_html_a05c49a95f6af6f8d873c96cae6ab6653"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html#a05c49a95f6af6f8d873c96cae6ab6653">operations_research::sat::CanonicalBooleanLinearProblem::AddLinearConstraint</a></div><div class="ttdeci">bool AddLinearConstraint(bool use_lower_bound, Coefficient lower_bound, bool use_upper_bound, Coefficient upper_bound, std::vector< LiteralWithCoeff > *cst)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00200">pb_constraint.cc:200</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_a668f93c96cd8a83dd4bf3da35ba8b7b0"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#a668f93c96cd8a83dd4bf3da35ba8b7b0">operations_research::sat::PbConstraints::AddConstraint</a></div><div class="ttdeci">bool AddConstraint(const std::vector< LiteralWithCoeff > &cst, Coefficient rhs, Trail *trail)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00823">pb_constraint.cc:823</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a15ca399ada8a279dc92f693ede7e4004"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a15ca399ada8a279dc92f693ede7e4004">operations_research::sat::operator<<</a></div><div class="ttdeci">std::ostream & operator<<(std::ostream &os, const BoolVar &var)</div><div class="ttdef"><b>Definition:</b> <a href="cp__model_8cc_source.html#l00065">cp_model.cc:65</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html_a6097c48821f010becb9a6910f4c39288"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a6097c48821f010becb9a6910f4c39288">operations_research::sat::MutableUpperBoundedLinearConstraint::DebugString</a></div><div class="ttdeci">std::string DebugString()</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00276">pb_constraint.cc:276</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html_a16645beea614ddea591b722904131da9"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a16645beea614ddea591b722904131da9">operations_research::sat::MutableUpperBoundedLinearConstraint::ReduceCoefficients</a></div><div class="ttdeci">void ReduceCoefficients()</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00260">pb_constraint.cc:260</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_a1f591be5334541874ba049873235f0a9"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#a1f591be5334541874ba049873235f0a9">operations_research::sat::PbConstraints::Propagate</a></div><div class="ttdeci">bool Propagate(Trail *trail) final</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00934">pb_constraint.cc:934</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_canonical_boolean_linear_problem_html_a03666f2e70e42a9560aa9ce7416d2644"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html#a03666f2e70e42a9560aa9ce7416d2644">operations_research::sat::CanonicalBooleanLinearProblem::NumConstraints</a></div><div class="ttdeci">int NumConstraints() const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00155">pb_constraint.h:155</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="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html_a7af7a846335222cba297cb30a41c6525"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a7af7a846335222cba297cb30a41c6525">operations_research::sat::MutableUpperBoundedLinearConstraint::CancelationAmount</a></div><div class="ttdeci">Coefficient CancelationAmount(Literal literal, Coefficient coeff) const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00296">pb_constraint.h:296</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper_1_1_reason_info_html_afe52c2c26c7ea4bb701d2e051c0f3833"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper_1_1_reason_info.html#afe52c2c26c7ea4bb701d2e051c0f3833">operations_research::sat::PbConstraintsEnqueueHelper::ReasonInfo::pb_constraint</a></div><div class="ttdeci">UpperBoundedLinearConstraint * pb_constraint</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00355">pb_constraint.h:355</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html_a3d589ce2855e8e0e57354f33d73123e2"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a3d589ce2855e8e0e57354f33d73123e2">operations_research::sat::MutableUpperBoundedLinearConstraint::ReduceSlackTo</a></div><div class="ttdeci">void ReduceSlackTo(const Trail &trail, int trail_index, Coefficient initial_slack, Coefficient target)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00332">pb_constraint.cc:332</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html_a4556e82417879ecf2bf14a4ee7bfce9e"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a4556e82417879ecf2bf14a4ee7bfce9e">operations_research::sat::MutableUpperBoundedLinearConstraint::Rhs</a></div><div class="ttdeci">Coefficient Rhs() const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00268">pb_constraint.h:268</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a5c5399274f079c718ec46bf4b3032d27"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a5c5399274f079c718ec46bf4b3032d27">operations_research::sat::ComputeNegatedCanonicalRhs</a></div><div class="ttdeci">Coefficient ComputeNegatedCanonicalRhs(Coefficient lower_bound, Coefficient bound_shift, Coefficient max_value)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00177">pb_constraint.cc:177</a></div></div>
|
|
<div class="ttc" id="apack_8cc_html_a750b5d744c39a06bfb13e6eb010e35d0"><div class="ttname"><a href="pack_8cc.html#a750b5d744c39a06bfb13e6eb010e35d0">index</a></div><div class="ttdeci">int index</div><div class="ttdef"><b>Definition:</b> <a href="pack_8cc_source.html#l00508">pack.cc:508</a></div></div>
|
|
<div class="ttc" id="asat__base_8h_html"><div class="ttname"><a href="sat__base_8h.html">sat_base.h</a></div></div>
|
|
<div class="ttc" id="aintegral__types_8h_html_a56f1a81c92849566ae864511088eb7e8"><div class="ttname"><a href="integral__types_8h.html#a56f1a81c92849566ae864511088eb7e8">int32</a></div><div class="ttdeci">int int32</div><div class="ttdef"><b>Definition:</b> <a href="integral__types_8h_source.html#l00033">integral_types.h:33</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a84a0f65f1ec460c487789fe6a7620f77"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a84a0f65f1ec460c487789fe6a7620f77">operations_research::sat::DEFINE_INT_TYPE</a></div><div class="ttdeci">DEFINE_INT_TYPE(ClauseIndex, int)</div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html_a2017fd2cf382a2d3e8989cbeccf4cd1b"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a2017fd2cf382a2d3e8989cbeccf4cd1b">operations_research::sat::MutableUpperBoundedLinearConstraint::MaxSum</a></div><div class="ttdeci">Coefficient MaxSum() const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00269">pb_constraint.h:269</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_a63931731d764c40e4c80ec59a553a0f1"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a63931731d764c40e4c80ec59a553a0f1">operations_research::sat::UpperBoundedLinearConstraint::Untrail</a></div><div class="ttdeci">void Untrail(Coefficient *threshold, int trail_index)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00811">pb_constraint.cc:811</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a740bdf0c6c84d1fd07e8405fac06e04e"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a740bdf0c6c84d1fd07e8405fac06e04e">operations_research::sat::SimplifyCanonicalBooleanLinearConstraint</a></div><div class="ttdeci">void SimplifyCanonicalBooleanLinearConstraint(std::vector< LiteralWithCoeff > *cst, Coefficient *rhs)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00147">pb_constraint.cc:147</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_aa3bdbedb1d2e7db11727770605cee8cc"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#aa3bdbedb1d2e7db11727770605cee8cc">operations_research::sat::PbConstraints::ConflictingConstraint</a></div><div class="ttdeci">UpperBoundedLinearConstraint * ConflictingConstraint()</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00580">pb_constraint.h:580</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_trail_html_a8ef12397d1682615bc3108c397734179"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_trail.html#a8ef12397d1682615bc3108c397734179">operations_research::sat::Trail::Index</a></div><div class="ttdeci">int Index() const</div><div class="ttdef"><b>Definition:</b> <a href="sat__base_8h_source.html#l00378">sat_base.h:378</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_sparse_bitset_html_a41f798a04019147982b29c576ff9d8b7"><div class="ttname"><a href="classoperations__research_1_1_sparse_bitset.html#a41f798a04019147982b29c576ff9d8b7">operations_research::SparseBitset::Set</a></div><div class="ttdeci">void Set(IntegerType index)</div><div class="ttdef"><b>Definition:</b> <a href="bitset_8h_source.html#l00805">bitset.h:805</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html_aa7d76b766faf39c1652b6617eac5fe20"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#aa7d76b766faf39c1652b6617eac5fe20">operations_research::sat::MutableUpperBoundedLinearConstraint::ClearAll</a></div><div class="ttdeci">void ClearAll()</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00249">pb_constraint.cc:249</a></div></div>
|
|
<div class="ttc" id="astats_8h_html"><div class="ttname"><a href="stats_8h.html">stats.h</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_a27e53a30d14b2ece60bfbad8aca43cfb"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a27e53a30d14b2ece60bfbad8aca43cfb">operations_research::sat::UpperBoundedLinearConstraint::set_is_learned</a></div><div class="ttdeci">void set_is_learned(bool is_learned)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00461">pb_constraint.h:461</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_aaef19c229ed09dad5e49d53096e7be46"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#aaef19c229ed09dad5e49d53096e7be46">operations_research::sat::PbConstraints::PbConstraints</a></div><div class="ttdeci">PbConstraints(Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00517">pb_constraint.h:517</a></div></div>
|
|
<div class="ttc" id="aconstraint__solver_2table_8cc_html_af730895c6c6ef6e03caaf6251192dfd2"><div class="ttname"><a href="constraint__solver_2table_8cc.html#af730895c6c6ef6e03caaf6251192dfd2">a</a></div><div class="ttdeci">int64 a</div><div class="ttdef"><b>Definition:</b> <a href="constraint__solver_2table_8cc_source.html#l00042">constraint_solver/table.cc:42</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_variable_with_same_reason_identifier_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_variable_with_same_reason_identifier.html">operations_research::sat::VariableWithSameReasonIdentifier</a></div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00687">pb_constraint.h:687</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_ac05fae50934252485d3b8addda1e0695"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#ac05fae50934252485d3b8addda1e0695">operations_research::sat::UpperBoundedLinearConstraint::is_used_as_a_reason</a></div><div class="ttdeci">bool is_used_as_a_reason() const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00463">pb_constraint.h:463</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_add3bd69a358a7351a31f0a12a4bf16b0"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#add3bd69a358a7351a31f0a12a4bf16b0">operations_research::sat::UpperBoundedLinearConstraint::activity</a></div><div class="ttdeci">double activity() const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00468">pb_constraint.h:468</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_sparse_bitset_html"><div class="ttname"><a href="classoperations__research_1_1_sparse_bitset.html">operations_research::SparseBitset< BooleanVariable ></a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html_aaff50cb53673c51920c6bcb567ca8806"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#aaff50cb53673c51920c6bcb567ca8806">operations_research::sat::MutableUpperBoundedLinearConstraint::AddTerm</a></div><div class="ttdeci">void AddTerm(Literal literal, Coefficient coeff)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00273">pb_constraint.h:273</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_ae232e8f1d65c7223588645585811d018"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#ae232e8f1d65c7223588645585811d018">operations_research::sat::UpperBoundedLinearConstraint::MarkForDeletion</a></div><div class="ttdeci">void MarkForDeletion()</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00456">pb_constraint.h:456</a></div></div>
|
|
<div class="ttc" id="asat__parameters_8pb_8h_html"><div class="ttname"><a href="sat__parameters_8pb_8h.html">sat_parameters.pb.h</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a8860b588974cb8ffaf2ac97eafd67b3e"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a8860b588974cb8ffaf2ac97eafd67b3e">operations_research::sat::ComputeBooleanLinearExpressionCanonicalForm</a></div><div class="ttdeci">bool ComputeBooleanLinearExpressionCanonicalForm(std::vector< LiteralWithCoeff > *cst, Coefficient *bound_shift, Coefficient *max_value)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00040">pb_constraint.cc:40</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html">operations_research::sat::UpperBoundedLinearConstraint</a></div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00373">pb_constraint.h:373</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_afd482f2c4b9533b4d1f7379a578e9b18"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#afd482f2c4b9533b4d1f7379a578e9b18">operations_research::sat::kCoefficientMax</a></div><div class="ttdeci">const Coefficient kCoefficientMax(std::numeric_limits< Coefficient::ValueType >::max())</div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_a18ab319435ed80315e0c35ca40a7c2a0"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#a18ab319435ed80315e0c35ca40a7c2a0">operations_research::sat::PbConstraints::NumberOfConstraints</a></div><div class="ttdeci">int NumberOfConstraints() const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00572">pb_constraint.h:572</a></div></div>
|
|
<div class="ttc" id="aint__type_8h_html"><div class="ttname"><a href="int__type_8h.html">int_type.h</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_acf18431db5241d6ae15e5db2470d9079"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#acf18431db5241d6ae15e5db2470d9079">operations_research::sat::BooleanLinearExpressionIsCanonical</a></div><div class="ttdeci">bool BooleanLinearExpressionIsCanonical(const std::vector< LiteralWithCoeff > &cst)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00135">pb_constraint.cc:135</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_af5bdeba7aab357b3a8e987dc9c527856"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#af5bdeba7aab357b3a8e987dc9c527856">operations_research::sat::UpperBoundedLinearConstraint::is_marked_for_deletion</a></div><div class="ttdeci">bool is_marked_for_deletion() const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00457">pb_constraint.h:457</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html_ac4fb16d0641ccef0502adb8bbe3909af"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#ac4fb16d0641ccef0502adb8bbe3909af">operations_research::sat::MutableUpperBoundedLinearConstraint::AddToRhs</a></div><div class="ttdeci">void AddToRhs(Coefficient value)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00264">pb_constraint.h:264</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_sparse_bitset_html_a1e5ae9fb14fd6b25919148ae8bbaf050"><div class="ttname"><a href="classoperations__research_1_1_sparse_bitset.html#a1e5ae9fb14fd6b25919148ae8bbaf050">operations_research::SparseBitset::PositionsSetAtLeastOnce</a></div><div class="ttdeci">const std::vector< IntegerType > & PositionsSetAtLeastOnce() const</div><div class="ttdef"><b>Definition:</b> <a href="bitset_8h_source.html#l00815">bitset.h:815</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_a2c809e3ff1236e74ebaaafb7864aca94"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a2c809e3ff1236e74ebaaafb7864aca94">operations_research::sat::UpperBoundedLinearConstraint::FillReason</a></div><div class="ttdeci">void FillReason(const Trail &trail, int source_trail_index, BooleanVariable propagated_variable, std::vector< Literal > *reason)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00575">pb_constraint.cc:575</a></div></div>
|
|
<div class="ttc" id="aint__type__indexed__vector_8h_html"><div class="ttname"><a href="int__type__indexed__vector_8h.html">int_type_indexed_vector.h</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_a991506896584b01b214102ac3ed2ddb5"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#a991506896584b01b214102ac3ed2ddb5">operations_research::sat::PbConstraints::num_constraint_lookups</a></div><div class="ttdeci">int64 num_constraint_lookups() const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00602">pb_constraint.h:602</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_aaf167a7e47f0e21f2b67ba9af023530a"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#aaf167a7e47f0e21f2b67ba9af023530a">operations_research::sat::UpperBoundedLinearConstraint::UpperBoundedLinearConstraint</a></div><div class="ttdeci">UpperBoundedLinearConstraint(const std::vector< LiteralWithCoeff > &cst)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00389">pb_constraint.cc:389</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_literal_html_a4a11c7c4d7706c09de5e18707c3b5c62"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_literal.html#a4a11c7c4d7706c09de5e18707c3b5c62">operations_research::sat::Literal::Index</a></div><div class="ttdeci">LiteralIndex Index() const</div><div class="ttdef"><b>Definition:</b> <a href="sat__base_8h_source.html#l00084">sat_base.h:84</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_canonical_boolean_linear_problem_html_a95128a258b1f7d9a4058362edfd2158b"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html#a95128a258b1f7d9a4058362edfd2158b">operations_research::sat::CanonicalBooleanLinearProblem::Constraint</a></div><div class="ttdeci">const std::vector< LiteralWithCoeff > & Constraint(int i) const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00157">pb_constraint.h:157</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_model_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_model.html">operations_research::sat::Model</a></div><div class="ttdoc">Class that owns everything related to a particular optimization model.</div><div class="ttdef"><b>Definition:</b> <a href="sat_2model_8h_source.html#l00038">sat/model.h:38</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="astructoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper_html_a2b537e8bba9403eef4d626a7a8b921a1"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html#a2b537e8bba9403eef4d626a7a8b921a1">operations_research::sat::PbConstraintsEnqueueHelper::reasons</a></div><div class="ttdeci">std::vector< ReasonInfo > reasons</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00357">pb_constraint.h:357</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_ae20e3965a974e3a5fe816c033a94e568"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#ae20e3965a974e3a5fe816c033a94e568">operations_research::sat::PbConstraints::Untrail</a></div><div class="ttdeci">void Untrail(const Trail &trail, int trail_index) final</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00942">pb_constraint.cc:942</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_variable_with_same_reason_identifier_html_a85a00c2877e3b249951022638dda5642"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_variable_with_same_reason_identifier.html#a85a00c2877e3b249951022638dda5642">operations_research::sat::VariableWithSameReasonIdentifier::FirstVariableWithSameReason</a></div><div class="ttdeci">BooleanVariable FirstVariableWithSameReason(BooleanVariable var)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00703">pb_constraint.h:703</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_ad064f7982ad8af720e437b82380b629f"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#ad064f7982ad8af720e437b82380b629f">operations_research::sat::PbConstraints::UpdateActivityIncrement</a></div><div class="ttdeci">void UpdateActivityIncrement()</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l01083">pb_constraint.cc:1083</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper_1_1_reason_info_html_a423024af9357cc1dff15aa424e022d9d"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper_1_1_reason_info.html#a423024af9357cc1dff15aa424e022d9d">operations_research::sat::PbConstraintsEnqueueHelper::ReasonInfo::source_trail_index</a></div><div class="ttdeci">int source_trail_index</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00354">pb_constraint.h:354</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_sparse_bitset_html_aa7d76b766faf39c1652b6617eac5fe20"><div class="ttname"><a href="classoperations__research_1_1_sparse_bitset.html#aa7d76b766faf39c1652b6617eac5fe20">operations_research::SparseBitset::ClearAll</a></div><div class="ttdeci">void ClearAll()</div><div class="ttdef"><b>Definition:</b> <a href="bitset_8h_source.html#l00776">bitset.h:776</a></div></div>
|
|
<div class="ttc" id="agurobi__interface_8cc_html_a0728f23c9a47655d38e0bf1a2f200bcf"><div class="ttname"><a href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a></div><div class="ttdeci">GRBmodel * model</div><div class="ttdef"><b>Definition:</b> <a href="gurobi__interface_8cc_source.html#l00195">gurobi_interface.cc:195</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_variable_with_same_reason_identifier_html_aa687d6493ab5b27058da0667efaeccdd"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_variable_with_same_reason_identifier.html#aa687d6493ab5b27058da0667efaeccdd">operations_research::sat::VariableWithSameReasonIdentifier::VariableWithSameReasonIdentifier</a></div><div class="ttdeci">VariableWithSameReasonIdentifier(const Trail &trail)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00689">pb_constraint.h:689</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_literal_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_literal.html">operations_research::sat::Literal</a></div><div class="ttdef"><b>Definition:</b> <a href="sat__base_8h_source.html#l00064">sat_base.h:64</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html">operations_research::sat::PbConstraints</a></div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00515">pb_constraint.h:515</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a01c76d0c46e2975d10e45ab04877f4ac"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a01c76d0c46e2975d10e45ab04877f4ac">operations_research::sat::ComputeCanonicalRhs</a></div><div class="ttdeci">Coefficient ComputeCanonicalRhs(Coefficient upper_bound, Coefficient bound_shift, Coefficient max_value)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00159">pb_constraint.cc:159</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_a103f8fd98c381df722712e1782af52d4"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a103f8fd98c381df722712e1782af52d4">operations_research::sat::UpperBoundedLinearConstraint::ComputeCancelation</a></div><div class="ttdeci">Coefficient ComputeCancelation(const Trail &trail, int trail_index, const MutableUpperBoundedLinearConstraint &conflict)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00646">pb_constraint.cc:646</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_a5f65c8b6b41bb6b090435d4aa3d7d30b"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a5f65c8b6b41bb6b090435d4aa3d7d30b">operations_research::sat::UpperBoundedLinearConstraint::already_propagated_end</a></div><div class="ttdeci">int already_propagated_end() const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00476">pb_constraint.h:476</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_a32f963abf423028dcbb4d1c3daf8086d"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a32f963abf423028dcbb4d1c3daf8086d">operations_research::sat::UpperBoundedLinearConstraint::HasIdenticalTerms</a></div><div class="ttdeci">bool HasIdenticalTerms(const std::vector< LiteralWithCoeff > &cst)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00442">pb_constraint.cc:442</a></div></div>
|
|
<div class="ttc" id="arouting__search_8cc_html_ab66ad179c8a6fcf1adb958cb51f4c7cb"><div class="ttname"><a href="routing__search_8cc.html#ab66ad179c8a6fcf1adb958cb51f4c7cb">coefficient</a></div><div class="ttdeci">int64 coefficient</div><div class="ttdef"><b>Definition:</b> <a href="routing__search_8cc_source.html#l00973">routing_search.cc:973</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_a7e8ee12f0eae3b9e348b88e6675438d7"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a7e8ee12f0eae3b9e348b88e6675438d7">operations_research::sat::UpperBoundedLinearConstraint::is_learned</a></div><div class="ttdeci">bool is_learned() const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00462">pb_constraint.h:462</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html_a2296cbfc427d1ccfb3ecc7d0ced18b01"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a2296cbfc427d1ccfb3ecc7d0ced18b01">operations_research::sat::MutableUpperBoundedLinearConstraint::GetLiteral</a></div><div class="ttdeci">Literal GetLiteral(BooleanVariable var) const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00191">pb_constraint.h:191</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html_a5a8bf8a7daa44c4c35f8aa05a84c19ba"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a5a8bf8a7daa44c4c35f8aa05a84c19ba">operations_research::sat::MutableUpperBoundedLinearConstraint::PossibleNonZeros</a></div><div class="ttdeci">const std::vector< BooleanVariable > & PossibleNonZeros() const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00305">pb_constraint.h:305</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1sat_1_1_literal_with_coeff_html_a262cd3d45828aaec895b772bd50002d5"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#a262cd3d45828aaec895b772bd50002d5">operations_research::sat::LiteralWithCoeff::operator==</a></div><div class="ttdeci">bool operator==(const LiteralWithCoeff &other) const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00055">pb_constraint.h:55</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_trail_html_a12c36a7cb228d80bcad42fa38a103f92"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_trail.html#a12c36a7cb228d80bcad42fa38a103f92">operations_research::sat::Trail::Enqueue</a></div><div class="ttdeci">void Enqueue(Literal true_literal, int propagator_id)</div><div class="ttdef"><b>Definition:</b> <a href="sat__base_8h_source.html#l00250">sat_base.h:250</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1sat_1_1_literal_with_coeff_html"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_literal_with_coeff.html">operations_research::sat::LiteralWithCoeff</a></div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00049">pb_constraint.h:49</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_ab00d5c5d5edf37a9568363ba39e02c11"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#ab00d5c5d5edf37a9568363ba39e02c11">operations_research::sat::PbConstraints::ReasonPbConstraint</a></div><div class="ttdeci">UpperBoundedLinearConstraint * ReasonPbConstraint(int trail_index) const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00976">pb_constraint.cc:976</a></div></div>
|
|
<div class="ttc" id="aclassgtl_1_1_i_t_i_vector_html_a4e3670a285a3642eaa07f66766cffa72"><div class="ttname"><a href="classgtl_1_1_i_t_i_vector.html#a4e3670a285a3642eaa07f66766cffa72">gtl::ITIVector::resize</a></div><div class="ttdeci">void resize(size_type new_size)</div><div class="ttdef"><b>Definition:</b> <a href="int__type__indexed__vector_8h_source.html#l00149">int_type_indexed_vector.h:149</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_a1d503b84c8c90bca31afd5a89b6db0ba"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a1d503b84c8c90bca31afd5a89b6db0ba">operations_research::sat::UpperBoundedLinearConstraint::Propagate</a></div><div class="ttdeci">bool Propagate(int trail_index, Coefficient *threshold, Trail *trail, PbConstraintsEnqueueHelper *helper)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00532">pb_constraint.cc:532</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html">operations_research::sat::MutableUpperBoundedLinearConstraint</a></div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00173">pb_constraint.h:173</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_a033e8db16a2a7516bc261c80d1e6ed0f"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a033e8db16a2a7516bc261c80d1e6ed0f">operations_research::sat::UpperBoundedLinearConstraint::set_activity</a></div><div class="ttdeci">void set_activity(double activity)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00467">pb_constraint.h:467</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper_html_ac12cf291d1c4f67f024ecd26b791507d"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html#ac12cf291d1c4f67f024ecd26b791507d">operations_research::sat::PbConstraintsEnqueueHelper::propagator_id</a></div><div class="ttdeci">int propagator_id</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00346">pb_constraint.h:346</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_a4556e82417879ecf2bf14a4ee7bfce9e"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a4556e82417879ecf2bf14a4ee7bfce9e">operations_research::sat::UpperBoundedLinearConstraint::Rhs</a></div><div class="ttdeci">Coefficient Rhs() const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00381">pb_constraint.h:381</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_stats_group_html_af9bc435481ae9e6e60d66a65d5394a7f"><div class="ttname"><a href="classoperations__research_1_1_stats_group.html#af9bc435481ae9e6e60d66a65d5394a7f">operations_research::StatsGroup::StatString</a></div><div class="ttdeci">std::string StatString() const</div><div class="ttdef"><b>Definition:</b> <a href="stats_8cc_source.html#l00071">stats.cc:71</a></div></div>
|
|
<div class="ttc" id="aoptimization_8cc_html_af63dcc00f2023fdf498e0829e6fb8a6b"><div class="ttname"><a href="optimization_8cc.html#af63dcc00f2023fdf498e0829e6fb8a6b">literal</a></div><div class="ttdeci">Literal literal</div><div class="ttdef"><b>Definition:</b> <a href="optimization_8cc_source.html#l00084">optimization.cc:84</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1sat_1_1_literal_with_coeff_html_ab5052c90c60767f4e16e79ea8d0bffb4"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_literal_with_coeff.html#ab5052c90c60767f4e16e79ea8d0bffb4">operations_research::sat::LiteralWithCoeff::LiteralWithCoeff</a></div><div class="ttdeci">LiteralWithCoeff(Literal l, Coefficient c)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00051">pb_constraint.h:51</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_canonical_boolean_linear_problem_html_a284a9b03285c5c0a835e07aba4f77b6f"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_canonical_boolean_linear_problem.html#a284a9b03285c5c0a835e07aba4f77b6f">operations_research::sat::CanonicalBooleanLinearProblem::CanonicalBooleanLinearProblem</a></div><div class="ttdeci">CanonicalBooleanLinearProblem()</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00143">pb_constraint.h:143</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_ac9bb5e79c2e9a44957f5b14c94f5101d"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#ac9bb5e79c2e9a44957f5b14c94f5101d">operations_research::sat::UpperBoundedLinearConstraint::hash</a></div><div class="ttdeci">int64 hash() const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00472">pb_constraint.h:472</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_sat_propagator_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_sat_propagator.html">operations_research::sat::SatPropagator</a></div><div class="ttdef"><b>Definition:</b> <a href="sat__base_8h_source.html#l00444">sat_base.h:444</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_upper_bounded_linear_constraint_html_a40517ccc9af91f2423cb14c508371ba1"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_upper_bounded_linear_constraint.html#a40517ccc9af91f2423cb14c508371ba1">operations_research::sat::UpperBoundedLinearConstraint::ResolvePBConflict</a></div><div class="ttdeci">void ResolvePBConflict(const Trail &trail, BooleanVariable var, MutableUpperBoundedLinearConstraint *conflict, Coefficient *conflict_slack)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00663">pb_constraint.cc:663</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper_html_a80f73afb7f3e4965def965261750bc86"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html#a80f73afb7f3e4965def965261750bc86">operations_research::sat::PbConstraintsEnqueueHelper::Enqueue</a></div><div class="ttdeci">void Enqueue(Literal l, int source_trail_index, UpperBoundedLinearConstraint *ct, Trail *trail)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00339">pb_constraint.h:339</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html_ad87ff40755cf420a0b8ead1f7f9f0489"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#ad87ff40755cf420a0b8ead1f7f9f0489">operations_research::sat::MutableUpperBoundedLinearConstraint::GetCoefficient</a></div><div class="ttdeci">Coefficient GetCoefficient(BooleanVariable var) const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00184">pb_constraint.h:184</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_a2aab5f0b8a516d308939c4cad97fc634"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#a2aab5f0b8a516d308939c4cad97fc634">operations_research::sat::PbConstraints::RescaleActivities</a></div><div class="ttdeci">void RescaleActivities(double scaling_factor)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l01076">pb_constraint.cc:1076</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_trail_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_trail.html">operations_research::sat::Trail</a></div><div class="ttdef"><b>Definition:</b> <a href="sat__base_8h_source.html#l00233">sat_base.h:233</a></div></div>
|
|
<div class="ttc" id="abitset_8h_html"><div class="ttname"><a href="bitset_8h.html">bitset.h</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_a31db3a3e839ea89186d44f0f3025f506"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#a31db3a3e839ea89186d44f0f3025f506">operations_research::sat::PbConstraints::num_threshold_updates</a></div><div class="ttdeci">int64 num_threshold_updates() const</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00606">pb_constraint.h:606</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html_a34a2ab35db64cd0574f980eb99d34a89"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a34a2ab35db64cd0574f980eb99d34a89">operations_research::sat::MutableUpperBoundedLinearConstraint::ReduceCoefficientsAndComputeSlackForTrailPrefix</a></div><div class="ttdeci">Coefficient ReduceCoefficientsAndComputeSlackForTrailPrefix(const Trail &trail, int trail_index)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8cc_source.html#l00302">pb_constraint.cc:303</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint_html_a8a9bf7ca1aaa88ead85b1e5e0b812a8b"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_mutable_upper_bounded_linear_constraint.html#a8a9bf7ca1aaa88ead85b1e5e0b812a8b">operations_research::sat::MutableUpperBoundedLinearConstraint::ReduceGivenCoefficient</a></div><div class="ttdeci">void ReduceGivenCoefficient(BooleanVariable var)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00208">pb_constraint.h:208</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper_html_aaae88a70725a09afe173932f040c49a1"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_pb_constraints_enqueue_helper.html#aaae88a70725a09afe173932f040c49a1">operations_research::sat::PbConstraintsEnqueueHelper::conflict</a></div><div class="ttdeci">std::vector< Literal > conflict</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00349">pb_constraint.h:349</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_pb_constraints_html_af7fbbd00f0e631ce361b5ce6636b2017"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_pb_constraints.html#af7fbbd00f0e631ce361b5ce6636b2017">operations_research::sat::PbConstraints::Resize</a></div><div class="ttdeci">void Resize(int num_variables)</div><div class="ttdef"><b>Definition:</b> <a href="pb__constraint_8h_source.html#l00543">pb_constraint.h:543</a></div></div>
|
|
<!-- 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="pb__constraint_8h.html">pb_constraint.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.8.20 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|