Files
ortools-clone/docs/cpp/linear__programming__constraint_8h_source.html
2020-12-07 17:47:46 +01:00

758 lines
138 KiB
HTML

<!-- HTML header for doxygen 1.8.18-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.20"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>OR-Tools: linear_programming_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
&#160;<span id="projectnumber">8.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.20 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('linear__programming__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">linear_programming_constraint.h</div> </div>
</div><!--header-->
<div class="contents">
<a href="linear__programming__constraint_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;<span class="comment">// Copyright 2010-2018 Google LLC</span></div>
<div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment">// Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div>
<div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment">// you may not use this file except in compliance with the License.</span></div>
<div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment">// You may obtain a copy of the License at</span></div>
<div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><a name="l00007"></a><span class="lineno"> 7</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<span class="comment">// distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div>
<div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<span class="comment">// See the License for the specific language governing permissions and</span></div>
<div class="line"><a name="l00012"></a><span class="lineno"> 12</span>&#160;<span class="comment">// limitations under the License.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160; </div>
<div class="line"><a name="l00014"></a><span class="lineno"> 14</span>&#160;<span class="preprocessor">#ifndef OR_TOOLS_SAT_LINEAR_PROGRAMMING_CONSTRAINT_H_</span></div>
<div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="preprocessor">#define OR_TOOLS_SAT_LINEAR_PROGRAMMING_CONSTRAINT_H_</span></div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160; </div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="preprocessor">#include &lt;limits&gt;</span></div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;<span class="preprocessor">#include &lt;utility&gt;</span></div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#include &lt;vector&gt;</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160; </div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#include &quot;absl/container/flat_hash_map.h&quot;</span></div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="int__type_8h.html">ortools/base/int_type.h</a>&quot;</span></div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="revised__simplex_8h.html">ortools/glop/revised_simplex.h</a>&quot;</span></div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="lp__data_8h.html">ortools/lp_data/lp_data.h</a>&quot;</span></div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="lp__data__utils_8h.html">ortools/lp_data/lp_data_utils.h</a>&quot;</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="lp__types_8h.html">ortools/lp_data/lp_types.h</a>&quot;</span></div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="cuts_8h.html">ortools/sat/cuts.h</a>&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="implied__bounds_8h.html">ortools/sat/implied_bounds.h</a>&quot;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="integer_8h.html">ortools/sat/integer.h</a>&quot;</span></div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="integer__expr_8h.html">ortools/sat/integer_expr.h</a>&quot;</span></div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="linear__constraint_8h.html">ortools/sat/linear_constraint.h</a>&quot;</span></div>
<div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="linear__constraint__manager_8h.html">ortools/sat/linear_constraint_manager.h</a>&quot;</span></div>
<div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="sat_2model_8h.html">ortools/sat/model.h</a>&quot;</span></div>
<div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="sat_2util_8h.html">ortools/sat/util.h</a>&quot;</span></div>
<div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="zero__half__cuts_8h.html">ortools/sat/zero_half_cuts.h</a>&quot;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="rev_8h.html">ortools/util/rev.h</a>&quot;</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="time__limit_8h.html">ortools/util/time_limit.h</a>&quot;</span></div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; </div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceoperations__research.html">operations_research</a> {</div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160;<span class="keyword">namespace </span>sat {</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>&#160; </div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160;<span class="comment">// Stores for each IntegerVariable its temporary LP solution.</span></div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160;<span class="comment">// This is shared between all LinearProgrammingConstraint because in the corner</span></div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;<span class="comment">// case where we have many different LinearProgrammingConstraint and a lot of</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160;<span class="comment">// variable, we could theoretically use up a quadratic amount of memory</span></div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160;<span class="comment">// otherwise.</span></div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160;<span class="comment">// TODO(user): find a better way?</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_linear_programming_constraint_lp_solution.html"> 50</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structoperations__research_1_1sat_1_1_linear_programming_constraint_lp_solution.html">LinearProgrammingConstraintLpSolution</a></div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; : <span class="keyword">public</span> <a class="code" href="classabsl_1_1_strong_vector.html">absl::StrongVector</a>&lt;IntegerVariable, double&gt; {</div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_linear_programming_constraint_lp_solution.html#a75622490d147ba0ea6c189ec651ea23a"> 52</a></span>&#160; <a class="code" href="structoperations__research_1_1sat_1_1_linear_programming_constraint_lp_solution.html#a75622490d147ba0ea6c189ec651ea23a">LinearProgrammingConstraintLpSolution</a>() {}</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160;};</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; </div>
<div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160;<span class="comment">// Helper struct to combine info generated from solving LP.</span></div>
<div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_l_p_solve_info.html"> 56</a></span>&#160;<span class="keyword">struct </span><a class="code" href="structoperations__research_1_1sat_1_1_l_p_solve_info.html">LPSolveInfo</a> {</div>
<div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_l_p_solve_info.html#a7889399b576072ea3c7b20ab28c46d91"> 57</a></span>&#160; <a class="code" href="namespaceoperations__research_1_1glop.html#ae8a885303349cb7807c7c87b405bc0c9">glop::ProblemStatus</a> <a class="code" href="structoperations__research_1_1sat_1_1_l_p_solve_info.html#a7889399b576072ea3c7b20ab28c46d91">status</a>;</div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_l_p_solve_info.html#a355a72ffc20323940c5c924112cc5bc1"> 58</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="structoperations__research_1_1sat_1_1_l_p_solve_info.html#a355a72ffc20323940c5c924112cc5bc1">lp_objective</a> = -std::numeric_limits&lt;double&gt;::infinity();</div>
<div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="structoperations__research_1_1sat_1_1_l_p_solve_info.html#acfa83ddd00790a21714bc0cacce72607"> 59</a></span>&#160; IntegerValue <a class="code" href="structoperations__research_1_1sat_1_1_l_p_solve_info.html#acfa83ddd00790a21714bc0cacce72607">new_obj_bound</a> = <a class="code" href="namespaceoperations__research_1_1sat.html#a355a62f25cfadeccfb164ab9fb867c81">kMinIntegerValue</a>;</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160;};</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; </div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160;<span class="comment">// Simple class to combine linear expression efficiently. First in a sparse</span></div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;<span class="comment">// way that switch to dense when the number of non-zeros grows.</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html"> 64</a></span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html">ScatteredIntegerVector</a> {</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="comment">// This must be called with the correct size before any other functions are</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="comment">// used.</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html#ab2fc4510692e040b62507dce522e0e31">ClearAndResize</a>(<span class="keywordtype">int</span> size);</div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; <span class="comment">// Does vector[col] += value and return false in case of overflow.</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html#a4940f758f3c0e757a4bcb5bbf795ce67">Add</a>(glop::ColIndex <a class="code" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>, IntegerValue <a class="code" href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a>);</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; </div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="comment">// Similar to Add() but for multiplier * terms.</span></div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="comment">// Returns false in case of overflow.</span></div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html#aeb3044e58e1e28e857c5265734ae7e30">AddLinearExpressionMultiple</a>(</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; IntegerValue multiplier,</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keyword">const</span> std::vector&lt;std::pair&lt;glop::ColIndex, IntegerValue&gt;&gt;&amp; terms);</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; </div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; <span class="comment">// This is not const only because non_zeros is sorted. Note that sorting the</span></div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; <span class="comment">// non-zeros make the result deterministic whether or not we were in sparse</span></div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="comment">// mode.</span></div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="comment">//</span></div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <span class="comment">// TODO(user): Ideally we should convert to IntegerVariable as late as</span></div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="comment">// possible. Prefer to use GetTerms().</span></div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html#a1077b795353fa06d7705f43377bedfe9">ConvertToLinearConstraint</a>(</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keyword">const</span> std::vector&lt;IntegerVariable&gt;&amp; integer_variables,</div>
<div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; IntegerValue upper_bound, <a class="code" href="structoperations__research_1_1sat_1_1_linear_constraint.html">LinearConstraint</a>* result);</div>
<div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; </div>
<div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; <span class="comment">// Similar to ConvertToLinearConstraint().</span></div>
<div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; std::vector&lt;std::pair&lt;glop::ColIndex, IntegerValue&gt;&gt; <a class="code" href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html#abd20bd618d3e097f3b59958764460578">GetTerms</a>();</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; </div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="comment">// We only provide the const [].</span></div>
<div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html#aba8a83cbb3cb1c44665976e7bc596651"> 93</a></span>&#160; IntegerValue <a class="code" href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html#aba8a83cbb3cb1c44665976e7bc596651">operator[]</a>(glop::ColIndex <a class="code" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>)<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; <span class="keywordflow">return</span> dense_vector_[<a class="code" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>];</div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160; }</div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>&#160; </div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>&#160; <span class="keyword">private</span>:</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160; <span class="comment">// If is_sparse is true we maintain the non_zeros positions and bool vector</span></div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>&#160; <span class="comment">// of dense_vector_. Otherwise we don&#39;t. Note that we automatically switch</span></div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>&#160; <span class="comment">// from sparse to dense as needed.</span></div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>&#160; <span class="keywordtype">bool</span> is_sparse_ = <span class="keyword">true</span>;</div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; std::vector&lt;glop::ColIndex&gt; non_zeros_;</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <a class="code" href="classabsl_1_1_strong_vector.html">absl::StrongVector&lt;glop::ColIndex, bool&gt;</a> is_zeros_;</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; </div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; <span class="comment">// The dense representation of the vector.</span></div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160; <a class="code" href="classabsl_1_1_strong_vector.html">absl::StrongVector&lt;glop::ColIndex, IntegerValue&gt;</a> dense_vector_;</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>&#160;};</div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>&#160; </div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160;<span class="comment">// A SAT constraint that enforces a set of linear inequality constraints on</span></div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160;<span class="comment">// integer variables using an LP solver.</span></div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160;<span class="comment">// The propagator uses glop&#39;s revised simplex for feasibility and propagation.</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160;<span class="comment">// It uses the Reduced Cost Strengthening technique, a classic in mixed integer</span></div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160;<span class="comment">// programming, for instance see the thesis of Tobias Achterberg,</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160;<span class="comment">// &quot;Constraint Integer Programming&quot;, sections 7.7 and 8.8, algorithm 7.11.</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160;<span class="comment">// http://nbn-resolving.de/urn:nbn:de:0297-zib-11129</span></div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160;<span class="comment">// Per-constraint bounds propagation is NOT done by this constraint,</span></div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160;<span class="comment">// it should be done by redundant constraints, as reduced cost propagation</span></div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160;<span class="comment">// may miss some filtering.</span></div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160;<span class="comment">// Note that this constraint works with double floating-point numbers, so one</span></div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;<span class="comment">// could be worried that it may filter too much in case of precision issues.</span></div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="comment">// However, by default, we interpret the LP result by recomputing everything</span></div>
<div class="line"><a name="l00125"></a><span class="lineno"> 125</span>&#160;<span class="comment">// in integer arithmetic, so we are exact.</span></div>
<div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160;<span class="keyword">class </span>LinearProgrammingDispatcher;</div>
<div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html"> 127</a></span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html">LinearProgrammingConstraint</a> : <span class="keyword">public</span> <a class="code" href="classoperations__research_1_1sat_1_1_propagator_interface.html">PropagatorInterface</a>,</div>
<div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160; <a class="code" href="classoperations__research_1_1_reversible_interface.html">ReversibleInterface</a> {</div>
<div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a67a7327915e66c0514cfa465a0475be1"> 130</a></span>&#160; <span class="keyword">typedef</span> glop::RowIndex <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a67a7327915e66c0514cfa465a0475be1">ConstraintIndex</a>;</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; </div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="keyword">explicit</span> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a8172ae7d172bec9d3a417ddcaab7c474">LinearProgrammingConstraint</a>(<a class="code" href="classoperations__research_1_1sat_1_1_model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a9128c8abe6a695b34a5fa05169114c39">~LinearProgrammingConstraint</a>() <span class="keyword">override</span>;</div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; </div>
<div class="line"><a name="l00135"></a><span class="lineno"> 135</span>&#160; <span class="comment">// Add a new linear constraint to this LP.</span></div>
<div class="line"><a name="l00136"></a><span class="lineno"> 136</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#aaac2d8dee4d7fc8d5e9a1b1cfc3021bc">AddLinearConstraint</a>(<span class="keyword">const</span> <a class="code" href="structoperations__research_1_1sat_1_1_linear_constraint.html">LinearConstraint</a>&amp; <a class="code" href="demon__profiler_8cc.html#a05da18ca9c7b657a4a6ea24e07c9b695">ct</a>);</div>
<div class="line"><a name="l00137"></a><span class="lineno"> 137</span>&#160; </div>
<div class="line"><a name="l00138"></a><span class="lineno"> 138</span>&#160; <span class="comment">// Set the coefficient of the variable in the objective. Calling it twice will</span></div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <span class="comment">// overwrite the previous value.</span></div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#ae384be06329c4c8f8fd62af7335dae2e">SetObjectiveCoefficient</a>(IntegerVariable ivar, IntegerValue coeff);</div>
<div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; </div>
<div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; <span class="comment">// The main objective variable should be equal to the linear sum of</span></div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="comment">// the arguments passed to SetObjectiveCoefficient().</span></div>
<div class="line"><a name="l00144"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#ae2d5f5508caed13aa3697fd40f89dc71"> 144</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#ae2d5f5508caed13aa3697fd40f89dc71">SetMainObjectiveVariable</a>(IntegerVariable ivar) { objective_cp_ = ivar; }</div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; </div>
<div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <span class="comment">// Register a new cut generator with this constraint.</span></div>
<div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#aefa083730af18963c9bfd9915b5cd187">AddCutGenerator</a>(<a class="code" href="structoperations__research_1_1sat_1_1_cut_generator.html">CutGenerator</a> generator);</div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; </div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; <span class="comment">// Returns the LP value and reduced cost of a variable in the current</span></div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160; <span class="comment">// solution. These functions should only be called when HasSolution() is true.</span></div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="comment">//</span></div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <span class="comment">// Note that this solution is always an OPTIMAL solution of an LP above or</span></div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="comment">// at the current decision level. We &quot;erase&quot; it when we backtrack over it.</span></div>
<div class="line"><a name="l00154"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#ac7edc397b78de116072e89fe0ad89266"> 154</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#ac7edc397b78de116072e89fe0ad89266">HasSolution</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> lp_solution_is_set_; }</div>
<div class="line"><a name="l00155"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a3ec85e67d9b28adc25ba131cf8a09d77"> 155</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a3ec85e67d9b28adc25ba131cf8a09d77">SolutionObjectiveValue</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> lp_objective_; }</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="keywordtype">double</span> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a460fe5216ff7f997841e588d432be744">GetSolutionValue</a>(IntegerVariable variable) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <span class="keywordtype">double</span> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#aeb58dc2ca6b2d8f627b837fcfaa4955a">GetSolutionReducedCost</a>(IntegerVariable variable) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00158"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a700f8f1db38fcb59cab04ff2d75a915f"> 158</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a700f8f1db38fcb59cab04ff2d75a915f">SolutionIsInteger</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> lp_solution_is_integer_; }</div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160; </div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; <span class="comment">// PropagatorInterface API.</span></div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a0010273383670a7c67b3b8f2660aa06b">Propagate</a>() <span class="keyword">override</span>;</div>
<div class="line"><a name="l00162"></a><span class="lineno"> 162</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#aadd64e5df937ad4d29342ef997d6b9fc">IncrementalPropagate</a>(<span class="keyword">const</span> std::vector&lt;int&gt;&amp; watch_indices) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a51cf34a6b42aa05c92f9b0b971b03dc9">RegisterWith</a>(<a class="code" href="classoperations__research_1_1sat_1_1_model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00164"></a><span class="lineno"> 164</span>&#160; </div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="comment">// ReversibleInterface API.</span></div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; <span class="keywordtype">void</span> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#abd4d63996bf53e4b9251cc9fac30040d">SetLevel</a>(<span class="keywordtype">int</span> level) <span class="keyword">override</span>;</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; </div>
<div class="line"><a name="l00168"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a9d3beb2afe4ae647674b054bf29290e2"> 168</a></span>&#160; <span class="keywordtype">int</span> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a9d3beb2afe4ae647674b054bf29290e2">NumVariables</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> integer_variables_.size(); }</div>
<div class="line"><a name="l00169"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#ac912ee1fbcbc9a857e9708236fb1bece"> 169</a></span>&#160; <span class="keyword">const</span> std::vector&lt;IntegerVariable&gt;&amp; <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#ac912ee1fbcbc9a857e9708236fb1bece">integer_variables</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <span class="keywordflow">return</span> integer_variables_;</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; }</div>
<div class="line"><a name="l00172"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a3c19742220492e052d7a85a330df90e6"> 172</a></span>&#160; std::string <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a3c19742220492e052d7a85a330df90e6">DimensionString</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> lp_data_.<a class="code" href="classoperations__research_1_1glop_1_1_linear_program.html#adcc58612f6a1dc35ff3ffdb34188f299">GetDimensionString</a>(); }</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; </div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="comment">// Returns a IntegerLiteral guided by the underlying LP constraints.</span></div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="comment">//</span></div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; <span class="comment">// This looks at all unassigned 0-1 variables, takes the one with</span></div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160; <span class="comment">// a support value closest to 0.5, and tries to assign it to 1.</span></div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; <span class="comment">// If all 0-1 variables have an integer support, returns kNoLiteralIndex.</span></div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; <span class="comment">// Tie-breaking is done using the variable natural order.</span></div>
<div class="line"><a name="l00180"></a><span class="lineno"> 180</span>&#160; <span class="comment">//</span></div>
<div class="line"><a name="l00181"></a><span class="lineno"> 181</span>&#160; <span class="comment">// TODO(user): This fixes to 1, but for some problems fixing to 0</span></div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; <span class="comment">// or to the std::round(support value) might work better. When this is the</span></div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; <span class="comment">// case, change behaviour automatically?</span></div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; std::function&lt;<a class="code" href="structoperations__research_1_1sat_1_1_integer_literal.html">IntegerLiteral</a>()&gt; <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#abe80d18b1ff9d46681da4c752352e53c">HeuristicLpMostInfeasibleBinary</a>(<a class="code" href="classoperations__research_1_1sat_1_1_model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160; </div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; <span class="comment">// Returns a IntegerLiteral guided by the underlying LP constraints.</span></div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; <span class="comment">//</span></div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160; <span class="comment">// This computes the mean of reduced costs over successive calls,</span></div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; <span class="comment">// and tries to fix the variable which has the highest reduced cost.</span></div>
<div class="line"><a name="l00190"></a><span class="lineno"> 190</span>&#160; <span class="comment">// Tie-breaking is done using the variable natural order.</span></div>
<div class="line"><a name="l00191"></a><span class="lineno"> 191</span>&#160; <span class="comment">// Only works for 0/1 variables.</span></div>
<div class="line"><a name="l00192"></a><span class="lineno"> 192</span>&#160; <span class="comment">//</span></div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <span class="comment">// TODO(user): Try to get better pseudocosts than averaging every time</span></div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; <span class="comment">// the heuristic is called. MIP solvers initialize this with strong branching,</span></div>
<div class="line"><a name="l00195"></a><span class="lineno"> 195</span>&#160; <span class="comment">// then keep track of the pseudocosts when doing tree search. Also, this</span></div>
<div class="line"><a name="l00196"></a><span class="lineno"> 196</span>&#160; <span class="comment">// version only branches on var &gt;= 1 and keeps track of reduced costs from var</span></div>
<div class="line"><a name="l00197"></a><span class="lineno"> 197</span>&#160; <span class="comment">// = 1 to var = 0. This works better than the conventional MIP where the</span></div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <span class="comment">// chosen variable will be argmax_var min(pseudocost_var(0-&gt;1),</span></div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; <span class="comment">// pseudocost_var(1-&gt;0)), probably because we are doing DFS search where MIP</span></div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <span class="comment">// does BFS. This might depend on the model, more trials are necessary. We</span></div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <span class="comment">// could also do exponential smoothing instead of decaying every N calls, i.e.</span></div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <span class="comment">// pseudo = a * pseudo + (1-a) reduced.</span></div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; std::function&lt;<a class="code" href="structoperations__research_1_1sat_1_1_integer_literal.html">IntegerLiteral</a>()&gt; <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a874f2f502681d547a666278de20564e3">HeuristicLpReducedCostBinary</a>(<a class="code" href="classoperations__research_1_1sat_1_1_model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; </div>
<div class="line"><a name="l00205"></a><span class="lineno"> 205</span>&#160; <span class="comment">// Returns a IntegerLiteral guided by the underlying LP constraints.</span></div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <span class="comment">//</span></div>
<div class="line"><a name="l00207"></a><span class="lineno"> 207</span>&#160; <span class="comment">// This computes the mean of reduced costs over successive calls,</span></div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160; <span class="comment">// and tries to fix the variable which has the highest reduced cost.</span></div>
<div class="line"><a name="l00209"></a><span class="lineno"> 209</span>&#160; <span class="comment">// Tie-breaking is done using the variable natural order.</span></div>
<div class="line"><a name="l00210"></a><span class="lineno"> 210</span>&#160; std::function&lt;<a class="code" href="structoperations__research_1_1sat_1_1_integer_literal.html">IntegerLiteral</a>()&gt; <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a6ae27451c3238e2af96991a030b7556c">HeuristicLpReducedCostAverageBranching</a>();</div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; </div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; <span class="comment">// Average number of nonbasic variables with zero reduced costs.</span></div>
<div class="line"><a name="l00213"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a0e49aa5d4eabab5cd4c30c0d3498204f"> 213</a></span>&#160; <span class="keywordtype">double</span> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a0e49aa5d4eabab5cd4c30c0d3498204f">average_degeneracy</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00214"></a><span class="lineno"> 214</span>&#160; <span class="keywordflow">return</span> average_degeneracy_.<a class="code" href="classoperations__research_1_1sat_1_1_incremental_average.html#a6d9b473fa04b0558a8e48737f5ab9564">CurrentAverage</a>();</div>
<div class="line"><a name="l00215"></a><span class="lineno"> 215</span>&#160; }</div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; </div>
<div class="line"><a name="l00217"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a72aeb6ccae863ad216aab09435f0c6d0"> 217</a></span>&#160; <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a72aeb6ccae863ad216aab09435f0c6d0">total_num_simplex_iterations</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; <span class="keywordflow">return</span> total_num_simplex_iterations_;</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; }</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; </div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; <span class="keyword">private</span>:</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; <span class="comment">// Helper methods for branching. Returns true if branching on the given</span></div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; <span class="comment">// variable helps with more propagation or finds a conflict.</span></div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; <span class="keywordtype">bool</span> BranchOnVar(IntegerVariable <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>);</div>
<div class="line"><a name="l00225"></a><span class="lineno"> 225</span>&#160; <a class="code" href="structoperations__research_1_1sat_1_1_l_p_solve_info.html">LPSolveInfo</a> SolveLpForBranching();</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; </div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <span class="comment">// Helper method to fill reduced cost / dual ray reason in &#39;integer_reason&#39;.</span></div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="comment">// Generates a set of IntegerLiterals explaining why the best solution can not</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160; <span class="comment">// be improved using reduced costs. This is used to generate explanations for</span></div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <span class="comment">// both infeasibility and bounds deductions.</span></div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; <span class="keywordtype">void</span> FillReducedCostReasonIn(<span class="keyword">const</span> <a class="code" href="classoperations__research_1_1glop_1_1_strict_i_t_i_vector.html">glop::DenseRow</a>&amp; reduced_costs,</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; std::vector&lt;IntegerLiteral&gt;* integer_reason);</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160; </div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; <span class="comment">// Reinitialize the LP from a potentially new set of constraints.</span></div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; <span class="comment">// This fills all data structure and properly rescale the underlying LP.</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; <span class="comment">//</span></div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; <span class="comment">// Returns false if the problem is UNSAT (it can happen when presolve is off</span></div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160; <span class="comment">// and some LP constraint are trivially false).</span></div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; <span class="keywordtype">bool</span> CreateLpFromConstraintManager();</div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; </div>
<div class="line"><a name="l00241"></a><span class="lineno"> 241</span>&#160; <span class="comment">// Solve the LP, returns false if something went wrong in the LP solver.</span></div>
<div class="line"><a name="l00242"></a><span class="lineno"> 242</span>&#160; <span class="keywordtype">bool</span> SolveLp();</div>
<div class="line"><a name="l00243"></a><span class="lineno"> 243</span>&#160; </div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; <span class="comment">// Add a &quot;MIR&quot; cut obtained by first taking the linear combination of the</span></div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; <span class="comment">// row of the matrix according to &quot;integer_multipliers&quot; and then trying</span></div>
<div class="line"><a name="l00246"></a><span class="lineno"> 246</span>&#160; <span class="comment">// some integer rounding heuristic.</span></div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160; <span class="comment">//</span></div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; <span class="comment">// Return true if a new cut was added to the cut manager.</span></div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; <span class="keywordtype">bool</span> AddCutFromConstraints(</div>
<div class="line"><a name="l00250"></a><span class="lineno"> 250</span>&#160; <span class="keyword">const</span> std::string&amp; <a class="code" href="default__search_8cc.html#ac673bc430bdc3fdaa09f7becf98ef267">name</a>,</div>
<div class="line"><a name="l00251"></a><span class="lineno"> 251</span>&#160; <span class="keyword">const</span> std::vector&lt;std::pair&lt;glop::RowIndex, IntegerValue&gt;&gt;&amp;</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160; integer_multipliers);</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; </div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; <span class="comment">// Second half of AddCutFromConstraints().</span></div>
<div class="line"><a name="l00255"></a><span class="lineno"> 255</span>&#160; <span class="keywordtype">bool</span> PostprocessAndAddCut(</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; <span class="keyword">const</span> std::string&amp; <a class="code" href="default__search_8cc.html#ac673bc430bdc3fdaa09f7becf98ef267">name</a>, <span class="keyword">const</span> std::string&amp; info,</div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; IntegerVariable first_new_var, IntegerVariable first_slack,</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <span class="keyword">const</span> std::vector&lt;ImpliedBoundsProcessor::SlackInfo&gt;&amp; ib_slack_infos,</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160; <a class="code" href="structoperations__research_1_1sat_1_1_linear_constraint.html">LinearConstraint</a>* cut);</div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; </div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; <span class="comment">// Computes and adds the corresponding type of cuts.</span></div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; <span class="comment">// This can currently only be called at the root node.</span></div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160; <span class="keywordtype">void</span> AddCGCuts();</div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; <span class="keywordtype">void</span> AddMirCuts();</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; <span class="keywordtype">void</span> AddZeroHalfCuts();</div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; </div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; <span class="comment">// Updates the bounds of the LP variables from the CP bounds.</span></div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160; <span class="keywordtype">void</span> UpdateBoundsOfLpVariables();</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; </div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; <span class="comment">// Use the dual optimal lp values to compute an EXACT lower bound on the</span></div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; <span class="comment">// objective. Fills its reason and perform reduced cost strenghtening.</span></div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; <span class="comment">// Returns false in case of conflict.</span></div>
<div class="line"><a name="l00273"></a><span class="lineno"> 273</span>&#160; <span class="keywordtype">bool</span> ExactLpReasonning();</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; </div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; <span class="comment">// Same as FillDualRayReason() but perform the computation EXACTLY. Returns</span></div>
<div class="line"><a name="l00276"></a><span class="lineno"> 276</span>&#160; <span class="comment">// false in the case that the problem is not provably infeasible with exact</span></div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; <span class="comment">// computations, true otherwise.</span></div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; <span class="keywordtype">bool</span> FillExactDualRayReason();</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; </div>
<div class="line"><a name="l00280"></a><span class="lineno"> 280</span>&#160; <span class="comment">// Returns number of non basic variables with zero reduced costs.</span></div>
<div class="line"><a name="l00281"></a><span class="lineno"> 281</span>&#160; <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> CalculateDegeneracy();</div>
<div class="line"><a name="l00282"></a><span class="lineno"> 282</span>&#160; </div>
<div class="line"><a name="l00283"></a><span class="lineno"> 283</span>&#160; <span class="comment">// From a set of row multipliers (at LP scale), scale them back to the CP</span></div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; <span class="comment">// world and then make them integer (eventually multiplying them by a new</span></div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; <span class="comment">// scaling factor returned in *scaling).</span></div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; <span class="comment">//</span></div>
<div class="line"><a name="l00287"></a><span class="lineno"> 287</span>&#160; <span class="comment">// Note that this will loose some precision, but our subsequent computation</span></div>
<div class="line"><a name="l00288"></a><span class="lineno"> 288</span>&#160; <span class="comment">// will still be exact as it will work for any set of multiplier.</span></div>
<div class="line"><a name="l00289"></a><span class="lineno"> 289</span>&#160; std::vector&lt;std::pair&lt;glop::RowIndex, IntegerValue&gt;&gt; ScaleLpMultiplier(</div>
<div class="line"><a name="l00290"></a><span class="lineno"> 290</span>&#160; <span class="keywordtype">bool</span> take_objective_into_account,</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; <span class="keyword">const</span> <a class="code" href="classoperations__research_1_1glop_1_1_strict_i_t_i_vector.html">glop::DenseColumn</a>&amp; dense_lp_multipliers, <a class="code" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">glop::Fractional</a>* scaling,</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; <span class="keywordtype">int</span> max_pow = 62) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; </div>
<div class="line"><a name="l00294"></a><span class="lineno"> 294</span>&#160; <span class="comment">// Computes from an integer linear combination of the integer rows of the LP a</span></div>
<div class="line"><a name="l00295"></a><span class="lineno"> 295</span>&#160; <span class="comment">// new constraint of the form &quot;sum terms &lt;= upper_bound&quot;. All computation are</span></div>
<div class="line"><a name="l00296"></a><span class="lineno"> 296</span>&#160; <span class="comment">// exact here.</span></div>
<div class="line"><a name="l00297"></a><span class="lineno"> 297</span>&#160; <span class="comment">//</span></div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; <span class="comment">// Returns false if we encountered any integer overflow.</span></div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; <span class="keywordtype">bool</span> ComputeNewLinearConstraint(</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; <span class="keyword">const</span> std::vector&lt;std::pair&lt;glop::RowIndex, IntegerValue&gt;&gt;&amp;</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160; integer_multipliers,</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html">ScatteredIntegerVector</a>* scattered_vector,</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; IntegerValue* upper_bound) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160; </div>
<div class="line"><a name="l00305"></a><span class="lineno"> 305</span>&#160; <span class="comment">// Simple heuristic to try to minimize |upper_bound - ImpliedLB(terms)|. This</span></div>
<div class="line"><a name="l00306"></a><span class="lineno"> 306</span>&#160; <span class="comment">// should make the new constraint tighter and correct a bit the imprecision</span></div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; <span class="comment">// introduced by rounding the floating points values.</span></div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; <span class="keywordtype">void</span> AdjustNewLinearConstraint(</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; std::vector&lt;std::pair&lt;glop::RowIndex, IntegerValue&gt;&gt;* integer_multipliers,</div>
<div class="line"><a name="l00310"></a><span class="lineno"> 310</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html">ScatteredIntegerVector</a>* scattered_vector,</div>
<div class="line"><a name="l00311"></a><span class="lineno"> 311</span>&#160; IntegerValue* upper_bound) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00312"></a><span class="lineno"> 312</span>&#160; </div>
<div class="line"><a name="l00313"></a><span class="lineno"> 313</span>&#160; <span class="comment">// Shortcut for an integer linear expression type.</span></div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; <span class="keyword">using</span> <a class="code" href="structoperations__research_1_1sat_1_1_linear_expression.html">LinearExpression</a> = std::vector&lt;std::pair&lt;glop::ColIndex, IntegerValue&gt;&gt;;</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; </div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; <span class="comment">// Converts a dense represenation of a linear constraint to a sparse one</span></div>
<div class="line"><a name="l00317"></a><span class="lineno"> 317</span>&#160; <span class="comment">// expressed in terms of IntegerVariable.</span></div>
<div class="line"><a name="l00318"></a><span class="lineno"> 318</span>&#160; <span class="keywordtype">void</span> ConvertToLinearConstraint(</div>
<div class="line"><a name="l00319"></a><span class="lineno"> 319</span>&#160; <span class="keyword">const</span> <a class="code" href="classabsl_1_1_strong_vector.html">absl::StrongVector&lt;glop::ColIndex, IntegerValue&gt;</a>&amp; dense_vector,</div>
<div class="line"><a name="l00320"></a><span class="lineno"> 320</span>&#160; IntegerValue upper_bound, <a class="code" href="structoperations__research_1_1sat_1_1_linear_constraint.html">LinearConstraint</a>* result);</div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; </div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; <span class="comment">// Compute the implied lower bound of the given linear expression using the</span></div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; <span class="comment">// current variable bound. Return kMinIntegerValue in case of overflow.</span></div>
<div class="line"><a name="l00324"></a><span class="lineno"> 324</span>&#160; IntegerValue GetImpliedLowerBound(<span class="keyword">const</span> <a class="code" href="structoperations__research_1_1sat_1_1_linear_constraint.html">LinearConstraint</a>&amp; terms) <span class="keyword">const</span>;</div>
<div class="line"><a name="l00325"></a><span class="lineno"> 325</span>&#160; </div>
<div class="line"><a name="l00326"></a><span class="lineno"> 326</span>&#160; <span class="comment">// Tests for possible overflow in the propagation of the given linear</span></div>
<div class="line"><a name="l00327"></a><span class="lineno"> 327</span>&#160; <span class="comment">// constraint.</span></div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160; <span class="keywordtype">bool</span> PossibleOverflow(<span class="keyword">const</span> <a class="code" href="structoperations__research_1_1sat_1_1_linear_constraint.html">LinearConstraint</a>&amp; constraint);</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; </div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160; <span class="comment">// Reduce the coefficient of the constraint so that we cannot have overflow</span></div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160; <span class="comment">// in the propagation of the given linear constraint. Note that we may loose</span></div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>&#160; <span class="comment">// some strength by doing so.</span></div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160; <span class="comment">//</span></div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160; <span class="comment">// We make sure that any partial sum involving any variable value in their</span></div>
<div class="line"><a name="l00335"></a><span class="lineno"> 335</span>&#160; <span class="comment">// domain do not exceed 2 ^ max_pow.</span></div>
<div class="line"><a name="l00336"></a><span class="lineno"> 336</span>&#160; <span class="keywordtype">void</span> PreventOverflow(<a class="code" href="structoperations__research_1_1sat_1_1_linear_constraint.html">LinearConstraint</a>* constraint, <span class="keywordtype">int</span> max_pow = 62);</div>
<div class="line"><a name="l00337"></a><span class="lineno"> 337</span>&#160; </div>
<div class="line"><a name="l00338"></a><span class="lineno"> 338</span>&#160; <span class="comment">// Fills integer_reason_ with the reason for the implied lower bound of the</span></div>
<div class="line"><a name="l00339"></a><span class="lineno"> 339</span>&#160; <span class="comment">// given linear expression. We relax the reason if we have some slack.</span></div>
<div class="line"><a name="l00340"></a><span class="lineno"> 340</span>&#160; <span class="keywordtype">void</span> SetImpliedLowerBoundReason(<span class="keyword">const</span> <a class="code" href="structoperations__research_1_1sat_1_1_linear_constraint.html">LinearConstraint</a>&amp; terms,</div>
<div class="line"><a name="l00341"></a><span class="lineno"> 341</span>&#160; IntegerValue slack);</div>
<div class="line"><a name="l00342"></a><span class="lineno"> 342</span>&#160; </div>
<div class="line"><a name="l00343"></a><span class="lineno"> 343</span>&#160; <span class="comment">// Fills the deductions vector with reduced cost deductions that can be made</span></div>
<div class="line"><a name="l00344"></a><span class="lineno"> 344</span>&#160; <span class="comment">// from the current state of the LP solver. The given delta should be the</span></div>
<div class="line"><a name="l00345"></a><span class="lineno"> 345</span>&#160; <span class="comment">// difference between the cp objective upper bound and lower bound given by</span></div>
<div class="line"><a name="l00346"></a><span class="lineno"> 346</span>&#160; <span class="comment">// the lp.</span></div>
<div class="line"><a name="l00347"></a><span class="lineno"> 347</span>&#160; <span class="keywordtype">void</span> ReducedCostStrengtheningDeductions(<span class="keywordtype">double</span> cp_objective_delta);</div>
<div class="line"><a name="l00348"></a><span class="lineno"> 348</span>&#160; </div>
<div class="line"><a name="l00349"></a><span class="lineno"> 349</span>&#160; <span class="comment">// Returns the variable value on the same scale as the CP variable value.</span></div>
<div class="line"><a name="l00350"></a><span class="lineno"> 350</span>&#160; <a class="code" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">glop::Fractional</a> GetVariableValueAtCpScale(glop::ColIndex <a class="code" href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a>);</div>
<div class="line"><a name="l00351"></a><span class="lineno"> 351</span>&#160; </div>
<div class="line"><a name="l00352"></a><span class="lineno"> 352</span>&#160; <span class="comment">// Gets or creates an LP variable that mirrors a CP variable.</span></div>
<div class="line"><a name="l00353"></a><span class="lineno"> 353</span>&#160; <span class="comment">// The variable should be a positive reference.</span></div>
<div class="line"><a name="l00354"></a><span class="lineno"> 354</span>&#160; glop::ColIndex GetOrCreateMirrorVariable(IntegerVariable positive_variable);</div>
<div class="line"><a name="l00355"></a><span class="lineno"> 355</span>&#160; </div>
<div class="line"><a name="l00356"></a><span class="lineno"> 356</span>&#160; <span class="comment">// This must be called on an OPTIMAL LP and will update the data for</span></div>
<div class="line"><a name="l00357"></a><span class="lineno"> 357</span>&#160; <span class="comment">// LPReducedCostAverageDecision().</span></div>
<div class="line"><a name="l00358"></a><span class="lineno"> 358</span>&#160; <span class="keywordtype">void</span> UpdateAverageReducedCosts();</div>
<div class="line"><a name="l00359"></a><span class="lineno"> 359</span>&#160; </div>
<div class="line"><a name="l00360"></a><span class="lineno"> 360</span>&#160; <span class="comment">// Callback underlying LPReducedCostAverageBranching().</span></div>
<div class="line"><a name="l00361"></a><span class="lineno"> 361</span>&#160; <a class="code" href="structoperations__research_1_1sat_1_1_integer_literal.html">IntegerLiteral</a> LPReducedCostAverageDecision();</div>
<div class="line"><a name="l00362"></a><span class="lineno"> 362</span>&#160; </div>
<div class="line"><a name="l00363"></a><span class="lineno"> 363</span>&#160; <span class="comment">// Updates the simplex iteration limit for the next visit.</span></div>
<div class="line"><a name="l00364"></a><span class="lineno"> 364</span>&#160; <span class="comment">// As per current algorithm, we use a limit which is dependent on size of the</span></div>
<div class="line"><a name="l00365"></a><span class="lineno"> 365</span>&#160; <span class="comment">// problem and drop it significantly if degeneracy is detected. We use</span></div>
<div class="line"><a name="l00366"></a><span class="lineno"> 366</span>&#160; <span class="comment">// DUAL_FEASIBLE status as a signal to correct the prediction. The next limit</span></div>
<div class="line"><a name="l00367"></a><span class="lineno"> 367</span>&#160; <span class="comment">// is capped by &#39;min_iter&#39; and &#39;max_iter&#39;. Note that this is enabled only for</span></div>
<div class="line"><a name="l00368"></a><span class="lineno"> 368</span>&#160; <span class="comment">// linearization level 2 and above.</span></div>
<div class="line"><a name="l00369"></a><span class="lineno"> 369</span>&#160; <span class="keywordtype">void</span> UpdateSimplexIterationLimit(<span class="keyword">const</span> <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> min_iter, <span class="keyword">const</span> <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> max_iter);</div>
<div class="line"><a name="l00370"></a><span class="lineno"> 370</span>&#160; </div>
<div class="line"><a name="l00371"></a><span class="lineno"> 371</span>&#160; <span class="comment">// This epsilon is related to the precision of the value/reduced_cost returned</span></div>
<div class="line"><a name="l00372"></a><span class="lineno"> 372</span>&#160; <span class="comment">// by the LP once they have been scaled back into the CP domain. So for large</span></div>
<div class="line"><a name="l00373"></a><span class="lineno"> 373</span>&#160; <span class="comment">// domain or cost coefficient, we may have some issues.</span></div>
<div class="line"><a name="l00374"></a><span class="lineno"> 374</span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> kCpEpsilon;</div>
<div class="line"><a name="l00375"></a><span class="lineno"> 375</span>&#160; </div>
<div class="line"><a name="l00376"></a><span class="lineno"> 376</span>&#160; <span class="comment">// Same but at the LP scale.</span></div>
<div class="line"><a name="l00377"></a><span class="lineno"> 377</span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">double</span> kLpEpsilon;</div>
<div class="line"><a name="l00378"></a><span class="lineno"> 378</span>&#160; </div>
<div class="line"><a name="l00379"></a><span class="lineno"> 379</span>&#160; <span class="comment">// Class responsible for managing all possible constraints that may be part</span></div>
<div class="line"><a name="l00380"></a><span class="lineno"> 380</span>&#160; <span class="comment">// of the LP.</span></div>
<div class="line"><a name="l00381"></a><span class="lineno"> 381</span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1_linear_constraint_manager.html">LinearConstraintManager</a> constraint_manager_;</div>
<div class="line"><a name="l00382"></a><span class="lineno"> 382</span>&#160; </div>
<div class="line"><a name="l00383"></a><span class="lineno"> 383</span>&#160; <span class="comment">// Initial problem in integer form.</span></div>
<div class="line"><a name="l00384"></a><span class="lineno"> 384</span>&#160; <span class="comment">// We always sort the inner vectors by increasing glop::ColIndex.</span></div>
<div class="line"><a name="l00385"></a><span class="lineno"> 385</span>&#160; <span class="keyword">struct </span>LinearConstraintInternal {</div>
<div class="line"><a name="l00386"></a><span class="lineno"> 386</span>&#160; IntegerValue lb;</div>
<div class="line"><a name="l00387"></a><span class="lineno"> 387</span>&#160; IntegerValue ub;</div>
<div class="line"><a name="l00388"></a><span class="lineno"> 388</span>&#160; <a class="code" href="structoperations__research_1_1sat_1_1_linear_expression.html">LinearExpression</a> terms;</div>
<div class="line"><a name="l00389"></a><span class="lineno"> 389</span>&#160; };</div>
<div class="line"><a name="l00390"></a><span class="lineno"> 390</span>&#160; LinearExpression integer_objective_;</div>
<div class="line"><a name="l00391"></a><span class="lineno"> 391</span>&#160; IntegerValue integer_objective_offset_ = IntegerValue(0);</div>
<div class="line"><a name="l00392"></a><span class="lineno"> 392</span>&#160; IntegerValue objective_infinity_norm_ = IntegerValue(0);</div>
<div class="line"><a name="l00393"></a><span class="lineno"> 393</span>&#160; <a class="code" href="classabsl_1_1_strong_vector.html">absl::StrongVector&lt;glop::RowIndex, LinearConstraintInternal&gt;</a> integer_lp_;</div>
<div class="line"><a name="l00394"></a><span class="lineno"> 394</span>&#160; <a class="code" href="classabsl_1_1_strong_vector.html">absl::StrongVector&lt;glop::RowIndex, IntegerValue&gt;</a> infinity_norms_;</div>
<div class="line"><a name="l00395"></a><span class="lineno"> 395</span>&#160; </div>
<div class="line"><a name="l00396"></a><span class="lineno"> 396</span>&#160; <span class="comment">// Underlying LP solver API.</span></div>
<div class="line"><a name="l00397"></a><span class="lineno"> 397</span>&#160; <a class="code" href="classoperations__research_1_1glop_1_1_linear_program.html">glop::LinearProgram</a> lp_data_;</div>
<div class="line"><a name="l00398"></a><span class="lineno"> 398</span>&#160; <a class="code" href="classoperations__research_1_1glop_1_1_revised_simplex.html">glop::RevisedSimplex</a> simplex_;</div>
<div class="line"><a name="l00399"></a><span class="lineno"> 399</span>&#160; <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> next_simplex_iter_ = 500;</div>
<div class="line"><a name="l00400"></a><span class="lineno"> 400</span>&#160; </div>
<div class="line"><a name="l00401"></a><span class="lineno"> 401</span>&#160; <span class="comment">// For the scaling.</span></div>
<div class="line"><a name="l00402"></a><span class="lineno"> 402</span>&#160; <a class="code" href="classoperations__research_1_1glop_1_1_lp_scaling_helper.html">glop::LpScalingHelper</a> scaler_;</div>
<div class="line"><a name="l00403"></a><span class="lineno"> 403</span>&#160; </div>
<div class="line"><a name="l00404"></a><span class="lineno"> 404</span>&#160; <span class="comment">// Temporary data for cuts.</span></div>
<div class="line"><a name="l00405"></a><span class="lineno"> 405</span>&#160; ZeroHalfCutHelper zero_half_cut_helper_;</div>
<div class="line"><a name="l00406"></a><span class="lineno"> 406</span>&#160; CoverCutHelper cover_cut_helper_;</div>
<div class="line"><a name="l00407"></a><span class="lineno"> 407</span>&#160; IntegerRoundingCutHelper integer_rounding_cut_helper_;</div>
<div class="line"><a name="l00408"></a><span class="lineno"> 408</span>&#160; LinearConstraint cut_;</div>
<div class="line"><a name="l00409"></a><span class="lineno"> 409</span>&#160; </div>
<div class="line"><a name="l00410"></a><span class="lineno"> 410</span>&#160; ScatteredIntegerVector tmp_scattered_vector_;</div>
<div class="line"><a name="l00411"></a><span class="lineno"> 411</span>&#160; </div>
<div class="line"><a name="l00412"></a><span class="lineno"> 412</span>&#160; std::vector&lt;double&gt; tmp_lp_values_;</div>
<div class="line"><a name="l00413"></a><span class="lineno"> 413</span>&#160; std::vector&lt;IntegerValue&gt; tmp_var_lbs_;</div>
<div class="line"><a name="l00414"></a><span class="lineno"> 414</span>&#160; std::vector&lt;IntegerValue&gt; tmp_var_ubs_;</div>
<div class="line"><a name="l00415"></a><span class="lineno"> 415</span>&#160; std::vector&lt;glop::RowIndex&gt; tmp_slack_rows_;</div>
<div class="line"><a name="l00416"></a><span class="lineno"> 416</span>&#160; std::vector&lt;IntegerValue&gt; tmp_slack_bounds_;</div>
<div class="line"><a name="l00417"></a><span class="lineno"> 417</span>&#160; </div>
<div class="line"><a name="l00418"></a><span class="lineno"> 418</span>&#160; <span class="comment">// Structures used for mirroring IntegerVariables inside the underlying LP</span></div>
<div class="line"><a name="l00419"></a><span class="lineno"> 419</span>&#160; <span class="comment">// solver: an integer variable var is mirrored by mirror_lp_variable_[var].</span></div>
<div class="line"><a name="l00420"></a><span class="lineno"> 420</span>&#160; <span class="comment">// Note that these indices are dense in [0, mirror_lp_variable_.size()] so</span></div>
<div class="line"><a name="l00421"></a><span class="lineno"> 421</span>&#160; <span class="comment">// they can be used as vector indices.</span></div>
<div class="line"><a name="l00422"></a><span class="lineno"> 422</span>&#160; <span class="comment">//</span></div>
<div class="line"><a name="l00423"></a><span class="lineno"> 423</span>&#160; <span class="comment">// TODO(user): This should be absl::StrongVector&lt;glop::ColIndex,</span></div>
<div class="line"><a name="l00424"></a><span class="lineno"> 424</span>&#160; <span class="comment">// IntegerVariable&gt;.</span></div>
<div class="line"><a name="l00425"></a><span class="lineno"> 425</span>&#160; std::vector&lt;IntegerVariable&gt; integer_variables_;</div>
<div class="line"><a name="l00426"></a><span class="lineno"> 426</span>&#160; absl::flat_hash_map&lt;IntegerVariable, glop::ColIndex&gt; mirror_lp_variable_;</div>
<div class="line"><a name="l00427"></a><span class="lineno"> 427</span>&#160; </div>
<div class="line"><a name="l00428"></a><span class="lineno"> 428</span>&#160; <span class="comment">// We need to remember what to optimize if an objective is given, because</span></div>
<div class="line"><a name="l00429"></a><span class="lineno"> 429</span>&#160; <span class="comment">// then we will switch the objective between feasibility and optimization.</span></div>
<div class="line"><a name="l00430"></a><span class="lineno"> 430</span>&#160; <span class="keywordtype">bool</span> objective_is_defined_ = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00431"></a><span class="lineno"> 431</span>&#160; IntegerVariable objective_cp_;</div>
<div class="line"><a name="l00432"></a><span class="lineno"> 432</span>&#160; </div>
<div class="line"><a name="l00433"></a><span class="lineno"> 433</span>&#160; <span class="comment">// Singletons from Model.</span></div>
<div class="line"><a name="l00434"></a><span class="lineno"> 434</span>&#160; <span class="keyword">const</span> SatParameters&amp; sat_parameters_;</div>
<div class="line"><a name="l00435"></a><span class="lineno"> 435</span>&#160; Model* model_;</div>
<div class="line"><a name="l00436"></a><span class="lineno"> 436</span>&#160; <a class="code" href="classoperations__research_1_1_time_limit.html">TimeLimit</a>* time_limit_;</div>
<div class="line"><a name="l00437"></a><span class="lineno"> 437</span>&#160; IntegerTrail* integer_trail_;</div>
<div class="line"><a name="l00438"></a><span class="lineno"> 438</span>&#160; <a class="code" href="structoperations__research_1_1_trail.html">Trail</a>* trail_;</div>
<div class="line"><a name="l00439"></a><span class="lineno"> 439</span>&#160; IntegerEncoder* integer_encoder_;</div>
<div class="line"><a name="l00440"></a><span class="lineno"> 440</span>&#160; ModelRandomGenerator* random_;</div>
<div class="line"><a name="l00441"></a><span class="lineno"> 441</span>&#160; </div>
<div class="line"><a name="l00442"></a><span class="lineno"> 442</span>&#160; <span class="comment">// Used while deriving cuts.</span></div>
<div class="line"><a name="l00443"></a><span class="lineno"> 443</span>&#160; ImpliedBoundsProcessor implied_bounds_processor_;</div>
<div class="line"><a name="l00444"></a><span class="lineno"> 444</span>&#160; </div>
<div class="line"><a name="l00445"></a><span class="lineno"> 445</span>&#160; <span class="comment">// The dispatcher for all LP propagators of the model, allows to find which</span></div>
<div class="line"><a name="l00446"></a><span class="lineno"> 446</span>&#160; <span class="comment">// LinearProgrammingConstraint has a given IntegerVariable.</span></div>
<div class="line"><a name="l00447"></a><span class="lineno"> 447</span>&#160; LinearProgrammingDispatcher* dispatcher_;</div>
<div class="line"><a name="l00448"></a><span class="lineno"> 448</span>&#160; </div>
<div class="line"><a name="l00449"></a><span class="lineno"> 449</span>&#160; std::vector&lt;IntegerLiteral&gt; integer_reason_;</div>
<div class="line"><a name="l00450"></a><span class="lineno"> 450</span>&#160; std::vector&lt;IntegerLiteral&gt; deductions_;</div>
<div class="line"><a name="l00451"></a><span class="lineno"> 451</span>&#160; std::vector&lt;IntegerLiteral&gt; deductions_reason_;</div>
<div class="line"><a name="l00452"></a><span class="lineno"> 452</span>&#160; </div>
<div class="line"><a name="l00453"></a><span class="lineno"> 453</span>&#160; <span class="comment">// Repository of IntegerSumLE that needs to be kept around for the lazy</span></div>
<div class="line"><a name="l00454"></a><span class="lineno"> 454</span>&#160; <span class="comment">// reasons. Those are new integer constraint that are created each time we</span></div>
<div class="line"><a name="l00455"></a><span class="lineno"> 455</span>&#160; <span class="comment">// solve the LP to a dual-feasible solution. Propagating these constraints</span></div>
<div class="line"><a name="l00456"></a><span class="lineno"> 456</span>&#160; <span class="comment">// both improve the objective lower bound but also perform reduced cost</span></div>
<div class="line"><a name="l00457"></a><span class="lineno"> 457</span>&#160; <span class="comment">// fixing.</span></div>
<div class="line"><a name="l00458"></a><span class="lineno"> 458</span>&#160; <span class="keywordtype">int</span> rev_optimal_constraints_size_ = 0;</div>
<div class="line"><a name="l00459"></a><span class="lineno"> 459</span>&#160; std::vector&lt;std::unique_ptr&lt;IntegerSumLE&gt;&gt; optimal_constraints_;</div>
<div class="line"><a name="l00460"></a><span class="lineno"> 460</span>&#160; </div>
<div class="line"><a name="l00461"></a><span class="lineno"> 461</span>&#160; <span class="comment">// Last OPTIMAL solution found by a call to the underlying LP solver.</span></div>
<div class="line"><a name="l00462"></a><span class="lineno"> 462</span>&#160; <span class="comment">// On IncrementalPropagate(), if the bound updates do not invalidate this</span></div>
<div class="line"><a name="l00463"></a><span class="lineno"> 463</span>&#160; <span class="comment">// solution, Propagate() will not find domain reductions, no need to call it.</span></div>
<div class="line"><a name="l00464"></a><span class="lineno"> 464</span>&#160; <span class="keywordtype">int</span> lp_solution_level_ = 0;</div>
<div class="line"><a name="l00465"></a><span class="lineno"> 465</span>&#160; <span class="keywordtype">bool</span> lp_solution_is_set_ = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00466"></a><span class="lineno"> 466</span>&#160; <span class="keywordtype">bool</span> lp_solution_is_integer_ = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00467"></a><span class="lineno"> 467</span>&#160; <span class="keywordtype">double</span> lp_objective_;</div>
<div class="line"><a name="l00468"></a><span class="lineno"> 468</span>&#160; std::vector&lt;double&gt; lp_solution_;</div>
<div class="line"><a name="l00469"></a><span class="lineno"> 469</span>&#160; std::vector&lt;double&gt; lp_reduced_cost_;</div>
<div class="line"><a name="l00470"></a><span class="lineno"> 470</span>&#160; </div>
<div class="line"><a name="l00471"></a><span class="lineno"> 471</span>&#160; <span class="comment">// If non-empty, this is the last known optimal lp solution at root-node. If</span></div>
<div class="line"><a name="l00472"></a><span class="lineno"> 472</span>&#160; <span class="comment">// the variable bounds changed, or cuts where added, it is possible that this</span></div>
<div class="line"><a name="l00473"></a><span class="lineno"> 473</span>&#160; <span class="comment">// solution is no longer optimal though.</span></div>
<div class="line"><a name="l00474"></a><span class="lineno"> 474</span>&#160; std::vector&lt;double&gt; level_zero_lp_solution_;</div>
<div class="line"><a name="l00475"></a><span class="lineno"> 475</span>&#160; </div>
<div class="line"><a name="l00476"></a><span class="lineno"> 476</span>&#160; <span class="comment">// True if the last time we solved the exact same LP at level zero, no cuts</span></div>
<div class="line"><a name="l00477"></a><span class="lineno"> 477</span>&#160; <span class="comment">// and no lazy constraints where added.</span></div>
<div class="line"><a name="l00478"></a><span class="lineno"> 478</span>&#160; <span class="keywordtype">bool</span> lp_at_level_zero_is_final_ = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00479"></a><span class="lineno"> 479</span>&#160; </div>
<div class="line"><a name="l00480"></a><span class="lineno"> 480</span>&#160; <span class="comment">// Same as lp_solution_ but this vector is indexed differently.</span></div>
<div class="line"><a name="l00481"></a><span class="lineno"> 481</span>&#160; LinearProgrammingConstraintLpSolution&amp; expanded_lp_solution_;</div>
<div class="line"><a name="l00482"></a><span class="lineno"> 482</span>&#160; </div>
<div class="line"><a name="l00483"></a><span class="lineno"> 483</span>&#160; <span class="comment">// Linear constraints cannot be created or modified after this is registered.</span></div>
<div class="line"><a name="l00484"></a><span class="lineno"> 484</span>&#160; <span class="keywordtype">bool</span> lp_constraint_is_registered_ = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00485"></a><span class="lineno"> 485</span>&#160; </div>
<div class="line"><a name="l00486"></a><span class="lineno"> 486</span>&#160; std::vector&lt;CutGenerator&gt; cut_generators_;</div>
<div class="line"><a name="l00487"></a><span class="lineno"> 487</span>&#160; </div>
<div class="line"><a name="l00488"></a><span class="lineno"> 488</span>&#160; <span class="comment">// Store some statistics for HeuristicLPReducedCostAverage().</span></div>
<div class="line"><a name="l00489"></a><span class="lineno"> 489</span>&#160; <span class="keywordtype">bool</span> compute_reduced_cost_averages_ = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00490"></a><span class="lineno"> 490</span>&#160; <span class="keywordtype">int</span> num_calls_since_reduced_cost_averages_reset_ = 0;</div>
<div class="line"><a name="l00491"></a><span class="lineno"> 491</span>&#160; std::vector&lt;double&gt; sum_cost_up_;</div>
<div class="line"><a name="l00492"></a><span class="lineno"> 492</span>&#160; std::vector&lt;double&gt; sum_cost_down_;</div>
<div class="line"><a name="l00493"></a><span class="lineno"> 493</span>&#160; std::vector&lt;int&gt; num_cost_up_;</div>
<div class="line"><a name="l00494"></a><span class="lineno"> 494</span>&#160; std::vector&lt;int&gt; num_cost_down_;</div>
<div class="line"><a name="l00495"></a><span class="lineno"> 495</span>&#160; std::vector&lt;double&gt; rc_scores_;</div>
<div class="line"><a name="l00496"></a><span class="lineno"> 496</span>&#160; </div>
<div class="line"><a name="l00497"></a><span class="lineno"> 497</span>&#160; <span class="comment">// All the entries before rev_rc_start_ in the sorted positions correspond</span></div>
<div class="line"><a name="l00498"></a><span class="lineno"> 498</span>&#160; <span class="comment">// to fixed variables and can be ignored.</span></div>
<div class="line"><a name="l00499"></a><span class="lineno"> 499</span>&#160; <span class="keywordtype">int</span> rev_rc_start_ = 0;</div>
<div class="line"><a name="l00500"></a><span class="lineno"> 500</span>&#160; <a class="code" href="classoperations__research_1_1_rev_repository.html">RevRepository&lt;int&gt;</a> rc_rev_int_repository_;</div>
<div class="line"><a name="l00501"></a><span class="lineno"> 501</span>&#160; std::vector&lt;std::pair&lt;double, int&gt;&gt; positions_by_decreasing_rc_score_;</div>
<div class="line"><a name="l00502"></a><span class="lineno"> 502</span>&#160; </div>
<div class="line"><a name="l00503"></a><span class="lineno"> 503</span>&#160; <span class="comment">// Defined as average number of nonbasic variables with zero reduced costs.</span></div>
<div class="line"><a name="l00504"></a><span class="lineno"> 504</span>&#160; IncrementalAverage average_degeneracy_;</div>
<div class="line"><a name="l00505"></a><span class="lineno"> 505</span>&#160; <span class="keywordtype">bool</span> is_degenerate_ = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00506"></a><span class="lineno"> 506</span>&#160; </div>
<div class="line"><a name="l00507"></a><span class="lineno"> 507</span>&#160; <span class="comment">// Used by the strong branching heuristic.</span></div>
<div class="line"><a name="l00508"></a><span class="lineno"> 508</span>&#160; <span class="keywordtype">int</span> branching_frequency_ = 1;</div>
<div class="line"><a name="l00509"></a><span class="lineno"> 509</span>&#160; <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> count_since_last_branching_ = 0;</div>
<div class="line"><a name="l00510"></a><span class="lineno"> 510</span>&#160; </div>
<div class="line"><a name="l00511"></a><span class="lineno"> 511</span>&#160; <span class="comment">// Sum of all simplex iterations performed by this class. This is useful to</span></div>
<div class="line"><a name="l00512"></a><span class="lineno"> 512</span>&#160; <span class="comment">// test the incrementality and compare to other solvers.</span></div>
<div class="line"><a name="l00513"></a><span class="lineno"> 513</span>&#160; <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> total_num_simplex_iterations_ = 0;</div>
<div class="line"><a name="l00514"></a><span class="lineno"> 514</span>&#160; </div>
<div class="line"><a name="l00515"></a><span class="lineno"> 515</span>&#160; <span class="comment">// Some stats on the LP statuses encountered.</span></div>
<div class="line"><a name="l00516"></a><span class="lineno"> 516</span>&#160; std::vector&lt;int64&gt; num_solves_by_status_;</div>
<div class="line"><a name="l00517"></a><span class="lineno"> 517</span>&#160;};</div>
<div class="line"><a name="l00518"></a><span class="lineno"> 518</span>&#160; </div>
<div class="line"><a name="l00519"></a><span class="lineno"> 519</span>&#160;<span class="comment">// A class that stores which LP propagator is associated to each variable.</span></div>
<div class="line"><a name="l00520"></a><span class="lineno"> 520</span>&#160;<span class="comment">// We need to give the hash_map a name so it can be used as a singleton in our</span></div>
<div class="line"><a name="l00521"></a><span class="lineno"> 521</span>&#160;<span class="comment">// model.</span></div>
<div class="line"><a name="l00522"></a><span class="lineno"> 522</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00523"></a><span class="lineno"> 523</span>&#160;<span class="comment">// Important: only positive variable do appear here.</span></div>
<div class="line"><a name="l00524"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_linear_programming_dispatcher.html"> 524</a></span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_dispatcher.html">LinearProgrammingDispatcher</a></div>
<div class="line"><a name="l00525"></a><span class="lineno"> 525</span>&#160; : <span class="keyword">public</span> absl::flat_hash_map&lt;IntegerVariable,</div>
<div class="line"><a name="l00526"></a><span class="lineno"> 526</span>&#160; LinearProgrammingConstraint*&gt; {</div>
<div class="line"><a name="l00527"></a><span class="lineno"> 527</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00528"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_linear_programming_dispatcher.html#a6ca8f8510095f447efa72b17967f2ecf"> 528</a></span>&#160; <span class="keyword">explicit</span> <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_dispatcher.html#a6ca8f8510095f447efa72b17967f2ecf">LinearProgrammingDispatcher</a>(<a class="code" href="classoperations__research_1_1sat_1_1_model.html">Model</a>* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>) {}</div>
<div class="line"><a name="l00529"></a><span class="lineno"> 529</span>&#160;};</div>
<div class="line"><a name="l00530"></a><span class="lineno"> 530</span>&#160; </div>
<div class="line"><a name="l00531"></a><span class="lineno"> 531</span>&#160;<span class="comment">// A class that stores the collection of all LP constraints in a model.</span></div>
<div class="line"><a name="l00532"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_linear_programming_constraint_collection.html"> 532</a></span>&#160;<span class="keyword">class </span><a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint_collection.html">LinearProgrammingConstraintCollection</a></div>
<div class="line"><a name="l00533"></a><span class="lineno"> 533</span>&#160; : <span class="keyword">public</span> std::vector&lt;LinearProgrammingConstraint*&gt; {</div>
<div class="line"><a name="l00534"></a><span class="lineno"> 534</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00535"></a><span class="lineno"><a class="line" href="classoperations__research_1_1sat_1_1_linear_programming_constraint_collection.html#a18fd2d827c0daee60b8eddee4144a13a"> 535</a></span>&#160; <a class="code" href="classoperations__research_1_1sat_1_1_linear_programming_constraint_collection.html#a18fd2d827c0daee60b8eddee4144a13a">LinearProgrammingConstraintCollection</a>() {}</div>
<div class="line"><a name="l00536"></a><span class="lineno"> 536</span>&#160;};</div>
<div class="line"><a name="l00537"></a><span class="lineno"> 537</span>&#160; </div>
<div class="line"><a name="l00538"></a><span class="lineno"> 538</span>&#160;<span class="comment">// Cut generator for the circuit constraint, where in any feasible solution, the</span></div>
<div class="line"><a name="l00539"></a><span class="lineno"> 539</span>&#160;<span class="comment">// arcs that are present (variable at 1) must form a circuit through all the</span></div>
<div class="line"><a name="l00540"></a><span class="lineno"> 540</span>&#160;<span class="comment">// nodes of the graph. Self arc are forbidden in this case.</span></div>
<div class="line"><a name="l00541"></a><span class="lineno"> 541</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00542"></a><span class="lineno"> 542</span>&#160;<span class="comment">// In more generality, this currently enforce the resulting graph to be strongly</span></div>
<div class="line"><a name="l00543"></a><span class="lineno"> 543</span>&#160;<span class="comment">// connected. Note that we already assume basic constraint to be in the lp, so</span></div>
<div class="line"><a name="l00544"></a><span class="lineno"> 544</span>&#160;<span class="comment">// we do not add any cuts for components of size 1.</span></div>
<div class="line"><a name="l00545"></a><span class="lineno"> 545</span>&#160;CutGenerator <a class="code" href="namespaceoperations__research_1_1sat.html#ae9e5d88686fd52d3bd1a89d7754ca18c">CreateStronglyConnectedGraphCutGenerator</a>(</div>
<div class="line"><a name="l00546"></a><span class="lineno"> 546</span>&#160; <span class="keywordtype">int</span> num_nodes, <span class="keyword">const</span> std::vector&lt;int&gt;&amp; tails, <span class="keyword">const</span> std::vector&lt;int&gt;&amp; heads,</div>
<div class="line"><a name="l00547"></a><span class="lineno"> 547</span>&#160; <span class="keyword">const</span> std::vector&lt;Literal&gt;&amp; literals, Model* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00548"></a><span class="lineno"> 548</span>&#160; </div>
<div class="line"><a name="l00549"></a><span class="lineno"> 549</span>&#160;<span class="comment">// Almost the same as CreateStronglyConnectedGraphCutGenerator() but for each</span></div>
<div class="line"><a name="l00550"></a><span class="lineno"> 550</span>&#160;<span class="comment">// components, computes the demand needed to serves it, and depending on whether</span></div>
<div class="line"><a name="l00551"></a><span class="lineno"> 551</span>&#160;<span class="comment">// it contains the depot (node zero) or not, compute the minimum number of</span></div>
<div class="line"><a name="l00552"></a><span class="lineno"> 552</span>&#160;<span class="comment">// vehicle that needs to cross the component border.</span></div>
<div class="line"><a name="l00553"></a><span class="lineno"> 553</span>&#160;CutGenerator <a class="code" href="namespaceoperations__research_1_1sat.html#a83551f805175c3a30ea146efaad2ec63">CreateCVRPCutGenerator</a>(<span class="keywordtype">int</span> num_nodes,</div>
<div class="line"><a name="l00554"></a><span class="lineno"> 554</span>&#160; <span class="keyword">const</span> std::vector&lt;int&gt;&amp; tails,</div>
<div class="line"><a name="l00555"></a><span class="lineno"> 555</span>&#160; <span class="keyword">const</span> std::vector&lt;int&gt;&amp; heads,</div>
<div class="line"><a name="l00556"></a><span class="lineno"> 556</span>&#160; <span class="keyword">const</span> std::vector&lt;Literal&gt;&amp; literals,</div>
<div class="line"><a name="l00557"></a><span class="lineno"> 557</span>&#160; <span class="keyword">const</span> std::vector&lt;int64&gt;&amp; demands,</div>
<div class="line"><a name="l00558"></a><span class="lineno"> 558</span>&#160; <a class="code" href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a> <a class="code" href="routing__flow_8cc.html#adf3be22c64f10c0783c0cf277e857adf">capacity</a>, Model* <a class="code" href="gurobi__interface_8cc.html#a0728f23c9a47655d38e0bf1a2f200bcf">model</a>);</div>
<div class="line"><a name="l00559"></a><span class="lineno"> 559</span>&#160;} <span class="comment">// namespace sat</span></div>
<div class="line"><a name="l00560"></a><span class="lineno"> 560</span>&#160;} <span class="comment">// namespace operations_research</span></div>
<div class="line"><a name="l00561"></a><span class="lineno"> 561</span>&#160; </div>
<div class="line"><a name="l00562"></a><span class="lineno"> 562</span>&#160;<span class="preprocessor">#endif // OR_TOOLS_SAT_LINEAR_PROGRAMMING_CONSTRAINT_H_</span></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aexpr__array_8cc_html_a472a99923cbe11ae7b5a5d157d9ad465"><div class="ttname"><a href="expr__array_8cc.html#a472a99923cbe11ae7b5a5d157d9ad465">var</a></div><div class="ttdeci">IntVar * var</div><div class="ttdef"><b>Definition:</b> <a href="expr__array_8cc_source.html#l01858">expr_array.cc:1858</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_a460fe5216ff7f997841e588d432be744"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a460fe5216ff7f997841e588d432be744">operations_research::sat::LinearProgrammingConstraint::GetSolutionValue</a></div><div class="ttdeci">double GetSolutionValue(IntegerVariable variable) const</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l00626">linear_programming_constraint.cc:626</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1_l_p_solve_info_html_a7889399b576072ea3c7b20ab28c46d91"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_l_p_solve_info.html#a7889399b576072ea3c7b20ab28c46d91">operations_research::sat::LPSolveInfo::status</a></div><div class="ttdeci">glop::ProblemStatus status</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00057">linear_programming_constraint.h:57</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_collection_html_a18fd2d827c0daee60b8eddee4144a13a"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint_collection.html#a18fd2d827c0daee60b8eddee4144a13a">operations_research::sat::LinearProgrammingConstraintCollection::LinearProgrammingConstraintCollection</a></div><div class="ttdeci">LinearProgrammingConstraintCollection()</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00535">linear_programming_constraint.h:535</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_ac7edc397b78de116072e89fe0ad89266"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#ac7edc397b78de116072e89fe0ad89266">operations_research::sat::LinearProgrammingConstraint::HasSolution</a></div><div class="ttdeci">bool HasSolution() const</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00154">linear_programming_constraint.h:154</a></div></div>
<div class="ttc" id="atime__limit_8h_html"><div class="ttname"><a href="time__limit_8h.html">time_limit.h</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_a67a7327915e66c0514cfa465a0475be1"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a67a7327915e66c0514cfa465a0475be1">operations_research::sat::LinearProgrammingConstraint::ConstraintIndex</a></div><div class="ttdeci">glop::RowIndex ConstraintIndex</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00130">linear_programming_constraint.h:130</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1_cut_generator_html"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_cut_generator.html">operations_research::sat::CutGenerator</a></div><div class="ttdef"><b>Definition:</b> <a href="cuts_8h_source.html#l00040">cuts.h:40</a></div></div>
<div class="ttc" id="alp__data_8h_html"><div class="ttname"><a href="lp__data_8h.html">lp_data.h</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_aeb58dc2ca6b2d8f627b837fcfaa4955a"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#aeb58dc2ca6b2d8f627b837fcfaa4955a">operations_research::sat::LinearProgrammingConstraint::GetSolutionReducedCost</a></div><div class="ttdeci">double GetSolutionReducedCost(IntegerVariable variable) const</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l00631">linear_programming_constraint.cc:631</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_ae9e5d88686fd52d3bd1a89d7754ca18c"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#ae9e5d88686fd52d3bd1a89d7754ca18c">operations_research::sat::CreateStronglyConnectedGraphCutGenerator</a></div><div class="ttdeci">CutGenerator CreateStronglyConnectedGraphCutGenerator(int num_nodes, const std::vector&lt; int &gt; &amp;tails, const std::vector&lt; int &gt; &amp;heads, const std::vector&lt; Literal &gt; &amp;literals, Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l02512">linear_programming_constraint.cc:2512</a></div></div>
<div class="ttc" id="alinear__constraint_8h_html"><div class="ttname"><a href="linear__constraint_8h.html">linear_constraint.h</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_ae2d5f5508caed13aa3697fd40f89dc71"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#ae2d5f5508caed13aa3697fd40f89dc71">operations_research::sat::LinearProgrammingConstraint::SetMainObjectiveVariable</a></div><div class="ttdeci">void SetMainObjectiveVariable(IntegerVariable ivar)</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00144">linear_programming_constraint.h:144</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_propagator_interface_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_propagator_interface.html">operations_research::sat::PropagatorInterface</a></div><div class="ttdef"><b>Definition:</b> <a href="integer_8h_source.html#l01043">integer.h:1043</a></div></div>
<div class="ttc" id="ademon__profiler_8cc_html_a21edc7ca4cc5802c8779d68556bc09cf"><div class="ttname"><a href="demon__profiler_8cc.html#a21edc7ca4cc5802c8779d68556bc09cf">value</a></div><div class="ttdeci">int64 value</div><div class="ttdef"><b>Definition:</b> <a href="demon__profiler_8cc_source.html#l00043">demon_profiler.cc:43</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_scattered_integer_vector_html_a1077b795353fa06d7705f43377bedfe9"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html#a1077b795353fa06d7705f43377bedfe9">operations_research::sat::ScatteredIntegerVector::ConvertToLinearConstraint</a></div><div class="ttdeci">void ConvertToLinearConstraint(const std::vector&lt; IntegerVariable &gt; &amp;integer_variables, IntegerValue upper_bound, LinearConstraint *result)</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l00109">linear_programming_constraint.cc:109</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_a9128c8abe6a695b34a5fa05169114c39"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a9128c8abe6a695b34a5fa05169114c39">operations_research::sat::LinearProgrammingConstraint::~LinearProgrammingConstraint</a></div><div class="ttdeci">~LinearProgrammingConstraint() override</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l00183">linear_programming_constraint.cc:183</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1_rev_repository_html"><div class="ttname"><a href="classoperations__research_1_1_rev_repository.html">operations_research::RevRepository&lt; int &gt;</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="anamespaceoperations__research_html"><div class="ttname"><a href="namespaceoperations__research.html">operations_research</a></div><div class="ttdoc">The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...</div><div class="ttdef"><b>Definition:</b> <a href="dense__doubly__linked__list_8h_source.html#l00021">dense_doubly_linked_list.h:21</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_a51cf34a6b42aa05c92f9b0b971b03dc9"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a51cf34a6b42aa05c92f9b0b971b03dc9">operations_research::sat::LinearProgrammingConstraint::RegisterWith</a></div><div class="ttdeci">void RegisterWith(Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l00523">linear_programming_constraint.cc:523</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_aadd64e5df937ad4d29342ef997d6b9fc"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#aadd64e5df937ad4d29342ef997d6b9fc">operations_research::sat::LinearProgrammingConstraint::IncrementalPropagate</a></div><div class="ttdeci">bool IncrementalPropagate(const std::vector&lt; int &gt; &amp;watch_indices) override</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l00589">linear_programming_constraint.cc:589</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_dispatcher_html_a6ca8f8510095f447efa72b17967f2ecf"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_dispatcher.html#a6ca8f8510095f447efa72b17967f2ecf">operations_research::sat::LinearProgrammingDispatcher::LinearProgrammingDispatcher</a></div><div class="ttdeci">LinearProgrammingDispatcher(Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00528">linear_programming_constraint.h:528</a></div></div>
<div class="ttc" id="aintegral__types_8h_html_a7cde0074dfd288f2d70c0e035dacb28a"><div class="ttname"><a href="integral__types_8h.html#a7cde0074dfd288f2d70c0e035dacb28a">int64</a></div><div class="ttdeci">int64_t int64</div><div class="ttdef"><b>Definition:</b> <a href="integral__types_8h_source.html#l00034">integral_types.h:34</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_incremental_average_html_a6d9b473fa04b0558a8e48737f5ab9564"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_incremental_average.html#a6d9b473fa04b0558a8e48737f5ab9564">operations_research::sat::IncrementalAverage::CurrentAverage</a></div><div class="ttdeci">double CurrentAverage() const</div><div class="ttdef"><b>Definition:</b> <a href="sat_2util_8h_source.html#l00113">sat/util.h:113</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1_time_limit_html"><div class="ttname"><a href="classoperations__research_1_1_time_limit.html">operations_research::TimeLimit</a></div><div class="ttdoc">A simple class to enforce both an elapsed time limit and a deterministic time limit in the same threa...</div><div class="ttdef"><b>Definition:</b> <a href="time__limit_8h_source.html#l00105">time_limit.h:105</a></div></div>
<div class="ttc" id="arevised__simplex_8h_html"><div class="ttname"><a href="revised__simplex_8h.html">revised_simplex.h</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1glop_html_a733947145e3e1631165b618b05c9ccb7"><div class="ttname"><a href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">operations_research::glop::Fractional</a></div><div class="ttdeci">double Fractional</div><div class="ttdef"><b>Definition:</b> <a href="lp__types_8h_source.html#l00077">lp_types.h:77</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_scattered_integer_vector_html_abd20bd618d3e097f3b59958764460578"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html#abd20bd618d3e097f3b59958764460578">operations_research::sat::ScatteredIntegerVector::GetTerms</a></div><div class="ttdeci">std::vector&lt; std::pair&lt; glop::ColIndex, IntegerValue &gt; &gt; GetTerms()</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l00136">linear_programming_constraint.cc:136</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_scattered_integer_vector_html_ab2fc4510692e040b62507dce522e0e31"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html#ab2fc4510692e040b62507dce522e0e31">operations_research::sat::ScatteredIntegerVector::ClearAndResize</a></div><div class="ttdeci">void ClearAndResize(int size)</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l00053">linear_programming_constraint.cc:53</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_constraint_manager_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_constraint_manager.html">operations_research::sat::LinearConstraintManager</a></div><div class="ttdef"><b>Definition:</b> <a href="linear__constraint__manager_8h_source.html#l00040">linear_constraint_manager.h:40</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1_linear_constraint_html"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_linear_constraint.html">operations_research::sat::LinearConstraint</a></div><div class="ttdef"><b>Definition:</b> <a href="linear__constraint_8h_source.html#l00039">linear_constraint.h:39</a></div></div>
<div class="ttc" id="alp__data__utils_8h_html"><div class="ttname"><a href="lp__data__utils_8h.html">lp_data_utils.h</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1_l_p_solve_info_html_acfa83ddd00790a21714bc0cacce72607"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_l_p_solve_info.html#acfa83ddd00790a21714bc0cacce72607">operations_research::sat::LPSolveInfo::new_obj_bound</a></div><div class="ttdeci">IntegerValue new_obj_bound</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00059">linear_programming_constraint.h:59</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_revised_simplex_html"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_revised_simplex.html">operations_research::glop::RevisedSimplex</a></div><div class="ttdef"><b>Definition:</b> <a href="revised__simplex_8h_source.html#l00147">revised_simplex.h:147</a></div></div>
<div class="ttc" id="aint__type_8h_html"><div class="ttname"><a href="int__type_8h.html">int_type.h</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_a3ec85e67d9b28adc25ba131cf8a09d77"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a3ec85e67d9b28adc25ba131cf8a09d77">operations_research::sat::LinearProgrammingConstraint::SolutionObjectiveValue</a></div><div class="ttdeci">double SolutionObjectiveValue() const</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00155">linear_programming_constraint.h:155</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_abd4d63996bf53e4b9251cc9fac30040d"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#abd4d63996bf53e4b9251cc9fac30040d">operations_research::sat::LinearProgrammingConstraint::SetLevel</a></div><div class="ttdeci">void SetLevel(int level) override</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l00559">linear_programming_constraint.cc:559</a></div></div>
<div class="ttc" id="ainteger__expr_8h_html"><div class="ttname"><a href="integer__expr_8h.html">integer_expr.h</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_lp_scaling_helper_html"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_lp_scaling_helper.html">operations_research::glop::LpScalingHelper</a></div><div class="ttdef"><b>Definition:</b> <a href="lp__data__utils_8h_source.html#l00051">lp_data_utils.h:51</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_strict_i_t_i_vector_html"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_strict_i_t_i_vector.html">operations_research::glop::StrictITIVector&lt; ColIndex, Fractional &gt;</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1_linear_expression_html"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_linear_expression.html">operations_research::sat::LinearExpression</a></div><div class="ttdef"><b>Definition:</b> <a href="linear__constraint_8h_source.html#l00173">linear_constraint.h:173</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_model_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_model.html">operations_research::sat::Model</a></div><div class="ttdoc">Class that owns everything related to a particular optimization model.</div><div class="ttdef"><b>Definition:</b> <a href="sat_2model_8h_source.html#l00038">sat/model.h:38</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_a9d3beb2afe4ae647674b054bf29290e2"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a9d3beb2afe4ae647674b054bf29290e2">operations_research::sat::LinearProgrammingConstraint::NumVariables</a></div><div class="ttdeci">int NumVariables() const</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00168">linear_programming_constraint.h:168</a></div></div>
<div class="ttc" id="ademon__profiler_8cc_html_a05da18ca9c7b657a4a6ea24e07c9b695"><div class="ttname"><a href="demon__profiler_8cc.html#a05da18ca9c7b657a4a6ea24e07c9b695">ct</a></div><div class="ttdeci">const Constraint * ct</div><div class="ttdef"><b>Definition:</b> <a href="demon__profiler_8cc_source.html#l00042">demon_profiler.cc:42</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1_integer_literal_html"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_integer_literal.html">operations_research::sat::IntegerLiteral</a></div><div class="ttdef"><b>Definition:</b> <a href="integer_8h_source.html#l00153">integer.h:153</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_a72aeb6ccae863ad216aab09435f0c6d0"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a72aeb6ccae863ad216aab09435f0c6d0">operations_research::sat::LinearProgrammingConstraint::total_num_simplex_iterations</a></div><div class="ttdeci">int64 total_num_simplex_iterations() const</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00217">linear_programming_constraint.h:217</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_collection_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint_collection.html">operations_research::sat::LinearProgrammingConstraintCollection</a></div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00532">linear_programming_constraint.h:533</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_scattered_integer_vector_html_aeb3044e58e1e28e857c5265734ae7e30"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html#aeb3044e58e1e28e857c5265734ae7e30">operations_research::sat::ScatteredIntegerVector::AddLinearExpressionMultiple</a></div><div class="ttdeci">bool AddLinearExpressionMultiple(IntegerValue multiplier, const std::vector&lt; std::pair&lt; glop::ColIndex, IntegerValue &gt;&gt; &amp;terms)</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l00081">linear_programming_constraint.cc:81</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_scattered_integer_vector_html_aba8a83cbb3cb1c44665976e7bc596651"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html#aba8a83cbb3cb1c44665976e7bc596651">operations_research::sat::ScatteredIntegerVector::operator[]</a></div><div class="ttdeci">IntegerValue operator[](glop::ColIndex col) const</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00093">linear_programming_constraint.h:93</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1_linear_programming_constraint_lp_solution_html"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_linear_programming_constraint_lp_solution.html">operations_research::sat::LinearProgrammingConstraintLpSolution</a></div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00050">linear_programming_constraint.h:51</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1_l_p_solve_info_html"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_l_p_solve_info.html">operations_research::sat::LPSolveInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00056">linear_programming_constraint.h:56</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_a3c19742220492e052d7a85a330df90e6"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a3c19742220492e052d7a85a330df90e6">operations_research::sat::LinearProgrammingConstraint::DimensionString</a></div><div class="ttdeci">std::string DimensionString() const</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00172">linear_programming_constraint.h:172</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_a700f8f1db38fcb59cab04ff2d75a915f"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a700f8f1db38fcb59cab04ff2d75a915f">operations_research::sat::LinearProgrammingConstraint::SolutionIsInteger</a></div><div class="ttdeci">bool SolutionIsInteger() const</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00158">linear_programming_constraint.h:158</a></div></div>
<div class="ttc" id="aimplied__bounds_8h_html"><div class="ttname"><a href="implied__bounds_8h.html">implied_bounds.h</a></div></div>
<div class="ttc" id="arev_8h_html"><div class="ttname"><a href="rev_8h.html">rev.h</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_scattered_integer_vector_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html">operations_research::sat::ScatteredIntegerVector</a></div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00064">linear_programming_constraint.h:64</a></div></div>
<div class="ttc" id="azero__half__cuts_8h_html"><div class="ttname"><a href="zero__half__cuts_8h.html">zero_half_cuts.h</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#l00269">gurobi_interface.cc:269</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1_l_p_solve_info_html_a355a72ffc20323940c5c924112cc5bc1"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_l_p_solve_info.html#a355a72ffc20323940c5c924112cc5bc1">operations_research::sat::LPSolveInfo::lp_objective</a></div><div class="ttdeci">double lp_objective</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00058">linear_programming_constraint.h:58</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_aefa083730af18963c9bfd9915b5cd187"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#aefa083730af18963c9bfd9915b5cd187">operations_research::sat::LinearProgrammingConstraint::AddCutGenerator</a></div><div class="ttdeci">void AddCutGenerator(CutGenerator generator)</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l00582">linear_programming_constraint.cc:582</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html">operations_research::sat::LinearProgrammingConstraint</a></div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00127">linear_programming_constraint.h:128</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_linear_program_html_adcc58612f6a1dc35ff3ffdb34188f299"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_linear_program.html#adcc58612f6a1dc35ff3ffdb34188f299">operations_research::glop::LinearProgram::GetDimensionString</a></div><div class="ttdeci">std::string GetDimensionString() const</div><div class="ttdef"><b>Definition:</b> <a href="lp__data_8cc_source.html#l00423">lp_data.cc:423</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</a></div><div class="ttdef"><b>Definition:</b> <a href="strong__vector_8h_source.html#l00076">strong_vector.h:76</a></div></div>
<div class="ttc" id="amarkowitz_8cc_html_aa9d6c98fdf8d89b0e2321fda02adc82c"><div class="ttname"><a href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a></div><div class="ttdeci">ColIndex col</div><div class="ttdef"><b>Definition:</b> <a href="markowitz_8cc_source.html#l00176">markowitz.cc:176</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1_reversible_interface_html"><div class="ttname"><a href="classoperations__research_1_1_reversible_interface.html">operations_research::ReversibleInterface</a></div><div class="ttdef"><b>Definition:</b> <a href="rev_8h_source.html#l00029">rev.h:29</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a355a62f25cfadeccfb164ab9fb867c81"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a355a62f25cfadeccfb164ab9fb867c81">operations_research::sat::kMinIntegerValue</a></div><div class="ttdeci">constexpr IntegerValue kMinIntegerValue(-kMaxIntegerValue)</div></div>
<div class="ttc" id="asat_2util_8h_html"><div class="ttname"><a href="sat_2util_8h.html">util.h</a></div></div>
<div class="ttc" id="alinear__constraint__manager_8h_html"><div class="ttname"><a href="linear__constraint__manager_8h.html">linear_constraint_manager.h</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1glop_html_ae8a885303349cb7807c7c87b405bc0c9"><div class="ttname"><a href="namespaceoperations__research_1_1glop.html#ae8a885303349cb7807c7c87b405bc0c9">operations_research::glop::ProblemStatus</a></div><div class="ttdeci">ProblemStatus</div><div class="ttdef"><b>Definition:</b> <a href="lp__types_8h_source.html#l00101">lp_types.h:101</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_a6ae27451c3238e2af96991a030b7556c"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a6ae27451c3238e2af96991a030b7556c">operations_research::sat::LinearProgrammingConstraint::HeuristicLpReducedCostAverageBranching</a></div><div class="ttdeci">std::function&lt; IntegerLiteral()&gt; HeuristicLpReducedCostAverageBranching()</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l02749">linear_programming_constraint.cc:2749</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_linear_program_html"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_linear_program.html">operations_research::glop::LinearProgram</a></div><div class="ttdef"><b>Definition:</b> <a href="lp__data_8h_source.html#l00055">lp_data.h:55</a></div></div>
<div class="ttc" id="astructoperations__research_1_1_trail_html"><div class="ttname"><a href="structoperations__research_1_1_trail.html">operations_research::Trail</a></div><div class="ttdef"><b>Definition:</b> <a href="constraint__solver_8cc_source.html#l00723">constraint_solver.cc:723</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_a874f2f502681d547a666278de20564e3"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a874f2f502681d547a666278de20564e3">operations_research::sat::LinearProgrammingConstraint::HeuristicLpReducedCostBinary</a></div><div class="ttdeci">std::function&lt; IntegerLiteral()&gt; HeuristicLpReducedCostBinary(Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l02594">linear_programming_constraint.cc:2594</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_ae384be06329c4c8f8fd62af7335dae2e"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#ae384be06329c4c8f8fd62af7335dae2e">operations_research::sat::LinearProgrammingConstraint::SetObjectiveCoefficient</a></div><div class="ttdeci">void SetObjectiveCoefficient(IntegerVariable ivar, IntegerValue coeff)</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l00231">linear_programming_constraint.cc:231</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_a8172ae7d172bec9d3a417ddcaab7c474"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a8172ae7d172bec9d3a417ddcaab7c474">operations_research::sat::LinearProgrammingConstraint::LinearProgrammingConstraint</a></div><div class="ttdeci">LinearProgrammingConstraint(Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l00156">linear_programming_constraint.cc:156</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_aaac2d8dee4d7fc8d5e9a1b1cfc3021bc"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#aaac2d8dee4d7fc8d5e9a1b1cfc3021bc">operations_research::sat::LinearProgrammingConstraint::AddLinearConstraint</a></div><div class="ttdeci">void AddLinearConstraint(const LinearConstraint &amp;ct)</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l00193">linear_programming_constraint.cc:193</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_ac912ee1fbcbc9a857e9708236fb1bece"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#ac912ee1fbcbc9a857e9708236fb1bece">operations_research::sat::LinearProgrammingConstraint::integer_variables</a></div><div class="ttdeci">const std::vector&lt; IntegerVariable &gt; &amp; integer_variables() const</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00169">linear_programming_constraint.h:169</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_dispatcher_html"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_dispatcher.html">operations_research::sat::LinearProgrammingDispatcher</a></div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00524">linear_programming_constraint.h:526</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_a0e49aa5d4eabab5cd4c30c0d3498204f"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a0e49aa5d4eabab5cd4c30c0d3498204f">operations_research::sat::LinearProgrammingConstraint::average_degeneracy</a></div><div class="ttdeci">double average_degeneracy() const</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00213">linear_programming_constraint.h:213</a></div></div>
<div class="ttc" id="arouting__flow_8cc_html_adf3be22c64f10c0783c0cf277e857adf"><div class="ttname"><a href="routing__flow_8cc.html#adf3be22c64f10c0783c0cf277e857adf">capacity</a></div><div class="ttdeci">int64 capacity</div><div class="ttdef"><b>Definition:</b> <a href="routing__flow_8cc_source.html#l00129">routing_flow.cc:129</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_scattered_integer_vector_html_a4940f758f3c0e757a4bcb5bbf795ce67"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_scattered_integer_vector.html#a4940f758f3c0e757a4bcb5bbf795ce67">operations_research::sat::ScatteredIntegerVector::Add</a></div><div class="ttdeci">bool Add(glop::ColIndex col, IntegerValue value)</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l00070">linear_programming_constraint.cc:70</a></div></div>
<div class="ttc" id="anamespaceoperations__research_1_1sat_html_a83551f805175c3a30ea146efaad2ec63"><div class="ttname"><a href="namespaceoperations__research_1_1sat.html#a83551f805175c3a30ea146efaad2ec63">operations_research::sat::CreateCVRPCutGenerator</a></div><div class="ttdeci">CutGenerator CreateCVRPCutGenerator(int num_nodes, const std::vector&lt; int &gt; &amp;tails, const std::vector&lt; int &gt; &amp;heads, const std::vector&lt; Literal &gt; &amp;literals, const std::vector&lt; int64 &gt; &amp;demands, int64 capacity, Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l02528">linear_programming_constraint.cc:2528</a></div></div>
<div class="ttc" id="astructoperations__research_1_1sat_1_1_linear_programming_constraint_lp_solution_html_a75622490d147ba0ea6c189ec651ea23a"><div class="ttname"><a href="structoperations__research_1_1sat_1_1_linear_programming_constraint_lp_solution.html#a75622490d147ba0ea6c189ec651ea23a">operations_research::sat::LinearProgrammingConstraintLpSolution::LinearProgrammingConstraintLpSolution</a></div><div class="ttdeci">LinearProgrammingConstraintLpSolution()</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8h_source.html#l00052">linear_programming_constraint.h:52</a></div></div>
<div class="ttc" id="alp__types_8h_html"><div class="ttname"><a href="lp__types_8h.html">lp_types.h</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_abe80d18b1ff9d46681da4c752352e53c"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#abe80d18b1ff9d46681da4c752352e53c">operations_research::sat::LinearProgrammingConstraint::HeuristicLpMostInfeasibleBinary</a></div><div class="ttdeci">std::function&lt; IntegerLiteral()&gt; HeuristicLpMostInfeasibleBinary(Model *model)</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l02548">linear_programming_constraint.cc:2548</a></div></div>
<div class="ttc" id="acuts_8h_html"><div class="ttname"><a href="cuts_8h.html">cuts.h</a></div></div>
<div class="ttc" id="aclassoperations__research_1_1sat_1_1_linear_programming_constraint_html_a0010273383670a7c67b3b8f2660aa06b"><div class="ttname"><a href="classoperations__research_1_1sat_1_1_linear_programming_constraint.html#a0010273383670a7c67b3b8f2660aa06b">operations_research::sat::LinearProgrammingConstraint::Propagate</a></div><div class="ttdeci">bool Propagate() override</div><div class="ttdef"><b>Definition:</b> <a href="linear__programming__constraint_8cc_source.html#l01353">linear_programming_constraint.cc:1353</a></div></div>
<div class="ttc" id="ainteger_8h_html"><div class="ttname"><a href="integer_8h.html">integer.h</a></div></div>
<div class="ttc" id="adefault__search_8cc_html_ac673bc430bdc3fdaa09f7becf98ef267"><div class="ttname"><a href="default__search_8cc.html#ac673bc430bdc3fdaa09f7becf98ef267">name</a></div><div class="ttdeci">const std::string name</div><div class="ttdef"><b>Definition:</b> <a href="default__search_8cc_source.html#l00808">default_search.cc:808</a></div></div>
<!-- HTML footer for doxygen 1.8.18-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_a7cc1eeded8f693d0da6c729bc88c45a.html">ortools</a></li><li class="navelem"><a class="el" href="dir_dddac007a45022d9da6ea1dee012c3b9.html">sat</a></li><li class="navelem"><a class="el" href="linear__programming__constraint_8h.html">linear_programming_constraint.h</a></li>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.20 </li>
</ul>
</div>
</body>
</html>