353 lines
66 KiB
HTML
353 lines
66 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: sharded_optimization_utils.h Source File</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="resize.js"></script>
|
|
<script type="text/javascript" src="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="styleSheet.tmp.css" rel="stylesheet" type="text/css"/>
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectlogo"><img alt="Logo" src="orLogo.png"/></td>
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">OR-Tools
|
|
 <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('sharded__optimization__utils_8h_source.html',''); initResizable(); });
|
|
/* @license-end */
|
|
</script>
|
|
<div id="doc-content">
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="headertitle"><div class="title">sharded_optimization_utils.h</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="sharded__optimization__utils_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="comment">// Copyright 2010-2021 Google LLC</span></div>
|
|
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></div>
|
|
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="comment">// you may not use this file except in compliance with the License.</span></div>
|
|
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="comment">// You may obtain a copy of the License at</span></div>
|
|
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="comment">//</span></div>
|
|
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span><span class="comment">// http://www.apache.org/licenses/LICENSE-2.0</span></div>
|
|
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="comment">//</span></div>
|
|
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span><span class="comment">// Unless required by applicable law or agreed to in writing, software</span></div>
|
|
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></div>
|
|
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span><span class="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
|
|
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="comment">// See the License for the specific language governing permissions and</span></div>
|
|
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="comment">// limitations under the License.</span></div>
|
|
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> </div>
|
|
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span><span class="comment">// These are internal helper functions and classes that implicitly or explicitly</span></div>
|
|
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment">// operate on a ShardedQuadraticProgram. Utilities that are purely linear</span></div>
|
|
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment">// algebra operations (e.g., norms) should be defined in sharder.h instead.</span></div>
|
|
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> </div>
|
|
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="preprocessor">#ifndef PDLP_SHARDED_OPTIMIZATION_UTILS_H_</span></div>
|
|
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#define PDLP_SHARDED_OPTIMIZATION_UTILS_H_</span></div>
|
|
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> </div>
|
|
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#include <limits></span></div>
|
|
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span><span class="preprocessor">#include <random></span></div>
|
|
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
|
|
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="preprocessor">#include "Eigen/Core"</span></div>
|
|
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#include "absl/types/optional.h"</span></div>
|
|
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#include "<a class="code" href="sharded__quadratic__program_8h.html">ortools/pdlp/sharded_quadratic_program.h</a>"</span></div>
|
|
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor">#include "<a class="code" href="sharder_8h.html">ortools/pdlp/sharder.h</a>"</span></div>
|
|
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span><span class="preprocessor">#include "ortools/pdlp/solve_log.pb.h"</span></div>
|
|
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> </div>
|
|
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespaceoperations__research_1_1pdlp.html">operations_research::pdlp</a> {</div>
|
|
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> </div>
|
|
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="comment">// This computes weighted averages of vectors.</span></div>
|
|
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="comment">// It satisfies the following: if all the averaged vectors have component i</span></div>
|
|
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="comment">// equal to x then the average has component i exactly equal to x, without any</span></div>
|
|
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="comment">// floating-point roundoff. In practice the above is probably still true with</span></div>
|
|
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="comment">// "equal to x" replaced with "at least x" or "at most x". However unrealistic</span></div>
|
|
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="comment">// counter examples probably exist involving a new item with weight 10^15 times</span></div>
|
|
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span><span class="comment">// greater than the total weight so far.</span></div>
|
|
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html"> 39</a></span><span class="keyword">class </span><a class="code hl_class" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html">ShardedWeightedAverage</a> {</div>
|
|
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="keyword">public</span>:</div>
|
|
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="comment">// Initializes the weighted average by creating a vector sized according to</span></div>
|
|
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="comment">// the number of elements in the sharder. Retains the pointer to sharder, so</span></div>
|
|
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <span class="comment">// the sharder must outlive this object.</span></div>
|
|
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keyword">explicit</span> <a class="code hl_function" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#a1e57e9610f2a8aef08167fe8f0501eb8">ShardedWeightedAverage</a>(<span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1pdlp_1_1_sharder.html">Sharder</a>* sharder);</div>
|
|
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
|
|
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#aa558a8bd44791f7fe2008a291fb4a94c"> 46</a></span> <a class="code hl_function" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#aa558a8bd44791f7fe2008a291fb4a94c">ShardedWeightedAverage</a>(<a class="code hl_class" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html">ShardedWeightedAverage</a>&&) = <span class="keywordflow">default</span>;</div>
|
|
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"><a class="line" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#a783c4605afc2cdecd21f987d996c342b"> 47</a></span> <a class="code hl_class" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html">ShardedWeightedAverage</a>& <a class="code hl_function" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#a783c4605afc2cdecd21f987d996c342b">operator=</a>(<a class="code hl_class" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html">ShardedWeightedAverage</a>&&) = <span class="keywordflow">default</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"> 49</span> <span class="comment">// Adds the datapoint to the average with the given weight. CHECK-fails if</span></div>
|
|
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="comment">// the weight is negative.</span></div>
|
|
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#a67840b47c5130550899905f06eba16da">Add</a>(<span class="keyword">const</span> Eigen::VectorXd& datapoint, <span class="keywordtype">double</span> <a class="code hl_variable" href="pack_8cc.html#a4255f714cea26cdd64f6a0ee72d34a8c">weight</a>);</div>
|
|
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
|
|
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="comment">// Clears the sum to zero, i.e., just constructed.</span></div>
|
|
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#aa71d36872f416feaa853788a7a7a7ef8">Clear</a>();</div>
|
|
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> </div>
|
|
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="comment">// Returns true if there is at least one term in the average with a positive</span></div>
|
|
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="comment">// weight.</span></div>
|
|
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#aa43cefccfa9f955209677691815ccf9f"> 58</a></span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#aa43cefccfa9f955209677691815ccf9f">HasNonzeroWeight</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> sum_weights_ > 0.0; }</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"> 60</span> <span class="comment">// Returns the sum of the weights of the datapoints added so far.</span></div>
|
|
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#a002516a870136ff3408d56442ae7c07b"> 61</a></span> <span class="keywordtype">double</span> <a class="code hl_function" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#a002516a870136ff3408d56442ae7c07b">Weight</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> sum_weights_; }</div>
|
|
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> </div>
|
|
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="comment">// Computes the weighted average of the datapoints added so far, i.e.,</span></div>
|
|
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="comment">// sum_i weight[i] * datapoint[i] / sum_i weight[i]. The results are set to</span></div>
|
|
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="comment">// zero if HasNonzeroWeight() is false.</span></div>
|
|
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> Eigen::VectorXd <a class="code hl_function" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#ab1e40710c900002a2cf0af3e6c490bde">ComputeAverage</a>() <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> </div>
|
|
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#a82627d5920fd94ef08eb017772f3c8c1"> 68</a></span> <span class="keywordtype">int</span> <a class="code hl_function" href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#a82627d5920fd94ef08eb017772f3c8c1">NumTerms</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> num_terms_; }</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"> 70</span> <span class="keyword">private</span>:</div>
|
|
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> Eigen::VectorXd average_;</div>
|
|
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordtype">double</span> sum_weights_ = 0.0;</div>
|
|
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> <span class="keywordtype">int</span> num_terms_ = 0;</div>
|
|
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> <span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1pdlp_1_1_sharder.html">Sharder</a>* sharder_;</div>
|
|
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span>};</div>
|
|
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> </div>
|
|
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span><span class="comment">// Returns a QuadraticProgramStats object for a ShardedQuadraticProgram.</span></div>
|
|
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span>QuadraticProgramStats <a class="code hl_function" href="namespaceoperations__research_1_1pdlp.html#ab315578d37cb2f5e1111b0176254cb84">ComputeStats</a>(<span class="keyword">const</span> ShardedQuadraticProgram& qp,</div>
|
|
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> <span class="keywordtype">double</span> infinite_constraint_bound_threshold =</div>
|
|
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> std::numeric_limits<double>::infinity());</div>
|
|
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> </div>
|
|
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span><span class="comment">// LInfRuizRescaling and L2NormRescaling rescale the (scaled) constraint matrix</span></div>
|
|
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span><span class="comment">// of the LP by updating the scaling vectors in-place. More specifically, the</span></div>
|
|
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span><span class="comment">// (scaled) constraint matrix always has the format: diag(row_scaling_vec) *</span></div>
|
|
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span><span class="comment">// sharded_qp.Qp().constraint_matrix * diag(col_scaling_vec), and</span></div>
|
|
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span><span class="comment">// row_scaling_vec and col_scaling_vec are updated in-place. On input,</span></div>
|
|
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span><span class="comment">// row_scaling_vec and col_scaling_vec provide the initial scaling.</span></div>
|
|
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> </div>
|
|
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span><span class="comment">// With each iteration of LInfRuizRescaling scaling, row_scaling_vec</span></div>
|
|
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span><span class="comment">// (col_scaling_vec) is divided by the sqrt of the row (col) LInf norm of the</span></div>
|
|
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span><span class="comment">// current (scaled) constraint matrix. The (scaled) constraint matrix approaches</span></div>
|
|
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span><span class="comment">// having all row and column LInf norms equal to 1 as the number of iterations</span></div>
|
|
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span><span class="comment">// goes to infinity. This convergence is fast (linear). More details of Ruiz</span></div>
|
|
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span><span class="comment">// rescaling algorithm can be found at:</span></div>
|
|
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span><span class="comment">// http://www.numerical.rl.ac.uk/reports/drRAL2001034.pdf.</span></div>
|
|
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1pdlp.html#a39b6d816e6a31a4c4964f5592ed8c056"> 96</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="namespaceoperations__research_1_1pdlp.html#a54ded6625965f8ddd342161a55263cce">LInfRuizRescaling</a>(<span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1pdlp_1_1_sharded_quadratic_program.html">ShardedQuadraticProgram</a>& sharded_qp,</div>
|
|
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keyword">const</span> <span class="keywordtype">int</span> num_iterations,</div>
|
|
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> Eigen::VectorXd& row_scaling_vec,</div>
|
|
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> Eigen::VectorXd& col_scaling_vec);</div>
|
|
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> </div>
|
|
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span><span class="comment">// L2NormRescaling divides row_scaling_vec (col_scaling_vec) by the sqrt of the</span></div>
|
|
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span><span class="comment">// row (col) L2 norm of the current (scaled) constraint matrix. Unlike</span></div>
|
|
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span><span class="comment">// LInfRescaling, this function does only one iteration because the scaling</span></div>
|
|
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span><span class="comment">// procedure does not converge in general. This is not Ruiz rescaling for the L2</span></div>
|
|
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span><span class="comment">// norm.</span></div>
|
|
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1pdlp.html#af41379e6fa8d7e6e6e8151c256906970"> 106</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="namespaceoperations__research_1_1pdlp.html#a9dee2894b8028a57b7f7d2306b402e44">L2NormRescaling</a>(<span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1pdlp_1_1_sharded_quadratic_program.html">ShardedQuadraticProgram</a>& sharded_qp,</div>
|
|
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> Eigen::VectorXd& row_scaling_vec,</div>
|
|
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> Eigen::VectorXd& col_scaling_vec);</div>
|
|
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> </div>
|
|
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"><a class="line" href="structoperations__research_1_1pdlp_1_1_rescaling_options.html"> 110</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structoperations__research_1_1pdlp_1_1_rescaling_options.html">RescalingOptions</a> {</div>
|
|
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"><a class="line" href="structoperations__research_1_1pdlp_1_1_rescaling_options.html#ad3f4c83145ae0a650089a980c4c7fe60"> 111</a></span> <span class="keywordtype">int</span> <a class="code hl_variable" href="structoperations__research_1_1pdlp_1_1_rescaling_options.html#ad3f4c83145ae0a650089a980c4c7fe60">l_inf_ruiz_iterations</a>;</div>
|
|
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"><a class="line" href="structoperations__research_1_1pdlp_1_1_rescaling_options.html#a74bba1825289ddbad8bf96e840ebfeab"> 112</a></span> <span class="keywordtype">bool</span> <a class="code hl_variable" href="structoperations__research_1_1pdlp_1_1_rescaling_options.html#a74bba1825289ddbad8bf96e840ebfeab">l2_norm_rescaling</a>;</div>
|
|
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span>};</div>
|
|
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> </div>
|
|
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="structoperations__research_1_1pdlp_1_1_scaling_vectors.html"> 115</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structoperations__research_1_1pdlp_1_1_scaling_vectors.html">ScalingVectors</a> {</div>
|
|
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"><a class="line" href="structoperations__research_1_1pdlp_1_1_scaling_vectors.html#a5e823e9942e65836de2aa9ac368af52b"> 116</a></span> Eigen::VectorXd <a class="code hl_variable" href="structoperations__research_1_1pdlp_1_1_scaling_vectors.html#a5e823e9942e65836de2aa9ac368af52b">row_scaling_vec</a>;</div>
|
|
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"><a class="line" href="structoperations__research_1_1pdlp_1_1_scaling_vectors.html#a0cc30e2e81bce3756e334d29e4021a31"> 117</a></span> Eigen::VectorXd <a class="code hl_variable" href="structoperations__research_1_1pdlp_1_1_scaling_vectors.html#a0cc30e2e81bce3756e334d29e4021a31">col_scaling_vec</a>;</div>
|
|
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span>};</div>
|
|
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> </div>
|
|
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span><span class="comment">// Applies the rescaling specified by rescaling_options to sharded_qp (in</span></div>
|
|
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span><span class="comment">// place). Returns the scaling vectors that were applied.</span></div>
|
|
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span><a class="code hl_struct" href="structoperations__research_1_1pdlp_1_1_scaling_vectors.html">ScalingVectors</a> <a class="code hl_function" href="namespaceoperations__research_1_1pdlp.html#aac68304831a1bc81557fb03623a619d6">ApplyRescaling</a>(<span class="keyword">const</span> <a class="code hl_struct" href="structoperations__research_1_1pdlp_1_1_rescaling_options.html">RescalingOptions</a>& rescaling_options,</div>
|
|
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <a class="code hl_class" href="classoperations__research_1_1pdlp_1_1_sharded_quadratic_program.html">ShardedQuadraticProgram</a>& sharded_qp);</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"><a class="line" href="structoperations__research_1_1pdlp_1_1_lagrangian_part.html"> 125</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structoperations__research_1_1pdlp_1_1_lagrangian_part.html">LagrangianPart</a> {</div>
|
|
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"><a class="line" href="structoperations__research_1_1pdlp_1_1_lagrangian_part.html#aee90379adb0307effb138f4871edbc5c"> 126</a></span> <span class="keywordtype">double</span> <a class="code hl_variable" href="structoperations__research_1_1pdlp_1_1_lagrangian_part.html#aee90379adb0307effb138f4871edbc5c">value</a> = 0.0;</div>
|
|
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"><a class="line" href="structoperations__research_1_1pdlp_1_1_lagrangian_part.html#a1cb87fb26e738040e82cbc0c02444be9"> 127</a></span> Eigen::VectorXd <a class="code hl_variable" href="structoperations__research_1_1pdlp_1_1_lagrangian_part.html#a1cb87fb26e738040e82cbc0c02444be9">gradient</a>;</div>
|
|
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span>};</div>
|
|
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> </div>
|
|
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span><span class="comment">// Computes the value of the primal part of the Lagrangian function defined at</span></div>
|
|
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span><span class="comment">// https://developers.google.com/optimization/lp/pdlp_math, i.e.,</span></div>
|
|
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span><span class="comment">// c'x + (1/2) x'Qx - y'Ax and its gradient with respect to the primal variables</span></div>
|
|
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span><span class="comment">// x, i.e., c + Qx - A'y. The dual_product argument is A'y. Note: The objective</span></div>
|
|
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span><span class="comment">// constant is omitted. The result is undefined and invalid if any primal bounds</span></div>
|
|
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span><span class="comment">// are violated.</span></div>
|
|
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1pdlp.html#abe180ee4e003e6a819c90205bf38b60f"> 136</a></span><a class="code hl_struct" href="structoperations__research_1_1pdlp_1_1_lagrangian_part.html">LagrangianPart</a> <a class="code hl_function" href="namespaceoperations__research_1_1pdlp.html#a259d3f73717a2ababa9df2dd43914656">ComputePrimalGradient</a>(<span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1pdlp_1_1_sharded_quadratic_program.html">ShardedQuadraticProgram</a>& sharded_qp,</div>
|
|
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="keyword">const</span> Eigen::VectorXd& primal_solution,</div>
|
|
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <span class="keyword">const</span> Eigen::VectorXd& dual_product);</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">// Returns a subderivative of the concave dual penalty function that appears in</span></div>
|
|
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span><span class="comment">// the Lagrangian: -p(dual; -constraint_upper_bound, -constraint_lower_bound) =</span></div>
|
|
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span><span class="comment">// { constraint_upper_bound * dual when dual < 0, 0 when dual == 0, and</span></div>
|
|
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span><span class="comment">// constraint_lower_bound * dual when dual > 0}</span></div>
|
|
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span><span class="comment">// (as defined at https://developers.google.com/optimization/lp/pdlp_math).</span></div>
|
|
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span><span class="comment">// The subderivative is not necessarily unique when dual == 0. In this case, if</span></div>
|
|
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span><span class="comment">// only one of the bounds is finite, we return that one. If both are finite, we</span></div>
|
|
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span><span class="comment">// return the primal product projected onto the bounds, which causes the dual</span></div>
|
|
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span><span class="comment">// Lagrangian gradient to be zero when the constraint is not violated. If both</span></div>
|
|
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"> 149</span><span class="comment">// are infinite, we return zero. The value returned is valid only when the</span></div>
|
|
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span><span class="comment">// function is finite-valued.</span></div>
|
|
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span><span class="keywordtype">double</span> <a class="code hl_function" href="namespaceoperations__research_1_1pdlp.html#a6fe6fa17061fa3b8610cce9cf707574f">DualSubgradientCoefficient</a>(<span class="keyword">const</span> <span class="keywordtype">double</span> constraint_lower_bound,</div>
|
|
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="keyword">const</span> <span class="keywordtype">double</span> constraint_upper_bound,</div>
|
|
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <span class="keyword">const</span> <span class="keywordtype">double</span> dual,</div>
|
|
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="keyword">const</span> <span class="keywordtype">double</span> primal_product);</div>
|
|
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> </div>
|
|
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span><span class="comment">// Computes the value of the dual part of the Lagrangian function defined at</span></div>
|
|
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span><span class="comment">// https://developers.google.com/optimization/lp/pdlp_math, i.e., -h^*(y) and</span></div>
|
|
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span><span class="comment">// the gradient of the Lagrangian with respect to the dual variables y, i.e.,</span></div>
|
|
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span><span class="comment">// -Ax - \grad_y h^*(y). Note the asymmetry with ComputePrimalGradient: the term</span></div>
|
|
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span><span class="comment">// -y'Ax is not part of the value. Because h^*(y) is piece-wise linear, a</span></div>
|
|
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span><span class="comment">// subgradient is returned at a point of non- smoothness. The primal_product</span></div>
|
|
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span><span class="comment">// argument is Ax. The result is undefined and invalid if any duals violate</span></div>
|
|
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span><span class="comment">// their bounds.</span></div>
|
|
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span><a class="code hl_struct" href="structoperations__research_1_1pdlp_1_1_lagrangian_part.html">LagrangianPart</a> <a class="code hl_function" href="namespaceoperations__research_1_1pdlp.html#a608ed26a4c7ff3bdcb22d25ff890f47d">ComputeDualGradient</a>(<span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1pdlp_1_1_sharded_quadratic_program.html">ShardedQuadraticProgram</a>& sharded_qp,</div>
|
|
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="keyword">const</span> Eigen::VectorXd& dual_solution,</div>
|
|
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> <span class="keyword">const</span> Eigen::VectorXd& primal_product);</div>
|
|
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> </div>
|
|
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"><a class="line" href="structoperations__research_1_1pdlp_1_1_singular_value_and_iterations.html"> 168</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structoperations__research_1_1pdlp_1_1_singular_value_and_iterations.html">SingularValueAndIterations</a> {</div>
|
|
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"><a class="line" href="structoperations__research_1_1pdlp_1_1_singular_value_and_iterations.html#ab52b15a584f6ef4a400369b576ca325e"> 169</a></span> <span class="keywordtype">double</span> <a class="code hl_variable" href="structoperations__research_1_1pdlp_1_1_singular_value_and_iterations.html#ab52b15a584f6ef4a400369b576ca325e">singular_value</a>;</div>
|
|
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"><a class="line" href="structoperations__research_1_1pdlp_1_1_singular_value_and_iterations.html#ab702e2f7530d6172eea3780d8923bd71"> 170</a></span> <span class="keywordtype">int</span> <a class="code hl_variable" href="structoperations__research_1_1pdlp_1_1_singular_value_and_iterations.html#ab702e2f7530d6172eea3780d8923bd71">num_iterations</a>;</div>
|
|
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"><a class="line" href="structoperations__research_1_1pdlp_1_1_singular_value_and_iterations.html#a338217cf63f5eeb2013762ed69e7f02a"> 171</a></span> <span class="keywordtype">double</span> <a class="code hl_variable" href="structoperations__research_1_1pdlp_1_1_singular_value_and_iterations.html#a338217cf63f5eeb2013762ed69e7f02a">estimated_relative_error</a>;</div>
|
|
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span>};</div>
|
|
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> </div>
|
|
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span><span class="comment">// Estimates the maximum singular value of A by applying the method of power</span></div>
|
|
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span><span class="comment">// iteration to A^T A. If a primal and/or dual solution is provided, restricts</span></div>
|
|
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span><span class="comment">// to the "active" part of A, that is, the columns (rows) for variables that are</span></div>
|
|
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span><span class="comment">// not at their bounds in the solution. The estimate will have</span></div>
|
|
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span><span class="comment">// desired_relative_error with probability at least 1 - failure_probability.</span></div>
|
|
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span><span class="comment">// The number of iterations will be approximately</span></div>
|
|
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span><span class="comment">// log(primal_size / failure_probability^2)/(2 * desired_relative_error).</span></div>
|
|
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span><span class="comment">// Uses a mersenne-twister portable random number generator to generate the</span></div>
|
|
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span><span class="comment">// starting point for the power method, in order to have deterministic results.</span></div>
|
|
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1pdlp.html#a2cd9fe41f79ca9684bfa58f1495d93cf"> 183</a></span><a class="code hl_struct" href="structoperations__research_1_1pdlp_1_1_singular_value_and_iterations.html">SingularValueAndIterations</a> <a class="code hl_function" href="namespaceoperations__research_1_1pdlp.html#a880902cb3a98b7205fa57be9e16a82c7">EstimateMaximumSingularValueOfConstraintMatrix</a>(</div>
|
|
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1pdlp_1_1_sharded_quadratic_program.html">ShardedQuadraticProgram</a>& sharded_qp,</div>
|
|
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> <span class="keyword">const</span> absl::optional<Eigen::VectorXd>& primal_solution,</div>
|
|
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> <span class="keyword">const</span> absl::optional<Eigen::VectorXd>& dual_solution,</div>
|
|
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> <span class="keyword">const</span> <span class="keywordtype">double</span> desired_relative_error, <span class="keyword">const</span> <span class="keywordtype">double</span> failure_probability,</div>
|
|
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> std::mt19937& mt_generator);</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><span class="comment">// Checks if the lower and upper bounds of the problem are consistent, i.e. for</span></div>
|
|
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span><span class="comment">// each variable and constraint bound we have lower_bound <= upper_bound. If</span></div>
|
|
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span><span class="comment">// the input is consistent the method returns true, otherwise it returns false.</span></div>
|
|
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span><span class="comment">// See also HasValidBounds(const QuadraticProgram&).</span></div>
|
|
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span><span class="keywordtype">bool</span> <a class="code hl_function" href="namespaceoperations__research_1_1pdlp.html#a77dbe245ed9fb597ad836b27ac989f26">HasValidBounds</a>(<span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1pdlp_1_1_sharded_quadratic_program.html">ShardedQuadraticProgram</a>& sharded_qp);</div>
|
|
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> </div>
|
|
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span><span class="comment">// Projects a primal vector onto the variable bounds constraints.</span></div>
|
|
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1pdlp.html#a03f1c93e7c9a345a90874f314196d1aa"> 197</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="namespaceoperations__research_1_1pdlp.html#acb7f29f435d6c9fc53148ee403c7049e">ProjectToPrimalVariableBounds</a>(<span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1pdlp_1_1_sharded_quadratic_program.html">ShardedQuadraticProgram</a>& sharded_qp,</div>
|
|
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> Eigen::VectorXd& primal);</div>
|
|
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> </div>
|
|
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span><span class="comment">// Projects the dual vector to the dual variable bounds; see</span></div>
|
|
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span><span class="comment">// https://developers.google.com/optimization/lp/pdlp_math#dual_variable_bounds.</span></div>
|
|
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"><a class="line" href="namespaceoperations__research_1_1pdlp.html#a4b46c4812be8af75325d63ed3ced80f0"> 202</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="namespaceoperations__research_1_1pdlp.html#a898c0c776a5736cf1931036d0d370724">ProjectToDualVariableBounds</a>(<span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1pdlp_1_1_sharded_quadratic_program.html">ShardedQuadraticProgram</a>& sharded_qp,</div>
|
|
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> Eigen::VectorXd& dual);</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">// namespace operations_research::pdlp</span></div>
|
|
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> </div>
|
|
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span><span class="preprocessor">#endif </span><span class="comment">// PDLP_SHARDED_OPTIMIZATION_UTILS_H_</span></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1pdlp_1_1_sharded_quadratic_program_html"><div class="ttname"><a href="classoperations__research_1_1pdlp_1_1_sharded_quadratic_program.html">operations_research::pdlp::ShardedQuadraticProgram</a></div><div class="ttdef"><b>Definition:</b> <a href="sharded__quadratic__program_8h_source.html#l00033">sharded_quadratic_program.h:33</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1pdlp_1_1_sharded_weighted_average_html"><div class="ttname"><a href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html">operations_research::pdlp::ShardedWeightedAverage</a></div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8h_source.html#l00039">sharded_optimization_utils.h:39</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1pdlp_1_1_sharded_weighted_average_html_a002516a870136ff3408d56442ae7c07b"><div class="ttname"><a href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#a002516a870136ff3408d56442ae7c07b">operations_research::pdlp::ShardedWeightedAverage::Weight</a></div><div class="ttdeci">double Weight() const</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8h_source.html#l00061">sharded_optimization_utils.h:61</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1pdlp_1_1_sharded_weighted_average_html_a1e57e9610f2a8aef08167fe8f0501eb8"><div class="ttname"><a href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#a1e57e9610f2a8aef08167fe8f0501eb8">operations_research::pdlp::ShardedWeightedAverage::ShardedWeightedAverage</a></div><div class="ttdeci">ShardedWeightedAverage(const Sharder *sharder)</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8cc_source.html#l00045">sharded_optimization_utils.cc:45</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1pdlp_1_1_sharded_weighted_average_html_a67840b47c5130550899905f06eba16da"><div class="ttname"><a href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#a67840b47c5130550899905f06eba16da">operations_research::pdlp::ShardedWeightedAverage::Add</a></div><div class="ttdeci">void Add(const Eigen::VectorXd &datapoint, double weight)</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8cc_source.html#l00056">sharded_optimization_utils.cc:56</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1pdlp_1_1_sharded_weighted_average_html_a783c4605afc2cdecd21f987d996c342b"><div class="ttname"><a href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#a783c4605afc2cdecd21f987d996c342b">operations_research::pdlp::ShardedWeightedAverage::operator=</a></div><div class="ttdeci">ShardedWeightedAverage & operator=(ShardedWeightedAverage &&)=default</div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1pdlp_1_1_sharded_weighted_average_html_a82627d5920fd94ef08eb017772f3c8c1"><div class="ttname"><a href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#a82627d5920fd94ef08eb017772f3c8c1">operations_research::pdlp::ShardedWeightedAverage::NumTerms</a></div><div class="ttdeci">int NumTerms() const</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8h_source.html#l00068">sharded_optimization_utils.h:68</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1pdlp_1_1_sharded_weighted_average_html_aa43cefccfa9f955209677691815ccf9f"><div class="ttname"><a href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#aa43cefccfa9f955209677691815ccf9f">operations_research::pdlp::ShardedWeightedAverage::HasNonzeroWeight</a></div><div class="ttdeci">bool HasNonzeroWeight() const</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8h_source.html#l00058">sharded_optimization_utils.h:58</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1pdlp_1_1_sharded_weighted_average_html_aa558a8bd44791f7fe2008a291fb4a94c"><div class="ttname"><a href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#aa558a8bd44791f7fe2008a291fb4a94c">operations_research::pdlp::ShardedWeightedAverage::ShardedWeightedAverage</a></div><div class="ttdeci">ShardedWeightedAverage(ShardedWeightedAverage &&)=default</div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1pdlp_1_1_sharded_weighted_average_html_aa71d36872f416feaa853788a7a7a7ef8"><div class="ttname"><a href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#aa71d36872f416feaa853788a7a7a7ef8">operations_research::pdlp::ShardedWeightedAverage::Clear</a></div><div class="ttdeci">void Clear()</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8cc_source.html#l00067">sharded_optimization_utils.cc:67</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1pdlp_1_1_sharded_weighted_average_html_ab1e40710c900002a2cf0af3e6c490bde"><div class="ttname"><a href="classoperations__research_1_1pdlp_1_1_sharded_weighted_average.html#ab1e40710c900002a2cf0af3e6c490bde">operations_research::pdlp::ShardedWeightedAverage::ComputeAverage</a></div><div class="ttdeci">Eigen::VectorXd ComputeAverage() const</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8cc_source.html#l00075">sharded_optimization_utils.cc:75</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1pdlp_1_1_sharder_html"><div class="ttname"><a href="classoperations__research_1_1pdlp_1_1_sharder.html">operations_research::pdlp::Sharder</a></div><div class="ttdef"><b>Definition:</b> <a href="sharder_8h_source.html#l00034">sharder.h:34</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1pdlp_html"><div class="ttname"><a href="namespaceoperations__research_1_1pdlp.html">operations_research::pdlp</a></div><div class="ttdef"><b>Definition:</b> <a href="iteration__stats_8cc_source.html#l00040">iteration_stats.cc:40</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1pdlp_html_a259d3f73717a2ababa9df2dd43914656"><div class="ttname"><a href="namespaceoperations__research_1_1pdlp.html#a259d3f73717a2ababa9df2dd43914656">operations_research::pdlp::ComputePrimalGradient</a></div><div class="ttdeci">LagrangianPart ComputePrimalGradient(const ShardedQuadraticProgram &sharded_qp, const VectorXd &primal_solution, const VectorXd &dual_product)</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8cc_source.html#l00462">sharded_optimization_utils.cc:462</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1pdlp_html_a54ded6625965f8ddd342161a55263cce"><div class="ttname"><a href="namespaceoperations__research_1_1pdlp.html#a54ded6625965f8ddd342161a55263cce">operations_research::pdlp::LInfRuizRescaling</a></div><div class="ttdeci">void LInfRuizRescaling(const ShardedQuadraticProgram &sharded_qp, const int num_iterations, VectorXd &row_scaling_vec, VectorXd &col_scaling_vec)</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8cc_source.html#l00425">sharded_optimization_utils.cc:425</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1pdlp_html_a608ed26a4c7ff3bdcb22d25ff890f47d"><div class="ttname"><a href="namespaceoperations__research_1_1pdlp.html#a608ed26a4c7ff3bdcb22d25ff890f47d">operations_research::pdlp::ComputeDualGradient</a></div><div class="ttdeci">LagrangianPart ComputeDualGradient(const ShardedQuadraticProgram &sharded_qp, const Eigen::VectorXd &dual_solution, const Eigen::VectorXd &primal_product)</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8cc_source.html#l00518">sharded_optimization_utils.cc:518</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1pdlp_html_a6fe6fa17061fa3b8610cce9cf707574f"><div class="ttname"><a href="namespaceoperations__research_1_1pdlp.html#a6fe6fa17061fa3b8610cce9cf707574f">operations_research::pdlp::DualSubgradientCoefficient</a></div><div class="ttdeci">double DualSubgradientCoefficient(const double constraint_lower_bound, const double constraint_upper_bound, const double dual, const double primal_product)</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8cc_source.html#l00492">sharded_optimization_utils.cc:492</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1pdlp_html_a77dbe245ed9fb597ad836b27ac989f26"><div class="ttname"><a href="namespaceoperations__research_1_1pdlp.html#a77dbe245ed9fb597ad836b27ac989f26">operations_research::pdlp::HasValidBounds</a></div><div class="ttdeci">bool HasValidBounds(const QuadraticProgram &qp)</div><div class="ttdef"><b>Definition:</b> <a href="quadratic__program_8cc_source.html#l00084">quadratic_program.cc:84</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1pdlp_html_a880902cb3a98b7205fa57be9e16a82c7"><div class="ttname"><a href="namespaceoperations__research_1_1pdlp.html#a880902cb3a98b7205fa57be9e16a82c7">operations_research::pdlp::EstimateMaximumSingularValueOfConstraintMatrix</a></div><div class="ttdeci">SingularValueAndIterations EstimateMaximumSingularValueOfConstraintMatrix(const ShardedQuadraticProgram &sharded_qp, const absl::optional< VectorXd > &primal_solution, const absl::optional< VectorXd > &dual_solution, const double desired_relative_error, const double failure_probability, std::mt19937 &mt_generator)</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8cc_source.html#l00706">sharded_optimization_utils.cc:706</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1pdlp_html_a898c0c776a5736cf1931036d0d370724"><div class="ttname"><a href="namespaceoperations__research_1_1pdlp.html#a898c0c776a5736cf1931036d0d370724">operations_research::pdlp::ProjectToDualVariableBounds</a></div><div class="ttdeci">void ProjectToDualVariableBounds(const ShardedQuadraticProgram &sharded_qp, VectorXd &dual)</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8cc_source.html#l00762">sharded_optimization_utils.cc:762</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1pdlp_html_a9dee2894b8028a57b7f7d2306b402e44"><div class="ttname"><a href="namespaceoperations__research_1_1pdlp.html#a9dee2894b8028a57b7f7d2306b402e44">operations_research::pdlp::L2NormRescaling</a></div><div class="ttdeci">void L2NormRescaling(const ShardedQuadraticProgram &sharded_qp, VectorXd &row_scaling_vec, VectorXd &col_scaling_vec)</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8cc_source.html#l00432">sharded_optimization_utils.cc:432</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1pdlp_html_aac68304831a1bc81557fb03623a619d6"><div class="ttname"><a href="namespaceoperations__research_1_1pdlp.html#aac68304831a1bc81557fb03623a619d6">operations_research::pdlp::ApplyRescaling</a></div><div class="ttdeci">ScalingVectors ApplyRescaling(const RescalingOptions &rescaling_options, ShardedQuadraticProgram &sharded_qp)</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8cc_source.html#l00439">sharded_optimization_utils.cc:439</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1pdlp_html_ab315578d37cb2f5e1111b0176254cb84"><div class="ttname"><a href="namespaceoperations__research_1_1pdlp.html#ab315578d37cb2f5e1111b0176254cb84">operations_research::pdlp::ComputeStats</a></div><div class="ttdeci">QuadraticProgramStats ComputeStats(const ShardedQuadraticProgram &qp, const double infinite_constraint_bound_threshold)</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8cc_source.html#l00303">sharded_optimization_utils.cc:303</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_1_1pdlp_html_acb7f29f435d6c9fc53148ee403c7049e"><div class="ttname"><a href="namespaceoperations__research_1_1pdlp.html#acb7f29f435d6c9fc53148ee403c7049e">operations_research::pdlp::ProjectToPrimalVariableBounds</a></div><div class="ttdeci">void ProjectToPrimalVariableBounds(const ShardedQuadraticProgram &sharded_qp, VectorXd &primal)</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8cc_source.html#l00751">sharded_optimization_utils.cc:751</a></div></div>
|
|
<div class="ttc" id="apack_8cc_html_a4255f714cea26cdd64f6a0ee72d34a8c"><div class="ttname"><a href="pack_8cc.html#a4255f714cea26cdd64f6a0ee72d34a8c">weight</a></div><div class="ttdeci">int64_t weight</div><div class="ttdef"><b>Definition:</b> <a href="pack_8cc_source.html#l00510">pack.cc:510</a></div></div>
|
|
<div class="ttc" id="asharded__quadratic__program_8h_html"><div class="ttname"><a href="sharded__quadratic__program_8h.html">sharded_quadratic_program.h</a></div></div>
|
|
<div class="ttc" id="asharder_8h_html"><div class="ttname"><a href="sharder_8h.html">sharder.h</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1pdlp_1_1_lagrangian_part_html"><div class="ttname"><a href="structoperations__research_1_1pdlp_1_1_lagrangian_part.html">operations_research::pdlp::LagrangianPart</a></div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8h_source.html#l00125">sharded_optimization_utils.h:125</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1pdlp_1_1_lagrangian_part_html_a1cb87fb26e738040e82cbc0c02444be9"><div class="ttname"><a href="structoperations__research_1_1pdlp_1_1_lagrangian_part.html#a1cb87fb26e738040e82cbc0c02444be9">operations_research::pdlp::LagrangianPart::gradient</a></div><div class="ttdeci">Eigen::VectorXd gradient</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8h_source.html#l00127">sharded_optimization_utils.h:127</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1pdlp_1_1_lagrangian_part_html_aee90379adb0307effb138f4871edbc5c"><div class="ttname"><a href="structoperations__research_1_1pdlp_1_1_lagrangian_part.html#aee90379adb0307effb138f4871edbc5c">operations_research::pdlp::LagrangianPart::value</a></div><div class="ttdeci">double value</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8h_source.html#l00126">sharded_optimization_utils.h:126</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1pdlp_1_1_rescaling_options_html"><div class="ttname"><a href="structoperations__research_1_1pdlp_1_1_rescaling_options.html">operations_research::pdlp::RescalingOptions</a></div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8h_source.html#l00110">sharded_optimization_utils.h:110</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1pdlp_1_1_rescaling_options_html_a74bba1825289ddbad8bf96e840ebfeab"><div class="ttname"><a href="structoperations__research_1_1pdlp_1_1_rescaling_options.html#a74bba1825289ddbad8bf96e840ebfeab">operations_research::pdlp::RescalingOptions::l2_norm_rescaling</a></div><div class="ttdeci">bool l2_norm_rescaling</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8h_source.html#l00112">sharded_optimization_utils.h:112</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1pdlp_1_1_rescaling_options_html_ad3f4c83145ae0a650089a980c4c7fe60"><div class="ttname"><a href="structoperations__research_1_1pdlp_1_1_rescaling_options.html#ad3f4c83145ae0a650089a980c4c7fe60">operations_research::pdlp::RescalingOptions::l_inf_ruiz_iterations</a></div><div class="ttdeci">int l_inf_ruiz_iterations</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8h_source.html#l00111">sharded_optimization_utils.h:111</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1pdlp_1_1_scaling_vectors_html"><div class="ttname"><a href="structoperations__research_1_1pdlp_1_1_scaling_vectors.html">operations_research::pdlp::ScalingVectors</a></div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8h_source.html#l00115">sharded_optimization_utils.h:115</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1pdlp_1_1_scaling_vectors_html_a0cc30e2e81bce3756e334d29e4021a31"><div class="ttname"><a href="structoperations__research_1_1pdlp_1_1_scaling_vectors.html#a0cc30e2e81bce3756e334d29e4021a31">operations_research::pdlp::ScalingVectors::col_scaling_vec</a></div><div class="ttdeci">Eigen::VectorXd col_scaling_vec</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8h_source.html#l00117">sharded_optimization_utils.h:117</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1pdlp_1_1_scaling_vectors_html_a5e823e9942e65836de2aa9ac368af52b"><div class="ttname"><a href="structoperations__research_1_1pdlp_1_1_scaling_vectors.html#a5e823e9942e65836de2aa9ac368af52b">operations_research::pdlp::ScalingVectors::row_scaling_vec</a></div><div class="ttdeci">Eigen::VectorXd row_scaling_vec</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8h_source.html#l00116">sharded_optimization_utils.h:116</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1pdlp_1_1_singular_value_and_iterations_html"><div class="ttname"><a href="structoperations__research_1_1pdlp_1_1_singular_value_and_iterations.html">operations_research::pdlp::SingularValueAndIterations</a></div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8h_source.html#l00168">sharded_optimization_utils.h:168</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1pdlp_1_1_singular_value_and_iterations_html_a338217cf63f5eeb2013762ed69e7f02a"><div class="ttname"><a href="structoperations__research_1_1pdlp_1_1_singular_value_and_iterations.html#a338217cf63f5eeb2013762ed69e7f02a">operations_research::pdlp::SingularValueAndIterations::estimated_relative_error</a></div><div class="ttdeci">double estimated_relative_error</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8h_source.html#l00171">sharded_optimization_utils.h:171</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1pdlp_1_1_singular_value_and_iterations_html_ab52b15a584f6ef4a400369b576ca325e"><div class="ttname"><a href="structoperations__research_1_1pdlp_1_1_singular_value_and_iterations.html#ab52b15a584f6ef4a400369b576ca325e">operations_research::pdlp::SingularValueAndIterations::singular_value</a></div><div class="ttdeci">double singular_value</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8h_source.html#l00169">sharded_optimization_utils.h:169</a></div></div>
|
|
<div class="ttc" id="astructoperations__research_1_1pdlp_1_1_singular_value_and_iterations_html_ab702e2f7530d6172eea3780d8923bd71"><div class="ttname"><a href="structoperations__research_1_1pdlp_1_1_singular_value_and_iterations.html#ab702e2f7530d6172eea3780d8923bd71">operations_research::pdlp::SingularValueAndIterations::num_iterations</a></div><div class="ttdeci">int num_iterations</div><div class="ttdef"><b>Definition:</b> <a href="sharded__optimization__utils_8h_source.html#l00170">sharded_optimization_utils.h:170</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_7cc48880791e3dd695dbfc2349101d28.html">pdlp</a></li><li class="navelem"><a class="el" href="sharded__optimization__utils_8h.html">sharded_optimization_utils.h</a></li>
|
|
<li class="footer">Generated by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.9.3 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|