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