437 lines
83 KiB
HTML
437 lines
83 KiB
HTML
<!-- HTML header for doxygen 1.8.18-->
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.9.3"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>OR-Tools: primal_edge_norms.cc Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="styleSheet.tmp.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectlogo"><img alt="Logo" src="orLogo.png"/></td>
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">OR-Tools
|
|
 <span id="projectnumber">9.3</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.3 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<div id="side-nav" class="ui-resizable side-nav-resizable">
|
|
<div id="nav-tree">
|
|
<div id="nav-tree-contents">
|
|
<div id="nav-sync" class="sync"></div>
|
|
</div>
|
|
</div>
|
|
<div id="splitbar" style="-moz-user-select:none;"
|
|
class="ui-resizable-handle">
|
|
</div>
|
|
</div>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(document).ready(function(){initNavTree('primal__edge__norms_8cc_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">primal_edge_norms.cc</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="primal__edge__norms_8cc.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright 2010-2021 Google LLC</span></div>
|
|
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></div>
|
|
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// you may not use this file except in compliance with the License.</span></div>
|
|
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// You may obtain a copy of the License at</span></div>
|
|
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">//</span></div>
|
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div>
|
|
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment">//</span></div>
|
|
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div>
|
|
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></div>
|
|
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
|
|
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">// See the License for the specific language governing permissions and</span></div>
|
|
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment">// limitations under the License.</span></div>
|
|
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
|
|
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="preprocessor">#include "<a class="code" href="primal__edge__norms_8h.html">ortools/glop/primal_edge_norms.h</a>"</span></div>
|
|
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> </div>
|
|
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="preprocessor">#include "<a class="code" href="timer_8h.html">ortools/base/timer.h</a>"</span></div>
|
|
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#include "<a class="code" href="lp__data_2lp__utils_8h.html">ortools/lp_data/lp_utils.h</a>"</span></div>
|
|
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> </div>
|
|
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespaceoperations__research.html">operations_research</a> {</div>
|
|
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="keyword">namespace </span>glop {</div>
|
|
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> </div>
|
|
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a41fd24e395f2e06f7d702da9fba3ec3c"> 22</a></span><a class="code hl_function" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a41fd24e395f2e06f7d702da9fba3ec3c">PrimalEdgeNorms::PrimalEdgeNorms</a>(<span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1glop_1_1_compact_sparse_matrix.html">CompactSparseMatrix</a>& compact_matrix,</div>
|
|
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1glop_1_1_variables_info.html">VariablesInfo</a>& variables_info,</div>
|
|
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1glop_1_1_basis_factorization.html">BasisFactorization</a>& basis_factorization)</div>
|
|
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> : compact_matrix_(compact_matrix),</div>
|
|
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> variables_info_(variables_info),</div>
|
|
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> basis_factorization_(basis_factorization),</div>
|
|
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> stats_(),</div>
|
|
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> recompute_edge_squared_norms_(true),</div>
|
|
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> reset_devex_weights_(true),</div>
|
|
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> edge_squared_norms_(),</div>
|
|
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> matrix_column_norms_(),</div>
|
|
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> devex_weights_(),</div>
|
|
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> direction_left_inverse_(),</div>
|
|
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> num_operations_(0) {}</div>
|
|
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> </div>
|
|
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"><a class="line" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#aa71d36872f416feaa853788a7a7a7ef8"> 37</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#aa71d36872f416feaa853788a7a7a7ef8">PrimalEdgeNorms::Clear</a>() {</div>
|
|
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> <a class="code hl_define" href="stats_8h.html#a9995704aaaf45fc21e08c847551a8d04">SCOPED_TIME_STAT</a>(&stats_);</div>
|
|
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> recompute_edge_squared_norms_ = <span class="keyword">true</span>;</div>
|
|
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> reset_devex_weights_ = <span class="keyword">true</span>;</div>
|
|
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="keywordflow">for</span> (<span class="keywordtype">bool</span>* watcher : watchers_) *watcher = <span class="keyword">true</span>;</div>
|
|
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span>}</div>
|
|
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> </div>
|
|
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#af507437729fd1e93677772e748ca1cfc"> 44</a></span><span class="keywordtype">bool</span> <a class="code hl_function" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#af507437729fd1e93677772e748ca1cfc">PrimalEdgeNorms::NeedsBasisRefactorization</a>()<span class="keyword"> const </span>{</div>
|
|
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="keywordflow">if</span> (pricing_rule_ != GlopParameters ::STEEPEST_EDGE) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
|
|
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keywordflow">return</span> recompute_edge_squared_norms_;</div>
|
|
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span>}</div>
|
|
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> </div>
|
|
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a11b5738482346b103919cf0e6481c977"> 49</a></span><span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1glop_1_1_strict_i_t_i_vector.html">DenseRow</a>& <a class="code hl_function" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a11b5738482346b103919cf0e6481c977">PrimalEdgeNorms::GetSquaredNorms</a>() {</div>
|
|
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keywordflow">switch</span> (pricing_rule_) {</div>
|
|
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">case</span> GlopParameters::DANTZIG:</div>
|
|
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> <span class="keywordflow">return</span> <a class="code hl_function" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a551ee6b517f861e2ad7557e092a9860d">GetMatrixColumnNorms</a>();</div>
|
|
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="keywordflow">case</span> GlopParameters::STEEPEST_EDGE:</div>
|
|
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordflow">return</span> <a class="code hl_function" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a67a5105630385abc274872ab7a28e70f">GetEdgeSquaredNorms</a>();</div>
|
|
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keywordflow">case</span> GlopParameters::DEVEX:</div>
|
|
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keywordflow">return</span> <a class="code hl_function" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a6f599ec9c50fc8a7421f98203a06a428">GetDevexWeights</a>();</div>
|
|
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> }</div>
|
|
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span>}</div>
|
|
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> </div>
|
|
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a67a5105630385abc274872ab7a28e70f"> 60</a></span><span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1glop_1_1_strict_i_t_i_vector.html">DenseRow</a>& <a class="code hl_function" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a67a5105630385abc274872ab7a28e70f">PrimalEdgeNorms::GetEdgeSquaredNorms</a>() {</div>
|
|
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="keywordflow">if</span> (recompute_edge_squared_norms_) ComputeEdgeSquaredNorms();</div>
|
|
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keywordflow">return</span> edge_squared_norms_;</div>
|
|
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span>}</div>
|
|
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> </div>
|
|
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a6f599ec9c50fc8a7421f98203a06a428"> 65</a></span><span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1glop_1_1_strict_i_t_i_vector.html">DenseRow</a>& <a class="code hl_function" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a6f599ec9c50fc8a7421f98203a06a428">PrimalEdgeNorms::GetDevexWeights</a>() {</div>
|
|
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordflow">if</span> (reset_devex_weights_) ResetDevexWeights();</div>
|
|
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keywordflow">return</span> devex_weights_;</div>
|
|
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span>}</div>
|
|
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> </div>
|
|
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a551ee6b517f861e2ad7557e092a9860d"> 70</a></span><span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1glop_1_1_strict_i_t_i_vector.html">DenseRow</a>& <a class="code hl_function" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a551ee6b517f861e2ad7557e092a9860d">PrimalEdgeNorms::GetMatrixColumnNorms</a>() {</div>
|
|
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordflow">if</span> (matrix_column_norms_.<a class="code hl_function" href="classabsl_1_1_strong_vector.html#a644718bb2fb240de962dc3c9a1fdf0dc">empty</a>()) ComputeMatrixColumnNorms();</div>
|
|
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordflow">return</span> matrix_column_norms_;</div>
|
|
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span>}</div>
|
|
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> </div>
|
|
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"><a class="line" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#ad3e807537a555d44d5e4a0da13f3768b"> 75</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#ad3e807537a555d44d5e4a0da13f3768b">PrimalEdgeNorms::TestEnteringEdgeNormPrecision</a>(</div>
|
|
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> ColIndex entering_col, <span class="keyword">const</span> <a class="code hl_struct" href="structoperations__research_1_1glop_1_1_scattered_column.html">ScatteredColumn</a>& direction) {</div>
|
|
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="keywordflow">if</span> (!recompute_edge_squared_norms_) {</div>
|
|
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <a class="code hl_define" href="stats_8h.html#a9995704aaaf45fc21e08c847551a8d04">SCOPED_TIME_STAT</a>(&stats_);</div>
|
|
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="comment">// Recompute the squared norm of the edge used during this</span></div>
|
|
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="comment">// iteration, i.e. the entering edge. Note the PreciseSquaredNorm()</span></div>
|
|
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="comment">// since it is a small price to pay for an increased precision.</span></div>
|
|
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">Fractional</a> old_squared_norm = edge_squared_norms_[entering_col];</div>
|
|
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">Fractional</a> precise_squared_norm = 1.0 + <a class="code hl_function" href="namespaceoperations__research_1_1glop.html#a1faa927dd93b43b3dea3eb2a993e30a1">PreciseSquaredNorm</a>(direction);</div>
|
|
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> edge_squared_norms_[entering_col] = precise_squared_norm;</div>
|
|
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> </div>
|
|
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">Fractional</a> precise_norm = sqrt(precise_squared_norm);</div>
|
|
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">Fractional</a> estimated_edges_norm_accuracy =</div>
|
|
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> (precise_norm - sqrt(old_squared_norm)) / precise_norm;</div>
|
|
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> stats_.edges_norm_accuracy.Add(estimated_edges_norm_accuracy);</div>
|
|
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="keywordflow">if</span> (std::abs(estimated_edges_norm_accuracy) ></div>
|
|
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> parameters_.recompute_edges_norm_threshold()) {</div>
|
|
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <a class="code hl_define" href="base_2logging_8h.html#afcaa7cadd41741bb855c2ada1d2ef927">VLOG</a>(1) << <span class="stringliteral">"Recomputing edge norms: "</span> << sqrt(precise_squared_norm)</div>
|
|
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> << <span class="stringliteral">" vs "</span> << sqrt(old_squared_norm);</div>
|
|
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> recompute_edge_squared_norms_ = <span class="keyword">true</span>;</div>
|
|
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keywordflow">for</span> (<span class="keywordtype">bool</span>* watcher : watchers_) *watcher = <span class="keyword">true</span>;</div>
|
|
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> }</div>
|
|
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> }</div>
|
|
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span>}</div>
|
|
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> </div>
|
|
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"><a class="line" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#ac770d9d78b0dda3be3bacb43038170e0"> 100</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#ac770d9d78b0dda3be3bacb43038170e0">PrimalEdgeNorms::UpdateBeforeBasisPivot</a>(ColIndex entering_col,</div>
|
|
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> ColIndex leaving_col,</div>
|
|
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> RowIndex leaving_row,</div>
|
|
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keyword">const</span> <a class="code hl_struct" href="structoperations__research_1_1glop_1_1_scattered_column.html">ScatteredColumn</a>& direction,</div>
|
|
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <a class="code hl_class" href="classoperations__research_1_1glop_1_1_update_row.html">UpdateRow</a>* update_row) {</div>
|
|
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <a class="code hl_define" href="stats_8h.html#a9995704aaaf45fc21e08c847551a8d04">SCOPED_TIME_STAT</a>(&stats_);</div>
|
|
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <a class="code hl_define" href="base_2logging_8h.html#a46e69120fbd3b36e6960e096d23b66f0">DCHECK_NE</a>(entering_col, leaving_col);</div>
|
|
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordflow">if</span> (!recompute_edge_squared_norms_) {</div>
|
|
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> update_row-><a class="code hl_function" href="classoperations__research_1_1glop_1_1_update_row.html#ac9f13d2561598d3a04b409dd7b4e1f0c">ComputeUpdateRow</a>(leaving_row);</div>
|
|
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> ComputeDirectionLeftInverse(entering_col, direction);</div>
|
|
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> UpdateEdgeSquaredNorms(entering_col, leaving_col, leaving_row,</div>
|
|
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> direction.<a class="code hl_variable" href="structoperations__research_1_1glop_1_1_scattered_vector.html#ae0473e18a367af671dc3f08063c80da4">values</a>, *update_row);</div>
|
|
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> }</div>
|
|
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keywordflow">if</span> (!reset_devex_weights_) {</div>
|
|
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="comment">// Resets devex weights once in a while. If so, no need to update them</span></div>
|
|
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="comment">// before.</span></div>
|
|
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> ++num_devex_updates_since_reset_;</div>
|
|
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keywordflow">if</span> (num_devex_updates_since_reset_ ></div>
|
|
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> parameters_.devex_weights_reset_period()) {</div>
|
|
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> reset_devex_weights_ = <span class="keyword">true</span>;</div>
|
|
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> } <span class="keywordflow">else</span> {</div>
|
|
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> update_row-><a class="code hl_function" href="classoperations__research_1_1glop_1_1_update_row.html#ac9f13d2561598d3a04b409dd7b4e1f0c">ComputeUpdateRow</a>(leaving_row);</div>
|
|
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> UpdateDevexWeights(entering_col, leaving_col, leaving_row,</div>
|
|
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> direction.<a class="code hl_variable" href="structoperations__research_1_1glop_1_1_scattered_vector.html#ae0473e18a367af671dc3f08063c80da4">values</a>, *update_row);</div>
|
|
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> }</div>
|
|
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> }</div>
|
|
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span>}</div>
|
|
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> </div>
|
|
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span><span class="keywordtype">void</span> PrimalEdgeNorms::ComputeMatrixColumnNorms() {</div>
|
|
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <a class="code hl_define" href="stats_8h.html#a9995704aaaf45fc21e08c847551a8d04">SCOPED_TIME_STAT</a>(&stats_);</div>
|
|
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> matrix_column_norms_.<a class="code hl_function" href="classoperations__research_1_1glop_1_1_strict_i_t_i_vector.html#a64b6b04f3a519d2c61d49daaa88bf06e">resize</a>(compact_matrix_.<a class="code hl_function" href="classoperations__research_1_1glop_1_1_compact_sparse_matrix.html#a41741829541d089f1c4d34f190884813">num_cols</a>(), 0.0);</div>
|
|
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="keywordflow">for</span> (ColIndex <a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>(0); <a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a> < compact_matrix_.<a class="code hl_function" href="classoperations__research_1_1glop_1_1_compact_sparse_matrix.html#a41741829541d089f1c4d34f190884813">num_cols</a>(); ++<a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>) {</div>
|
|
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> matrix_column_norms_[<a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>] = <a class="code hl_function" href="namespaceoperations__research_1_1glop.html#a2d53948bf5e999d006e781105aa8bc77">SquaredNorm</a>(compact_matrix_.<a class="code hl_function" href="classoperations__research_1_1glop_1_1_compact_sparse_matrix.html#afbe7c81d6b4066bf7874299a0f7c0d59">column</a>(<a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>));</div>
|
|
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> num_operations_ += compact_matrix_.<a class="code hl_function" href="classoperations__research_1_1glop_1_1_compact_sparse_matrix.html#afbe7c81d6b4066bf7874299a0f7c0d59">column</a>(<a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>).<a class="code hl_function" href="classoperations__research_1_1glop_1_1_column_view.html#af69d9b7065a8f31604a8134be4307749">num_entries</a>().value();</div>
|
|
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> }</div>
|
|
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span>}</div>
|
|
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> </div>
|
|
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span><span class="keywordtype">void</span> PrimalEdgeNorms::ComputeEdgeSquaredNorms() {</div>
|
|
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <a class="code hl_define" href="stats_8h.html#a9995704aaaf45fc21e08c847551a8d04">SCOPED_TIME_STAT</a>(&stats_);</div>
|
|
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> </div>
|
|
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <span class="comment">// Since we will do a lot of inversions, it is better to be as efficient and</span></div>
|
|
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="comment">// precise as possible by refactorizing the basis.</span></div>
|
|
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> <a class="code hl_define" href="base_2logging_8h.html#ae17f8119c108cf3070bad3449c7e0006">DCHECK</a>(basis_factorization_.<a class="code hl_function" href="classoperations__research_1_1glop_1_1_basis_factorization.html#a6e2a232672ee1580b9144f558662a77c">IsRefactorized</a>());</div>
|
|
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> edge_squared_norms_.<a class="code hl_function" href="classoperations__research_1_1glop_1_1_strict_i_t_i_vector.html#a64b6b04f3a519d2c61d49daaa88bf06e">resize</a>(compact_matrix_.<a class="code hl_function" href="classoperations__research_1_1glop_1_1_compact_sparse_matrix.html#a41741829541d089f1c4d34f190884813">num_cols</a>(), 0.0);</div>
|
|
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> ColIndex <a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a> : variables_info_.<a class="code hl_function" href="classoperations__research_1_1glop_1_1_variables_info.html#ac4385751c629a96a6d1ef5ac70af45e1">GetIsRelevantBitRow</a>()) {</div>
|
|
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <span class="comment">// Note the +1.0 in the squared norm for the component of the edge on the</span></div>
|
|
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="comment">// 'entering_col'.</span></div>
|
|
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> edge_squared_norms_[<a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>] = 1.0 + basis_factorization_.<a class="code hl_function" href="classoperations__research_1_1glop_1_1_basis_factorization.html#a4bf241af6b1844669171d6e170ef991d">RightSolveSquaredNorm</a>(</div>
|
|
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> compact_matrix_.<a class="code hl_function" href="classoperations__research_1_1glop_1_1_compact_sparse_matrix.html#afbe7c81d6b4066bf7874299a0f7c0d59">column</a>(<a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>));</div>
|
|
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span> }</div>
|
|
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> recompute_edge_squared_norms_ = <span class="keyword">false</span>;</div>
|
|
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span>}</div>
|
|
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> </div>
|
|
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span><span class="comment">// TODO(user): It should be possible to reorganize the code and call this when</span></div>
|
|
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span><span class="comment">// the value of direction is no longer needed. This will simplify the code and</span></div>
|
|
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span><span class="comment">// avoid a copy here.</span></div>
|
|
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span><span class="keywordtype">void</span> PrimalEdgeNorms::ComputeDirectionLeftInverse(</div>
|
|
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> ColIndex entering_col, <span class="keyword">const</span> ScatteredColumn& direction) {</div>
|
|
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <a class="code hl_define" href="stats_8h.html#a9995704aaaf45fc21e08c847551a8d04">SCOPED_TIME_STAT</a>(&stats_);</div>
|
|
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> </div>
|
|
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <span class="comment">// Initialize direction_left_inverse_ to direction. Note the special case when</span></div>
|
|
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> <span class="comment">// the non-zero vector is empty which means we don't know and need to use the</span></div>
|
|
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <span class="comment">// dense version.</span></div>
|
|
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="keyword">const</span> ColIndex size = <a class="code hl_function" href="namespaceoperations__research_1_1glop.html#a8fbc9efd86a3cc862a9079d86ab8b524">RowToColIndex</a>(direction.values.size());</div>
|
|
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <span class="keyword">const</span> <span class="keywordtype">double</span> kThreshold = 0.05 * size.value();</div>
|
|
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="keywordflow">if</span> (!direction_left_inverse_.<a class="code hl_variable" href="structoperations__research_1_1glop_1_1_scattered_vector.html#ac146d47daa294f7e6546c7569c9c881b">non_zeros</a>.empty() &&</div>
|
|
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> (direction_left_inverse_.<a class="code hl_variable" href="structoperations__research_1_1glop_1_1_scattered_vector.html#ac146d47daa294f7e6546c7569c9c881b">non_zeros</a>.size() + direction.non_zeros.size() <</div>
|
|
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> 2 * kThreshold)) {</div>
|
|
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <a class="code hl_function" href="namespaceoperations__research_1_1glop.html#aa6c552b94fa80def1d4d1ea64697afb1">ClearAndResizeVectorWithNonZeros</a>(size, &direction_left_inverse_);</div>
|
|
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> <span class="keyword">auto</span> e : direction) {</div>
|
|
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> direction_left_inverse_[<a class="code hl_function" href="namespaceoperations__research_1_1glop.html#a8fbc9efd86a3cc862a9079d86ab8b524">RowToColIndex</a>(e.row())] = e.coefficient();</div>
|
|
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> }</div>
|
|
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> } <span class="keywordflow">else</span> {</div>
|
|
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> direction_left_inverse_.<a class="code hl_variable" href="structoperations__research_1_1glop_1_1_scattered_vector.html#ae0473e18a367af671dc3f08063c80da4">values</a> = <a class="code hl_function" href="namespaceoperations__research_1_1glop.html#aaa803ce9366dca251925e0bdde517430">Transpose</a>(direction.values);</div>
|
|
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> direction_left_inverse_.<a class="code hl_variable" href="structoperations__research_1_1glop_1_1_scattered_vector.html#ac146d47daa294f7e6546c7569c9c881b">non_zeros</a>.clear();</div>
|
|
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> }</div>
|
|
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> </div>
|
|
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <span class="keywordflow">if</span> (direction.non_zeros.size() < kThreshold) {</div>
|
|
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> direction_left_inverse_.<a class="code hl_variable" href="structoperations__research_1_1glop_1_1_scattered_vector.html#ac146d47daa294f7e6546c7569c9c881b">non_zeros</a> = <a class="code hl_function" href="namespaceoperations__research_1_1glop.html#af6375d177c0b120cebef16673060d132">TransposedView</a>(direction).<a class="code hl_variable" href="structoperations__research_1_1glop_1_1_scattered_vector.html#ac146d47daa294f7e6546c7569c9c881b">non_zeros</a>;</div>
|
|
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> }</div>
|
|
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> basis_factorization_.<a class="code hl_function" href="classoperations__research_1_1glop_1_1_basis_factorization.html#aacdbeb58ac2d391f6586ad88db99ad61">LeftSolve</a>(&direction_left_inverse_);</div>
|
|
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> </div>
|
|
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> <span class="comment">// TODO(user): Refactorize if estimated accuracy above a threshold.</span></div>
|
|
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> <a class="code hl_define" href="stats_8h.html#a3c3e6b102f0d91c523099325c98e1887">IF_STATS_ENABLED</a>(stats_.direction_left_inverse_accuracy.Add(</div>
|
|
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> compact_matrix_.<a class="code hl_function" href="classoperations__research_1_1glop_1_1_compact_sparse_matrix.html#abdd940ad64b555052b33e763b80aea26">ColumnScalarProduct</a>(entering_col,</div>
|
|
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> direction_left_inverse_.<a class="code hl_variable" href="structoperations__research_1_1glop_1_1_scattered_vector.html#ae0473e18a367af671dc3f08063c80da4">values</a>) -</div>
|
|
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> <a class="code hl_function" href="namespaceoperations__research_1_1glop.html#a2d53948bf5e999d006e781105aa8bc77">SquaredNorm</a>(direction.values)));</div>
|
|
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> <a class="code hl_define" href="stats_8h.html#a3c3e6b102f0d91c523099325c98e1887">IF_STATS_ENABLED</a>(stats_.direction_left_inverse_density.Add(</div>
|
|
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> <a class="code hl_function" href="namespaceoperations__research_1_1glop.html#a6b36bbbcd695191600dab9b88487ff18">Density</a>(direction_left_inverse_.<a class="code hl_variable" href="structoperations__research_1_1glop_1_1_scattered_vector.html#ae0473e18a367af671dc3f08063c80da4">values</a>)));</div>
|
|
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span>}</div>
|
|
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> </div>
|
|
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span><span class="comment">// Let new_edge denote the edge of 'col' in the new basis. We want:</span></div>
|
|
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span><span class="comment">// reduced_costs_[col] = ScalarProduct(new_edge, basic_objective_);</span></div>
|
|
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span><span class="comment">// edge_squared_norms_[col] = SquaredNorm(new_edge);</span></div>
|
|
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span><span class="comment">//</span></div>
|
|
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span><span class="comment">// In order to compute this, we use the formulas:</span></div>
|
|
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span><span class="comment">// new_leaving_edge = old_entering_edge / divisor.</span></div>
|
|
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span><span class="comment">// new_edge = old_edge + update_coeff * new_leaving_edge.</span></div>
|
|
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span><span class="keywordtype">void</span> PrimalEdgeNorms::UpdateEdgeSquaredNorms(ColIndex entering_col,</div>
|
|
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> ColIndex leaving_col,</div>
|
|
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> RowIndex leaving_row,</div>
|
|
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#ae5fa9e57c2d31b294195ed8a9e17bfac">DenseColumn</a>& direction,</div>
|
|
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> <span class="keyword">const</span> UpdateRow& update_row) {</div>
|
|
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> <a class="code hl_define" href="stats_8h.html#a9995704aaaf45fc21e08c847551a8d04">SCOPED_TIME_STAT</a>(&stats_);</div>
|
|
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> </div>
|
|
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> <span class="comment">// 'pivot' is the value of the entering_edge at 'leaving_row'.</span></div>
|
|
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> <span class="comment">// The edge of the 'leaving_col' in the new basis is equal to</span></div>
|
|
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> <span class="comment">// entering_edge / 'pivot'.</span></div>
|
|
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">Fractional</a> pivot = -direction[leaving_row];</div>
|
|
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> <a class="code hl_define" href="base_2logging_8h.html#a46e69120fbd3b36e6960e096d23b66f0">DCHECK_NE</a>(pivot, 0.0);</div>
|
|
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> </div>
|
|
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> <span class="comment">// Note that this should be precise because of the call to</span></div>
|
|
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> <span class="comment">// TestEnteringEdgeNormPrecision().</span></div>
|
|
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">Fractional</a> entering_squared_norm = edge_squared_norms_[entering_col];</div>
|
|
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">Fractional</a> leaving_squared_norm =</div>
|
|
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> <a class="code hl_variable" href="alldiff__cst_8cc.html#a26e6db9bcc64b584051ecc28171ed11f">std::max</a>(1.0, entering_squared_norm / <a class="code hl_function" href="namespaceoperations__research_1_1glop.html#a1dcd08b0f6c19cd4a302bb5a3a6ea06e">Square</a>(pivot));</div>
|
|
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> </div>
|
|
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> <span class="keywordtype">int</span> stat_lower_bounded_norms = 0;</div>
|
|
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">Fractional</a> factor = 2.0 / pivot;</div>
|
|
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> ColIndex <a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a> : update_row.GetNonZeroPositions()) {</div>
|
|
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">Fractional</a> <a class="code hl_variable" href="variable__and__expressions_8cc.html#a2091cd7d80fdd31762020bce86138587">coeff</a> = update_row.GetCoefficient(<a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>);</div>
|
|
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">Fractional</a> scalar_product = compact_matrix_.<a class="code hl_function" href="classoperations__research_1_1glop_1_1_compact_sparse_matrix.html#abdd940ad64b555052b33e763b80aea26">ColumnScalarProduct</a>(</div>
|
|
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> <a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>, direction_left_inverse_.<a class="code hl_variable" href="structoperations__research_1_1glop_1_1_scattered_vector.html#ae0473e18a367af671dc3f08063c80da4">values</a>);</div>
|
|
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> num_operations_ += compact_matrix_.<a class="code hl_function" href="classoperations__research_1_1glop_1_1_compact_sparse_matrix.html#afbe7c81d6b4066bf7874299a0f7c0d59">column</a>(<a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>).<a class="code hl_function" href="classoperations__research_1_1glop_1_1_column_view.html#af69d9b7065a8f31604a8134be4307749">num_entries</a>().value();</div>
|
|
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> </div>
|
|
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> <span class="comment">// Update the edge squared norm of this column. Note that the update</span></div>
|
|
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> <span class="comment">// formula used is important to maximize the precision. See an explanation</span></div>
|
|
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> <span class="comment">// in the dual context in Koberstein's PhD thesis, section 8.2.2.1.</span></div>
|
|
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> edge_squared_norms_[<a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>] +=</div>
|
|
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> <a class="code hl_variable" href="variable__and__expressions_8cc.html#a2091cd7d80fdd31762020bce86138587">coeff</a> * (<a class="code hl_variable" href="variable__and__expressions_8cc.html#a2091cd7d80fdd31762020bce86138587">coeff</a> * leaving_squared_norm + factor * scalar_product);</div>
|
|
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> </div>
|
|
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> <span class="comment">// Make sure it doesn't go under a known lower bound (TODO(user): ref?).</span></div>
|
|
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <span class="comment">// This way norms are always >= 1.0 .</span></div>
|
|
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> <span class="comment">// TODO(user): precompute 1 / Square(pivot) or 1 / pivot? it will be</span></div>
|
|
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> <span class="comment">// slightly faster, but may introduce numerical issues. More generally,</span></div>
|
|
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> <span class="comment">// this test is only needed in a few cases, so is it worth it?</span></div>
|
|
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">Fractional</a> <a class="code hl_variable" href="gscip__solver_8cc.html#a1e2f9a2352c1d9a6cada9544898fceec">lower_bound</a> = 1.0 + <a class="code hl_function" href="namespaceoperations__research_1_1glop.html#a1dcd08b0f6c19cd4a302bb5a3a6ea06e">Square</a>(<a class="code hl_variable" href="variable__and__expressions_8cc.html#a2091cd7d80fdd31762020bce86138587">coeff</a> / pivot);</div>
|
|
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> <span class="keywordflow">if</span> (edge_squared_norms_[<a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>] < <a class="code hl_variable" href="gscip__solver_8cc.html#a1e2f9a2352c1d9a6cada9544898fceec">lower_bound</a>) {</div>
|
|
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"> 238</span> edge_squared_norms_[<a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>] = <a class="code hl_variable" href="gscip__solver_8cc.html#a1e2f9a2352c1d9a6cada9544898fceec">lower_bound</a>;</div>
|
|
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> ++stat_lower_bounded_norms;</div>
|
|
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> }</div>
|
|
<div class="line"><a id="l00241" name="l00241"></a><span class="lineno"> 241</span> }</div>
|
|
<div class="line"><a id="l00242" name="l00242"></a><span class="lineno"> 242</span> edge_squared_norms_[leaving_col] = leaving_squared_norm;</div>
|
|
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> stats_.lower_bounded_norms.Add(stat_lower_bounded_norms);</div>
|
|
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span>}</div>
|
|
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> </div>
|
|
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span><span class="keywordtype">void</span> PrimalEdgeNorms::UpdateDevexWeights(</div>
|
|
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> ColIndex entering_col <span class="comment">/* index q in the paper */</span>,</div>
|
|
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> ColIndex leaving_col <span class="comment">/* index p in the paper */</span>, RowIndex leaving_row,</div>
|
|
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#ae5fa9e57c2d31b294195ed8a9e17bfac">DenseColumn</a>& direction, <span class="keyword">const</span> UpdateRow& update_row) {</div>
|
|
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> <a class="code hl_define" href="stats_8h.html#a9995704aaaf45fc21e08c847551a8d04">SCOPED_TIME_STAT</a>(&stats_);</div>
|
|
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> </div>
|
|
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> <span class="comment">// Compared to steepest edge update, the DEVEX weight uses the largest of the</span></div>
|
|
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> <span class="comment">// norms of two vectors to approximate the norm of the sum.</span></div>
|
|
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">Fractional</a> entering_norm = sqrt(<a class="code hl_function" href="namespaceoperations__research_1_1glop.html#a1faa927dd93b43b3dea3eb2a993e30a1">PreciseSquaredNorm</a>(direction));</div>
|
|
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">Fractional</a> pivot_magnitude = std::abs(direction[leaving_row]);</div>
|
|
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">Fractional</a> leaving_norm =</div>
|
|
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> <a class="code hl_variable" href="alldiff__cst_8cc.html#a26e6db9bcc64b584051ecc28171ed11f">std::max</a>(1.0, entering_norm / pivot_magnitude);</div>
|
|
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> <span class="keywordflow">for</span> (<span class="keyword">const</span> ColIndex <a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a> : update_row.GetNonZeroPositions()) {</div>
|
|
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">Fractional</a> <a class="code hl_variable" href="variable__and__expressions_8cc.html#a2091cd7d80fdd31762020bce86138587">coeff</a> = update_row.GetCoefficient(<a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>);</div>
|
|
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> <span class="keyword">const</span> <a class="code hl_typedef" href="namespaceoperations__research_1_1glop.html#a733947145e3e1631165b618b05c9ccb7">Fractional</a> update_vector_norm = std::abs(<a class="code hl_variable" href="variable__and__expressions_8cc.html#a2091cd7d80fdd31762020bce86138587">coeff</a>) * leaving_norm;</div>
|
|
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> devex_weights_[<a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>] =</div>
|
|
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> <a class="code hl_variable" href="alldiff__cst_8cc.html#a26e6db9bcc64b584051ecc28171ed11f">std::max</a>(devex_weights_[<a class="code hl_variable" href="markowitz_8cc.html#aa9d6c98fdf8d89b0e2321fda02adc82c">col</a>], <a class="code hl_function" href="namespaceoperations__research_1_1glop.html#a1dcd08b0f6c19cd4a302bb5a3a6ea06e">Square</a>(update_vector_norm));</div>
|
|
<div class="line"><a id="l00263" name="l00263"></a><span class="lineno"> 263</span> }</div>
|
|
<div class="line"><a id="l00264" name="l00264"></a><span class="lineno"> 264</span> devex_weights_[leaving_col] = <a class="code hl_function" href="namespaceoperations__research_1_1glop.html#a1dcd08b0f6c19cd4a302bb5a3a6ea06e">Square</a>(leaving_norm);</div>
|
|
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span>}</div>
|
|
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> </div>
|
|
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span><span class="keywordtype">void</span> PrimalEdgeNorms::ResetDevexWeights() {</div>
|
|
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> <a class="code hl_define" href="stats_8h.html#a9995704aaaf45fc21e08c847551a8d04">SCOPED_TIME_STAT</a>(&stats_);</div>
|
|
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> <span class="keywordflow">if</span> (parameters_.initialize_devex_with_column_norms()) {</div>
|
|
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> devex_weights_ = <a class="code hl_function" href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a551ee6b517f861e2ad7557e092a9860d">GetMatrixColumnNorms</a>();</div>
|
|
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> } <span class="keywordflow">else</span> {</div>
|
|
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> devex_weights_.<a class="code hl_function" href="classoperations__research_1_1glop_1_1_strict_i_t_i_vector.html#af8d7048738ceb4c753b040e6d29db79c">assign</a>(compact_matrix_.<a class="code hl_function" href="classoperations__research_1_1glop_1_1_compact_sparse_matrix.html#a41741829541d089f1c4d34f190884813">num_cols</a>(), 1.0);</div>
|
|
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> }</div>
|
|
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> num_devex_updates_since_reset_ = 0;</div>
|
|
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span> reset_devex_weights_ = <span class="keyword">false</span>;</div>
|
|
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span>}</div>
|
|
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span> </div>
|
|
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"> 278</span>} <span class="comment">// namespace glop</span></div>
|
|
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span>} <span class="comment">// namespace operations_research</span></div>
|
|
<div class="ttc" id="aalldiff__cst_8cc_html_a26e6db9bcc64b584051ecc28171ed11f"><div class="ttname"><a href="alldiff__cst_8cc.html#a26e6db9bcc64b584051ecc28171ed11f">max</a></div><div class="ttdeci">int64_t max</div><div class="ttdef"><b>Definition:</b> <a href="alldiff__cst_8cc_source.html#l00140">alldiff_cst.cc:140</a></div></div>
|
|
<div class="ttc" id="abase_2logging_8h_html_a46e69120fbd3b36e6960e096d23b66f0"><div class="ttname"><a href="base_2logging_8h.html#a46e69120fbd3b36e6960e096d23b66f0">DCHECK_NE</a></div><div class="ttdeci">#define DCHECK_NE(val1, val2)</div><div class="ttdef"><b>Definition:</b> <a href="base_2logging_8h_source.html#l00892">base/logging.h:892</a></div></div>
|
|
<div class="ttc" id="abase_2logging_8h_html_ae17f8119c108cf3070bad3449c7e0006"><div class="ttname"><a href="base_2logging_8h.html#ae17f8119c108cf3070bad3449c7e0006">DCHECK</a></div><div class="ttdeci">#define DCHECK(condition)</div><div class="ttdef"><b>Definition:</b> <a href="base_2logging_8h_source.html#l00890">base/logging.h:890</a></div></div>
|
|
<div class="ttc" id="abase_2logging_8h_html_afcaa7cadd41741bb855c2ada1d2ef927"><div class="ttname"><a href="base_2logging_8h.html#afcaa7cadd41741bb855c2ada1d2ef927">VLOG</a></div><div class="ttdeci">#define VLOG(verboselevel)</div><div class="ttdef"><b>Definition:</b> <a href="base_2logging_8h_source.html#l00984">base/logging.h:984</a></div></div>
|
|
<div class="ttc" id="aclassabsl_1_1_strong_vector_html_a644718bb2fb240de962dc3c9a1fdf0dc"><div class="ttname"><a href="classabsl_1_1_strong_vector.html#a644718bb2fb240de962dc3c9a1fdf0dc">absl::StrongVector::empty</a></div><div class="ttdeci">bool empty() const</div><div class="ttdef"><b>Definition:</b> <a href="strong__vector_8h_source.html#l00156">strong_vector.h:156</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_basis_factorization_html"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_basis_factorization.html">operations_research::glop::BasisFactorization</a></div><div class="ttdef"><b>Definition:</b> <a href="basis__representation_8h_source.html#l00151">basis_representation.h:151</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_basis_factorization_html_a4bf241af6b1844669171d6e170ef991d"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_basis_factorization.html#a4bf241af6b1844669171d6e170ef991d">operations_research::glop::BasisFactorization::RightSolveSquaredNorm</a></div><div class="ttdeci">Fractional RightSolveSquaredNorm(const ColumnView &a) const</div><div class="ttdef"><b>Definition:</b> <a href="basis__representation_8cc_source.html#l00498">basis_representation.cc:498</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_basis_factorization_html_a6e2a232672ee1580b9144f558662a77c"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_basis_factorization.html#a6e2a232672ee1580b9144f558662a77c">operations_research::glop::BasisFactorization::IsRefactorized</a></div><div class="ttdeci">bool IsRefactorized() const</div><div class="ttdef"><b>Definition:</b> <a href="basis__representation_8cc_source.html#l00222">basis_representation.cc:222</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_basis_factorization_html_aacdbeb58ac2d391f6586ad88db99ad61"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_basis_factorization.html#aacdbeb58ac2d391f6586ad88db99ad61">operations_research::glop::BasisFactorization::LeftSolve</a></div><div class="ttdeci">void LeftSolve(ScatteredRow *y) const</div><div class="ttdef"><b>Definition:</b> <a href="basis__representation_8cc_source.html#l00337">basis_representation.cc:337</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_column_view_html_af69d9b7065a8f31604a8134be4307749"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_column_view.html#af69d9b7065a8f31604a8134be4307749">operations_research::glop::ColumnView::num_entries</a></div><div class="ttdeci">EntryIndex num_entries() const</div><div class="ttdef"><b>Definition:</b> <a href="sparse__column_8h_source.html#l00082">sparse_column.h:82</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_compact_sparse_matrix_html"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_compact_sparse_matrix.html">operations_research::glop::CompactSparseMatrix</a></div><div class="ttdef"><b>Definition:</b> <a href="sparse_8h_source.html#l00289">sparse.h:289</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_compact_sparse_matrix_html_a41741829541d089f1c4d34f190884813"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_compact_sparse_matrix.html#a41741829541d089f1c4d34f190884813">operations_research::glop::CompactSparseMatrix::num_cols</a></div><div class="ttdeci">ColIndex num_cols() const</div><div class="ttdef"><b>Definition:</b> <a href="sparse_8h_source.html#l00350">sparse.h:350</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_compact_sparse_matrix_html_abdd940ad64b555052b33e763b80aea26"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_compact_sparse_matrix.html#abdd940ad64b555052b33e763b80aea26">operations_research::glop::CompactSparseMatrix::ColumnScalarProduct</a></div><div class="ttdeci">Fractional ColumnScalarProduct(ColIndex col, const DenseRow &vector) const</div><div class="ttdef"><b>Definition:</b> <a href="sparse_8h_source.html#l00387">sparse.h:387</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_compact_sparse_matrix_html_afbe7c81d6b4066bf7874299a0f7c0d59"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_compact_sparse_matrix.html#afbe7c81d6b4066bf7874299a0f7c0d59">operations_research::glop::CompactSparseMatrix::column</a></div><div class="ttdeci">ColumnView column(ColIndex col) const</div><div class="ttdef"><b>Definition:</b> <a href="sparse_8h_source.html#l00369">sparse.h:369</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_primal_edge_norms_html_a11b5738482346b103919cf0e6481c977"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a11b5738482346b103919cf0e6481c977">operations_research::glop::PrimalEdgeNorms::GetSquaredNorms</a></div><div class="ttdeci">const DenseRow & GetSquaredNorms()</div><div class="ttdef"><b>Definition:</b> <a href="primal__edge__norms_8cc_source.html#l00049">primal_edge_norms.cc:49</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_primal_edge_norms_html_a41fd24e395f2e06f7d702da9fba3ec3c"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a41fd24e395f2e06f7d702da9fba3ec3c">operations_research::glop::PrimalEdgeNorms::PrimalEdgeNorms</a></div><div class="ttdeci">PrimalEdgeNorms(const CompactSparseMatrix &compact_matrix, const VariablesInfo &variables_info, const BasisFactorization &basis_factorization)</div><div class="ttdef"><b>Definition:</b> <a href="primal__edge__norms_8cc_source.html#l00022">primal_edge_norms.cc:22</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_primal_edge_norms_html_a551ee6b517f861e2ad7557e092a9860d"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a551ee6b517f861e2ad7557e092a9860d">operations_research::glop::PrimalEdgeNorms::GetMatrixColumnNorms</a></div><div class="ttdeci">const DenseRow & GetMatrixColumnNorms()</div><div class="ttdef"><b>Definition:</b> <a href="primal__edge__norms_8cc_source.html#l00070">primal_edge_norms.cc:70</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_primal_edge_norms_html_a67a5105630385abc274872ab7a28e70f"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a67a5105630385abc274872ab7a28e70f">operations_research::glop::PrimalEdgeNorms::GetEdgeSquaredNorms</a></div><div class="ttdeci">const DenseRow & GetEdgeSquaredNorms()</div><div class="ttdef"><b>Definition:</b> <a href="primal__edge__norms_8cc_source.html#l00060">primal_edge_norms.cc:60</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_primal_edge_norms_html_a6f599ec9c50fc8a7421f98203a06a428"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#a6f599ec9c50fc8a7421f98203a06a428">operations_research::glop::PrimalEdgeNorms::GetDevexWeights</a></div><div class="ttdeci">const DenseRow & GetDevexWeights()</div><div class="ttdef"><b>Definition:</b> <a href="primal__edge__norms_8cc_source.html#l00065">primal_edge_norms.cc:65</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_primal_edge_norms_html_aa71d36872f416feaa853788a7a7a7ef8"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#aa71d36872f416feaa853788a7a7a7ef8">operations_research::glop::PrimalEdgeNorms::Clear</a></div><div class="ttdeci">void Clear()</div><div class="ttdef"><b>Definition:</b> <a href="primal__edge__norms_8cc_source.html#l00037">primal_edge_norms.cc:37</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_primal_edge_norms_html_ac770d9d78b0dda3be3bacb43038170e0"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#ac770d9d78b0dda3be3bacb43038170e0">operations_research::glop::PrimalEdgeNorms::UpdateBeforeBasisPivot</a></div><div class="ttdeci">void UpdateBeforeBasisPivot(ColIndex entering_col, ColIndex leaving_col, RowIndex leaving_row, const ScatteredColumn &direction, UpdateRow *update_row)</div><div class="ttdef"><b>Definition:</b> <a href="primal__edge__norms_8cc_source.html#l00100">primal_edge_norms.cc:100</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_primal_edge_norms_html_ad3e807537a555d44d5e4a0da13f3768b"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#ad3e807537a555d44d5e4a0da13f3768b">operations_research::glop::PrimalEdgeNorms::TestEnteringEdgeNormPrecision</a></div><div class="ttdeci">void TestEnteringEdgeNormPrecision(ColIndex entering_col, const ScatteredColumn &direction)</div><div class="ttdef"><b>Definition:</b> <a href="primal__edge__norms_8cc_source.html#l00075">primal_edge_norms.cc:75</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_primal_edge_norms_html_af507437729fd1e93677772e748ca1cfc"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_primal_edge_norms.html#af507437729fd1e93677772e748ca1cfc">operations_research::glop::PrimalEdgeNorms::NeedsBasisRefactorization</a></div><div class="ttdeci">bool NeedsBasisRefactorization() const</div><div class="ttdef"><b>Definition:</b> <a href="primal__edge__norms_8cc_source.html#l00044">primal_edge_norms.cc:44</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< ColIndex, Fractional ></a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_strict_i_t_i_vector_html_a64b6b04f3a519d2c61d49daaa88bf06e"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_strict_i_t_i_vector.html#a64b6b04f3a519d2c61d49daaa88bf06e">operations_research::glop::StrictITIVector::resize</a></div><div class="ttdeci">void resize(IntType size)</div><div class="ttdef"><b>Definition:</b> <a href="lp__types_8h_source.html#l00273">lp_types.h:273</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_strict_i_t_i_vector_html_af8d7048738ceb4c753b040e6d29db79c"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_strict_i_t_i_vector.html#af8d7048738ceb4c753b040e6d29db79c">operations_research::glop::StrictITIVector::assign</a></div><div class="ttdeci">void assign(IntType size, const T &v)</div><div class="ttdef"><b>Definition:</b> <a href="lp__types_8h_source.html#l00278">lp_types.h:278</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_update_row_html"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_update_row.html">operations_research::glop::UpdateRow</a></div><div class="ttdef"><b>Definition:</b> <a href="update__row_8h_source.html#l00040">update_row.h:40</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_update_row_html_ac9f13d2561598d3a04b409dd7b4e1f0c"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_update_row.html#ac9f13d2561598d3a04b409dd7b4e1f0c">operations_research::glop::UpdateRow::ComputeUpdateRow</a></div><div class="ttdeci">void ComputeUpdateRow(RowIndex leaving_row)</div><div class="ttdef"><b>Definition:</b> <a href="update__row_8cc_source.html#l00071">update_row.cc:71</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_variables_info_html"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_variables_info.html">operations_research::glop::VariablesInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="variables__info_8h_source.html#l00055">variables_info.h:55</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1glop_1_1_variables_info_html_ac4385751c629a96a6d1ef5ac70af45e1"><div class="ttname"><a href="classoperations__research_1_1glop_1_1_variables_info.html#ac4385751c629a96a6d1ef5ac70af45e1">operations_research::glop::VariablesInfo::GetIsRelevantBitRow</a></div><div class="ttdeci">const DenseBitRow & GetIsRelevantBitRow() const</div><div class="ttdef"><b>Definition:</b> <a href="variables__info_8cc_source.html#l00302">variables_info.cc:302</a></div></div>
|
|
<div class="ttc" id="agscip__solver_8cc_html_a1e2f9a2352c1d9a6cada9544898fceec"><div class="ttname"><a href="gscip__solver_8cc.html#a1e2f9a2352c1d9a6cada9544898fceec">lower_bound</a></div><div class="ttdeci">double lower_bound</div><div class="ttdef"><b>Definition:</b> <a href="gscip__solver_8cc_source.html#l00136">gscip_solver.cc:136</a></div></div>
|
|
<div class="ttc" id="alp__data_2lp__utils_8h_html"><div class="ttname"><a href="lp__data_2lp__utils_8h.html">lp_utils.h</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#l00183">markowitz.cc:183</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1glop_html_a1dcd08b0f6c19cd4a302bb5a3a6ea06e"><div class="ttname"><a href="namespaceoperations__research_1_1glop.html#a1dcd08b0f6c19cd4a302bb5a3a6ea06e">operations_research::glop::Square</a></div><div class="ttdeci">Fractional Square(Fractional f)</div><div class="ttdef"><b>Definition:</b> <a href="lp__data_2lp__utils_8h_source.html#l00036">lp_data/lp_utils.h:36</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1glop_html_a1faa927dd93b43b3dea3eb2a993e30a1"><div class="ttname"><a href="namespaceoperations__research_1_1glop.html#a1faa927dd93b43b3dea3eb2a993e30a1">operations_research::glop::PreciseSquaredNorm</a></div><div class="ttdeci">Fractional PreciseSquaredNorm(const SparseColumn &v)</div><div class="ttdef"><b>Definition:</b> <a href="lp__data_2lp__utils_8cc_source.html#l00038">lp_data/lp_utils.cc:38</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1glop_html_a2d53948bf5e999d006e781105aa8bc77"><div class="ttname"><a href="namespaceoperations__research_1_1glop.html#a2d53948bf5e999d006e781105aa8bc77">operations_research::glop::SquaredNorm</a></div><div class="ttdeci">Fractional SquaredNorm(const SparseColumn &v)</div><div class="ttdef"><b>Definition:</b> <a href="lp__data_2lp__utils_8cc_source.html#l00030">lp_data/lp_utils.cc:30</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1glop_html_a6b36bbbcd695191600dab9b88487ff18"><div class="ttname"><a href="namespaceoperations__research_1_1glop.html#a6b36bbbcd695191600dab9b88487ff18">operations_research::glop::Density</a></div><div class="ttdeci">double Density(const DenseRow &row)</div><div class="ttdef"><b>Definition:</b> <a href="lp__data_2lp__utils_8cc_source.html#l00106">lp_data/lp_utils.cc:106</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#l00078">lp_types.h:78</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1glop_html_a8fbc9efd86a3cc862a9079d86ab8b524"><div class="ttname"><a href="namespaceoperations__research_1_1glop.html#a8fbc9efd86a3cc862a9079d86ab8b524">operations_research::glop::RowToColIndex</a></div><div class="ttdeci">ColIndex RowToColIndex(RowIndex row)</div><div class="ttdef"><b>Definition:</b> <a href="lp__types_8h_source.html#l00049">lp_types.h:49</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1glop_html_aa6c552b94fa80def1d4d1ea64697afb1"><div class="ttname"><a href="namespaceoperations__research_1_1glop.html#aa6c552b94fa80def1d4d1ea64697afb1">operations_research::glop::ClearAndResizeVectorWithNonZeros</a></div><div class="ttdeci">void ClearAndResizeVectorWithNonZeros(IndexType size, ScatteredRowOrCol *v)</div><div class="ttdef"><b>Definition:</b> <a href="lp__data_2lp__utils_8h_source.html#l00278">lp_data/lp_utils.h:278</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1glop_html_aaa803ce9366dca251925e0bdde517430"><div class="ttname"><a href="namespaceoperations__research_1_1glop.html#aaa803ce9366dca251925e0bdde517430">operations_research::glop::Transpose</a></div><div class="ttdeci">const DenseRow & Transpose(const DenseColumn &col)</div><div class="ttdef"><b>Definition:</b> <a href="lp__data_2lp__utils_8h_source.html#l00192">lp_data/lp_utils.h:192</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1glop_html_ae5fa9e57c2d31b294195ed8a9e17bfac"><div class="ttname"><a href="namespaceoperations__research_1_1glop.html#ae5fa9e57c2d31b294195ed8a9e17bfac">operations_research::glop::DenseColumn</a></div><div class="ttdeci">StrictITIVector< RowIndex, Fractional > DenseColumn</div><div class="ttdef"><b>Definition:</b> <a href="lp__types_8h_source.html#l00332">lp_types.h:332</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1glop_html_af6375d177c0b120cebef16673060d132"><div class="ttname"><a href="namespaceoperations__research_1_1glop.html#af6375d177c0b120cebef16673060d132">operations_research::glop::TransposedView</a></div><div class="ttdeci">const ScatteredRow & TransposedView(const ScatteredColumn &c)</div><div class="ttdef"><b>Definition:</b> <a href="scattered__vector_8h_source.html#l00199">scattered_vector.h:199</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">Collection of objects used to extend the Constraint Solver library.</div><div class="ttdef"><b>Definition:</b> <a href="dense__doubly__linked__list_8h_source.html#l00021">dense_doubly_linked_list.h:21</a></div></div>
|
|
<div class="ttc" id="aprimal__edge__norms_8h_html"><div class="ttname"><a href="primal__edge__norms_8h.html">primal_edge_norms.h</a></div></div>
|
|
<div class="ttc" id="astats_8h_html_a3c3e6b102f0d91c523099325c98e1887"><div class="ttname"><a href="stats_8h.html#a3c3e6b102f0d91c523099325c98e1887">IF_STATS_ENABLED</a></div><div class="ttdeci">#define IF_STATS_ENABLED(instructions)</div><div class="ttdef"><b>Definition:</b> <a href="stats_8h_source.html#l00437">stats.h:437</a></div></div>
|
|
<div class="ttc" id="astats_8h_html_a9995704aaaf45fc21e08c847551a8d04"><div class="ttname"><a href="stats_8h.html#a9995704aaaf45fc21e08c847551a8d04">SCOPED_TIME_STAT</a></div><div class="ttdeci">#define SCOPED_TIME_STAT(stats)</div><div class="ttdef"><b>Definition:</b> <a href="stats_8h_source.html#l00438">stats.h:438</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1glop_1_1_scattered_column_html"><div class="ttname"><a href="structoperations__research_1_1glop_1_1_scattered_column.html">operations_research::glop::ScatteredColumn</a></div><div class="ttdef"><b>Definition:</b> <a href="scattered__vector_8h_source.html#l00195">scattered_vector.h:196</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1glop_1_1_scattered_vector_html_ac146d47daa294f7e6546c7569c9c881b"><div class="ttname"><a href="structoperations__research_1_1glop_1_1_scattered_vector.html#ac146d47daa294f7e6546c7569c9c881b">operations_research::glop::ScatteredVector::non_zeros</a></div><div class="ttdeci">std::vector< Index > non_zeros</div><div class="ttdef"><b>Definition:</b> <a href="scattered__vector_8h_source.html#l00061">scattered_vector.h:61</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1glop_1_1_scattered_vector_html_ae0473e18a367af671dc3f08063c80da4"><div class="ttname"><a href="structoperations__research_1_1glop_1_1_scattered_vector.html#ae0473e18a367af671dc3f08063c80da4">operations_research::glop::ScatteredVector::values</a></div><div class="ttdeci">StrictITIVector< Index, Fractional > values</div><div class="ttdef"><b>Definition:</b> <a href="scattered__vector_8h_source.html#l00056">scattered_vector.h:56</a></div></div>
|
|
<div class="ttc" id="atimer_8h_html"><div class="ttname"><a href="timer_8h.html">timer.h</a></div></div>
|
|
<div class="ttc" id="avariable__and__expressions_8cc_html_a2091cd7d80fdd31762020bce86138587"><div class="ttname"><a href="variable__and__expressions_8cc.html#a2091cd7d80fdd31762020bce86138587">coeff</a></div><div class="ttdeci">const double coeff</div><div class="ttdef"><b>Definition:</b> <a href="variable__and__expressions_8cc_source.html#l00105">variable_and_expressions.cc:105</a></div></div>
|
|
</div><!-- fragment --></div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- HTML footer for doxygen 1.8.18-->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_a7cc1eeded8f693d0da6c729bc88c45a.html">ortools</a></li><li class="navelem"><a class="el" href="dir_747248fa8ec2ebcb4d8ad85ced34db0b.html">glop</a></li><li class="navelem"><a class="el" href="primal__edge__norms_8cc.html">primal_edge_norms.cc</a></li>
|
|
<li class="footer">Generated by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.9.3 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|