432 lines
82 KiB
HTML
432 lines
82 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.2"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>OR-Tools: piecewise_linear_function.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.1</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.2 -->
|
|
<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('piecewise__linear__function_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">piecewise_linear_function.h</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a href="piecewise__linear__function_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">// This file implements piecewise linear functions over int64_t. It is built</span></div>
|
|
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="comment">// by inserting segments.</span></div>
|
|
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="comment">//</span></div>
|
|
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="comment">// This class maintains a minimal internal representation and checks for</span></div>
|
|
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span><span class="comment">// overflow.</span></div>
|
|
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
|
|
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span><span class="preprocessor">#ifndef OR_TOOLS_UTIL_PIECEWISE_LINEAR_FUNCTION_H_</span></div>
|
|
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#define OR_TOOLS_UTIL_PIECEWISE_LINEAR_FUNCTION_H_</span></div>
|
|
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
|
|
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span><span class="preprocessor">#include <algorithm></span></div>
|
|
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="preprocessor">#include <functional></span></div>
|
|
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#include <memory></span></div>
|
|
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#include <string></span></div>
|
|
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor">#include <vector></span></div>
|
|
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
|
|
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span><span class="preprocessor">#include "<a class="code" href="basictypes_8h.html">ortools/base/basictypes.h</a>"</span></div>
|
|
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span><span class="preprocessor">#include "<a class="code" href="integral__types_8h.html">ortools/base/integral_types.h</a>"</span></div>
|
|
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span><span class="preprocessor">#include "<a class="code" href="macros_8h.html">ortools/base/macros.h</a>"</span></div>
|
|
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="preprocessor">#include "<a class="code" href="saturated__arithmetic_8h.html">ortools/util/saturated_arithmetic.h</a>"</span></div>
|
|
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> </div>
|
|
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespaceoperations__research.html">operations_research</a> {</div>
|
|
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span><span class="comment">// This structure stores one straight line. It contains the start point, the</span></div>
|
|
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span><span class="comment">// end point and the slope.</span></div>
|
|
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span><span class="comment">// It is defined for x values between start_x and end_x.</span></div>
|
|
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"><a class="line" href="classoperations__research_1_1_piecewise_segment.html"> 38</a></span><span class="keyword">class </span><a class="code hl_class" href="classoperations__research_1_1_piecewise_segment.html">PiecewiseSegment</a> {</div>
|
|
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keyword">public</span>:</div>
|
|
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#a535295123475f146509112e5423154cc">PiecewiseSegment</a>(int64_t point_x, int64_t point_y, int64_t <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#a3e0673c584a9281683e7d137fe7476cb">slope</a>,</div>
|
|
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> int64_t other_point_x);</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> <span class="comment">// Returns the value of the segment at point x.</span></div>
|
|
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> int64_t <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#a717f65b06206ba8cc7bbe1aa0c4a6c3b">Value</a>(int64_t x) <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> <span class="comment">// Returns the start of the segment's domain.</span></div>
|
|
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"><a class="line" href="classoperations__research_1_1_piecewise_segment.html#afcfbd07e95226dfc2556b43e41fe4fae"> 46</a></span> int64_t <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#afcfbd07e95226dfc2556b43e41fe4fae">start_x</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> start_x_; }</div>
|
|
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> <span class="comment">// Returns the end of the segment's domain.</span></div>
|
|
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"><a class="line" href="classoperations__research_1_1_piecewise_segment.html#a812c497c8e21c8b38593fc358c2ae6fd"> 48</a></span> int64_t <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#a812c497c8e21c8b38593fc358c2ae6fd">end_x</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> end_x_; }</div>
|
|
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> <span class="comment">// Returns the value at the start of the segment's domain.</span></div>
|
|
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="classoperations__research_1_1_piecewise_segment.html#a47a1fa2007b506d4ec34e2794ef5b1e1"> 50</a></span> int64_t <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#a47a1fa2007b506d4ec34e2794ef5b1e1">start_y</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#a717f65b06206ba8cc7bbe1aa0c4a6c3b">Value</a>(start_x_); }</div>
|
|
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="comment">// Returns the value at the end of the segment's domain.</span></div>
|
|
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="classoperations__research_1_1_piecewise_segment.html#aa5f57f858a4566fdb393f06840c52fc8"> 52</a></span> int64_t <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#aa5f57f858a4566fdb393f06840c52fc8">end_y</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#a717f65b06206ba8cc7bbe1aa0c4a6c3b">Value</a>(end_x_); }</div>
|
|
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="comment">// Returns the segment's slope.</span></div>
|
|
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"><a class="line" href="classoperations__research_1_1_piecewise_segment.html#a3e0673c584a9281683e7d137fe7476cb"> 54</a></span> int64_t <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#a3e0673c584a9281683e7d137fe7476cb">slope</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> slope_; }</div>
|
|
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="comment">// Returns the intersection of the segment's extension with the y axis.</span></div>
|
|
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="classoperations__research_1_1_piecewise_segment.html#aaae2d9393b903d8dea5e9afd1e49fae6"> 56</a></span> int64_t <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#aaae2d9393b903d8dea5e9afd1e49fae6">intersection_y</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> intersection_y_; }</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> <span class="comment">// Comparison method useful for sorting a sequence of segments.</span></div>
|
|
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#afd287f1ff1de1124a2cd8a6fe79cb3fb">SortComparator</a>(<span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1_piecewise_segment.html">PiecewiseSegment</a>& segment1,</div>
|
|
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1_piecewise_segment.html">PiecewiseSegment</a>& segment2);</div>
|
|
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="comment">// Comparison method useful for finding in which segment a point belongs.</span></div>
|
|
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#a77ce53a27b88c53f5fa438a08d00af34">FindComparator</a>(int64_t point, <span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1_piecewise_segment.html">PiecewiseSegment</a>& segment);</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> <span class="comment">// Expands segment to the specified endpoint, if it is further</span></div>
|
|
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="comment">// than the current endpoint. The reference point of the segment</span></div>
|
|
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="comment">// doesn't change for overflow reasons.</span></div>
|
|
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#a8829bfff4b5ca5e126ff3aa7e29e233c">ExpandEnd</a>(int64_t <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#a812c497c8e21c8b38593fc358c2ae6fd">end_x</a>);</div>
|
|
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="comment">// Adds 'constant' to the 'x' the segments.</span></div>
|
|
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#a251fcf13677473e1e7dc22481cedae13">AddConstantToX</a>(int64_t constant);</div>
|
|
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="comment">// Adds 'constant' to the 'y' the segments.</span></div>
|
|
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#a8a76bb73d807580286eda7f04188553b">AddConstantToY</a>(int64_t constant);</div>
|
|
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
|
|
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> std::string <a class="code hl_function" href="classoperations__research_1_1_piecewise_segment.html#a764be64f3029f8b8e23511061d8de355">DebugString</a>() <span class="keyword">const</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"> 75</span> <span class="keyword">private</span>:</div>
|
|
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> <span class="comment">// Computes the value of the segment at point x, taking care of possible</span></div>
|
|
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> <span class="comment">// overflows when the value x follow the x coordinate of the segment's</span></div>
|
|
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="comment">// reference point.</span></div>
|
|
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> int64_t SafeValuePostReference(int64_t x) <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="comment">// Computes the value of the segment at point x, taking care of possible</span></div>
|
|
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> <span class="comment">// overflows when the value x follow the x coordinate of the segment's</span></div>
|
|
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="comment">// reference point.</span></div>
|
|
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> int64_t SafeValuePreReference(int64_t x) <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> </div>
|
|
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span> <span class="comment">// The x coordinate of the segment's left endpoint.</span></div>
|
|
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> int64_t start_x_;</div>
|
|
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"> 87</span> <span class="comment">// The x coordinate of the segment's right endpoint.</span></div>
|
|
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> int64_t end_x_;</div>
|
|
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> <span class="comment">// The segment's slope.</span></div>
|
|
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> int64_t slope_;</div>
|
|
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="comment">// The x coordinate of the segment's finite reference point.</span></div>
|
|
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> int64_t reference_x_;</div>
|
|
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="comment">// The y coordinate of the segment's finite reference point.</span></div>
|
|
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> int64_t reference_y_;</div>
|
|
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="comment">// The intersection of the segment's extension with the y axis.</span></div>
|
|
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> int64_t intersection_y_;</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><span class="comment">// In mathematics, a piecewise linear function is a function composed</span></div>
|
|
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span><span class="comment">// of straight-line, non overlapping sections.</span></div>
|
|
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"><a class="line" href="classoperations__research_1_1_piecewise_linear_function.html"> 101</a></span><span class="keyword">class </span><a class="code hl_class" href="classoperations__research_1_1_piecewise_linear_function.html">PiecewiseLinearFunction</a> {</div>
|
|
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keyword">public</span>:</div>
|
|
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"><a class="line" href="classoperations__research_1_1_piecewise_linear_function.html#a5b390931557183bd4a55afe4cbf4e2ae"> 103</a></span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="classoperations__research_1_1_piecewise_linear_function.html#a5b390931557183bd4a55afe4cbf4e2ae">kNotFound</a>;</div>
|
|
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> </div>
|
|
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="comment">// This API provides a factory for creating different families of Piecewise</span></div>
|
|
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="comment">// Linear Functions based on specific properties of each family. The</span></div>
|
|
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="comment">// PiecewiseLinearFunction is composed by a set of PiecwiseSegments and upon</span></div>
|
|
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="comment">// creation is not modifiable but with the provided function operations.</span></div>
|
|
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="comment">// The object returned by any of these builders in the factory is owned by</span></div>
|
|
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="comment">// the client code.</span></div>
|
|
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> </div>
|
|
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="comment">// Builds the most generic form of multiple-segment piecewise linear function</span></div>
|
|
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="comment">// supporting domain holes. For a fixed index i the elements in points_x[i]</span></div>
|
|
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="comment">// points_y[i], slopes[i], other_points_x[i] represent a segment.</span></div>
|
|
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> <span class="comment">// The point (points_x[i], points_y[i]) represents one of the endpoints of</span></div>
|
|
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="comment">// the segment and the other_points_x[i] represents the x coordinate of the</span></div>
|
|
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="comment">// other endpoint which may precede, follow or coincide with points_x[i].</span></div>
|
|
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> <span class="comment">// The segments represented by these vectors should not be overlapping.</span></div>
|
|
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="comment">// Common endpoints are allowed.</span></div>
|
|
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keyword">static</span> <a class="code hl_class" href="classoperations__research_1_1_piecewise_linear_function.html">PiecewiseLinearFunction</a>* <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#aca73fef94832f1ac2ee9fca0642ebd8f">CreatePiecewiseLinearFunction</a>(</div>
|
|
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> std::vector<int64_t> points_x, std::vector<int64_t> points_y,</div>
|
|
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> std::vector<int64_t> slopes, std::vector<int64_t> other_points_x);</div>
|
|
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> </div>
|
|
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="comment">// Builds a multiple-segment step function with continuous or non continuous</span></div>
|
|
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="comment">// domain. The arguments have the same semantics with the generic builder of</span></div>
|
|
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="comment">// the piecewise linear function. In the step function all the slopes are 0.</span></div>
|
|
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="keyword">static</span> <a class="code hl_class" href="classoperations__research_1_1_piecewise_linear_function.html">PiecewiseLinearFunction</a>* <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a455a939cda40e7ff7441a6319c3d2e56">CreateStepFunction</a>(</div>
|
|
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> std::vector<int64_t> points_x, std::vector<int64_t> points_y,</div>
|
|
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> std::vector<int64_t> other_points_x);</div>
|
|
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> </div>
|
|
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> <span class="comment">// Builds a multiple-segment piecewise linear function with domain from</span></div>
|
|
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="comment">// from kint64min to kint64max with n points and n+1 slopes. Each slope</span></div>
|
|
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <span class="comment">// stops at the point with the corresponding index apart from the last one</span></div>
|
|
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="comment">// which stops at kint64max. The first slope stops at the first point at</span></div>
|
|
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="comment">// the level specified.</span></div>
|
|
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="keyword">static</span> <a class="code hl_class" href="classoperations__research_1_1_piecewise_linear_function.html">PiecewiseLinearFunction</a>* <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#aeeacbd4108ebdc295b15116f01cc562d">CreateFullDomainFunction</a>(</div>
|
|
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> int64_t initial_level, std::vector<int64_t> points_x,</div>
|
|
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> std::vector<int64_t> slopes);</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">// Builds a function consisting of one segment.</span></div>
|
|
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> <span class="keyword">static</span> <a class="code hl_class" href="classoperations__research_1_1_piecewise_linear_function.html">PiecewiseLinearFunction</a>* <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a7cb8cfbc85b138a4cb0b4bedc1a77c6b">CreateOneSegmentFunction</a>(</div>
|
|
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> int64_t point_x, int64_t point_y, int64_t slope, int64_t other_point_x);</div>
|
|
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> </div>
|
|
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="comment">// Builds a function consisting of one ray starting at the specified</span></div>
|
|
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> <span class="comment">// x and y coordinates with the specified slope.</span></div>
|
|
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="keyword">static</span> <a class="code hl_class" href="classoperations__research_1_1_piecewise_linear_function.html">PiecewiseLinearFunction</a>* <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a15a70d449d3ef680a50f76d2afadd58b">CreateRightRayFunction</a>(int64_t point_x,</div>
|
|
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span> int64_t point_y,</div>
|
|
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> int64_t slope);</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> <span class="comment">// Builds a function consisting of one ray starting at the specified</span></div>
|
|
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> <span class="comment">// x and y coordinates with the specified slope.</span></div>
|
|
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="keyword">static</span> <a class="code hl_class" href="classoperations__research_1_1_piecewise_linear_function.html">PiecewiseLinearFunction</a>* <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a3eb064b231f80fc943d2523bebd40f7d">CreateLeftRayFunction</a>(int64_t point_x,</div>
|
|
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> int64_t point_y,</div>
|
|
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> int64_t slope);</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">// Builds a two-segment fixed charge piecewise linear cost function. For</span></div>
|
|
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <span class="comment">// values less than zero, the cost is zero. For values greater than zero,</span></div>
|
|
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="comment">// cost follows the line specified by the slope and the value given as</span></div>
|
|
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="comment">// arguments. The slope and value are positive.</span></div>
|
|
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <span class="keyword">static</span> <a class="code hl_class" href="classoperations__research_1_1_piecewise_linear_function.html">PiecewiseLinearFunction</a>* <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#aff444bc7eb89ca2032c2257b372d3a8b">CreateFixedChargeFunction</a>(int64_t slope,</div>
|
|
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> int64_t <a class="code hl_variable" href="demon__profiler_8cc.html#ac072af30c4ffbc834bb4c681f6ecb514">value</a>);</div>
|
|
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> </div>
|
|
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="comment">// Builds an earliness-tardiness two-segment piecewise linear cost function.</span></div>
|
|
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <span class="comment">// The reference specifies the point where the cost is zero. Before the</span></div>
|
|
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="comment">// reference, the cost increases with the earliness slope and after the</span></div>
|
|
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> <span class="comment">// reference, it increases with the tardiness slope. The absolute values of</span></div>
|
|
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <span class="comment">// the slopes are given.</span></div>
|
|
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <span class="keyword">static</span> <a class="code hl_class" href="classoperations__research_1_1_piecewise_linear_function.html">PiecewiseLinearFunction</a>* <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#af63285aea839cbec95812be2889e1d82">CreateEarlyTardyFunction</a>(</div>
|
|
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> int64_t reference, int64_t earliness_slope, int64_t tardiness_slope);</div>
|
|
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> </div>
|
|
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span> <span class="comment">// Builds an earliness-tardiness three-segment piecewise linear cost function</span></div>
|
|
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="comment">// with a slack period around the due date. The early slack is the point</span></div>
|
|
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span> <span class="comment">// before which the cost increases with the ealiness slope specified. The</span></div>
|
|
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> <span class="comment">// late slack is the point after which the cost increases with the late slope</span></div>
|
|
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span> <span class="comment">// specified. Between the early and the late slack point, the cost is zero.</span></div>
|
|
<div class="line"><a id="l00176" name="l00176"></a><span class="lineno"> 176</span> <span class="comment">// The absolute values of the slopes are given.</span></div>
|
|
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno"> 177</span> <span class="keyword">static</span> <a class="code hl_class" href="classoperations__research_1_1_piecewise_linear_function.html">PiecewiseLinearFunction</a>* <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#ae735aab2f5e1d95727259f865ebb932a">CreateEarlyTardyFunctionWithSlack</a>(</div>
|
|
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"> 178</span> int64_t early_slack, int64_t late_slack, int64_t earliness_slope,</div>
|
|
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> int64_t tardiness_slope);</div>
|
|
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno"> 180</span> </div>
|
|
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno"> 181</span> <span class="comment">// Returns if x is in the domain of the function.</span></div>
|
|
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno"> 182</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a92b57f819267cc206b4029357215ede9">InDomain</a>(int64_t x) <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno"> 183</span> <span class="comment">// Determines whether the piecewise linear function is convex or non-convex</span></div>
|
|
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno"> 184</span> <span class="comment">// and returns true when the function is convex.</span></div>
|
|
<div class="line"><a id="l00185" name="l00185"></a><span class="lineno"> 185</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a84a2672fd5402aad7e9f5ae67fe2a427">IsConvex</a>() <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00186" name="l00186"></a><span class="lineno"> 186</span> <span class="comment">// Returns true if the piecewise linear function is non-decreasing.</span></div>
|
|
<div class="line"><a id="l00187" name="l00187"></a><span class="lineno"> 187</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a7acc75e402d8df05ec7993a45d9ddc6b">IsNonDecreasing</a>() <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00188" name="l00188"></a><span class="lineno"> 188</span> <span class="comment">// Returns true if the piecewise linear function is non-increasing.</span></div>
|
|
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"> 189</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a8b02afe47fa0bc52774a9efa649bd4c3">IsNonIncreasing</a>() <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> <span class="comment">// Returns the value of the piecewise linear function for x.</span></div>
|
|
<div class="line"><a id="l00191" name="l00191"></a><span class="lineno"> 191</span> int64_t <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a717f65b06206ba8cc7bbe1aa0c4a6c3b">Value</a>(int64_t x) <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00192" name="l00192"></a><span class="lineno"> 192</span> <span class="comment">// Returns the maximum value of all the segments in the function.</span></div>
|
|
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno"> 193</span> int64_t <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a015ab667827df32553e28ce8aa79dbc2">GetMaximum</a>() <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno"> 194</span> <span class="comment">// Returns the minimum value of all the segments in the function.</span></div>
|
|
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno"> 195</span> int64_t <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a818e7c52ebc00242ecf48d078085d17f">GetMinimum</a>() <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"> 196</span> <span class="comment">// Returns the maximum endpoint value of the segments in the specified</span></div>
|
|
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno"> 197</span> <span class="comment">// range. If the range is disjoint from the segments in the function, it</span></div>
|
|
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno"> 198</span> <span class="comment">// returns kint64max.</span></div>
|
|
<div class="line"><a id="l00199" name="l00199"></a><span class="lineno"> 199</span> int64_t <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a015ab667827df32553e28ce8aa79dbc2">GetMaximum</a>(int64_t range_start, int64_t range_end) <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00200" name="l00200"></a><span class="lineno"> 200</span> <span class="comment">// Returns the minimum endpoint value of the segments in the specified</span></div>
|
|
<div class="line"><a id="l00201" name="l00201"></a><span class="lineno"> 201</span> <span class="comment">// range. If the range is disjoint from the segments in the function, it</span></div>
|
|
<div class="line"><a id="l00202" name="l00202"></a><span class="lineno"> 202</span> <span class="comment">// returns kint64max.</span></div>
|
|
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"> 203</span> int64_t <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a818e7c52ebc00242ecf48d078085d17f">GetMinimum</a>(int64_t range_start, int64_t range_end) <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> <span class="comment">// Returns the smallest range within a given range containing all values</span></div>
|
|
<div class="line"><a id="l00205" name="l00205"></a><span class="lineno"> 205</span> <span class="comment">// greater than a given value.</span></div>
|
|
<div class="line"><a id="l00206" name="l00206"></a><span class="lineno"> 206</span> std::pair<int64_t, int64_t> <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a90537d020ac47907e6a02900693834a7">GetSmallestRangeGreaterThanValue</a>(</div>
|
|
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno"> 207</span> int64_t range_start, int64_t range_end, int64_t <a class="code hl_variable" href="demon__profiler_8cc.html#ac072af30c4ffbc834bb4c681f6ecb514">value</a>) <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno"> 208</span> <span class="comment">// Returns the smallest range within a given range containing all values</span></div>
|
|
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"> 209</span> <span class="comment">// less than a given value.</span></div>
|
|
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno"> 210</span> std::pair<int64_t, int64_t> <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#ac5987a001567895ed27e1e73dbf0a704">GetSmallestRangeLessThanValue</a>(</div>
|
|
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno"> 211</span> int64_t range_start, int64_t range_end, int64_t <a class="code hl_variable" href="demon__profiler_8cc.html#ac072af30c4ffbc834bb4c681f6ecb514">value</a>) <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00212" name="l00212"></a><span class="lineno"> 212</span> <span class="comment">// Returns the smallest range within a given range containing all values</span></div>
|
|
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"> 213</span> <span class="comment">// greater than value_min and less than value_max.</span></div>
|
|
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> std::pair<int64_t, int64_t> <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a506e927ec8e5dd90edb31c9c35965b98">GetSmallestRangeInValueRange</a>(</div>
|
|
<div class="line"><a id="l00215" name="l00215"></a><span class="lineno"> 215</span> int64_t range_start, int64_t range_end, int64_t value_min,</div>
|
|
<div class="line"><a id="l00216" name="l00216"></a><span class="lineno"> 216</span> int64_t value_max) <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00217" name="l00217"></a><span class="lineno"> 217</span> </div>
|
|
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"> 218</span> <span class="comment">// Adds 'constant' to the 'x' of all segments. If the argument is positive,</span></div>
|
|
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno"> 219</span> <span class="comment">// the translation is to the right and when it's negative, to the left. The</span></div>
|
|
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno"> 220</span> <span class="comment">// overflows and the underflows are sticky.</span></div>
|
|
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno"> 221</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a251fcf13677473e1e7dc22481cedae13">AddConstantToX</a>(int64_t constant);</div>
|
|
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno"> 222</span> <span class="comment">// Adds 'constant' to the 'y' of all segments. If the argument is positive,</span></div>
|
|
<div class="line"><a id="l00223" name="l00223"></a><span class="lineno"> 223</span> <span class="comment">// the translation is up and when it's negative, down. The overflows and the</span></div>
|
|
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"> 224</span> <span class="comment">// underflows are sticky.</span></div>
|
|
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a8a76bb73d807580286eda7f04188553b">AddConstantToY</a>(int64_t constant);</div>
|
|
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span> <span class="comment">// Adds the function to the existing one. The domain of the resulting</span></div>
|
|
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> <span class="comment">// function is the intersection of the two domains. The overflows and</span></div>
|
|
<div class="line"><a id="l00228" name="l00228"></a><span class="lineno"> 228</span> <span class="comment">// the underflows are sticky.</span></div>
|
|
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"> 229</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a78f2b8d3ca022083cdb9930fa0b15df5">Add</a>(<span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1_piecewise_linear_function.html">PiecewiseLinearFunction</a>& other);</div>
|
|
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno"> 230</span> <span class="comment">// Subtracts the function to the existing one. The domain of the</span></div>
|
|
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno"> 231</span> <span class="comment">// resulting function is the intersection of the two domains. The</span></div>
|
|
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno"> 232</span> <span class="comment">// overflows and the underflows are sticky.</span></div>
|
|
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno"> 233</span> <span class="keywordtype">void</span> <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a965281b565adae6a5f090c8f0e84f2fe">Subtract</a>(<span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1_piecewise_linear_function.html">PiecewiseLinearFunction</a>& other);</div>
|
|
<div class="line"><a id="l00234" name="l00234"></a><span class="lineno"> 234</span> <span class="comment">// Decomposes the piecewise linear function in a set of convex piecewise</span></div>
|
|
<div class="line"><a id="l00235" name="l00235"></a><span class="lineno"> 235</span> <span class="comment">// linear functions. The objects in the vector are owned by the client code.</span></div>
|
|
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"> 236</span> std::vector<PiecewiseLinearFunction*> <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a731438f9b354082fd002cfce115cac12">DecomposeToConvexFunctions</a>() <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> </div>
|
|
<div class="line"><a id="l00238" name="l00238"></a><span class="lineno"><a class="line" href="classoperations__research_1_1_piecewise_linear_function.html#ac6ffa914bf677c5488cc25a9e3bc7584"> 238</a></span> <span class="keyword">const</span> std::vector<PiecewiseSegment>& <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#ac6ffa914bf677c5488cc25a9e3bc7584">segments</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> segments_; }</div>
|
|
<div class="line"><a id="l00239" name="l00239"></a><span class="lineno"> 239</span> </div>
|
|
<div class="line"><a id="l00240" name="l00240"></a><span class="lineno"> 240</span> std::string <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#a764be64f3029f8b8e23511061d8de355">DebugString</a>() <span class="keyword">const</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> <span class="keyword">private</span>:</div>
|
|
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"> 243</span> <span class="comment">// Takes the sequence of segments, sorts them on increasing start and inserts</span></div>
|
|
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno"> 244</span> <span class="comment">// them in the piecewise linear function.</span></div>
|
|
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno"> 245</span> <span class="keyword">explicit</span> <a class="code hl_class" href="classoperations__research_1_1_piecewise_linear_function.html">PiecewiseLinearFunction</a>(std::vector<PiecewiseSegment> <a class="code hl_function" href="classoperations__research_1_1_piecewise_linear_function.html#ac6ffa914bf677c5488cc25a9e3bc7584">segments</a>);</div>
|
|
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno"> 246</span> <span class="comment">// Inserts a segment in the function.</span></div>
|
|
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno"> 247</span> <span class="keywordtype">void</span> InsertSegment(<span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1_piecewise_segment.html">PiecewiseSegment</a>& segment);</div>
|
|
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"> 248</span> <span class="comment">// Operation between two functions. In any operation between two functions the</span></div>
|
|
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> <span class="comment">// final domain is the intersection between the two domains.</span></div>
|
|
<div class="line"><a id="l00250" name="l00250"></a><span class="lineno"> 250</span> <span class="keywordtype">void</span> Operation(<span class="keyword">const</span> <a class="code hl_class" href="classoperations__research_1_1_piecewise_linear_function.html">PiecewiseLinearFunction</a>& other,</div>
|
|
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"> 251</span> <span class="keyword">const</span> std::function<int64_t(int64_t, int64_t)>& operation);</div>
|
|
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno"> 252</span> <span class="comment">// Finds start and end segment indices from a range; returns false if the</span></div>
|
|
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno"> 253</span> <span class="comment">// range is outside the domain of the function.</span></div>
|
|
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno"> 254</span> <span class="keywordtype">bool</span> FindSegmentIndicesFromRange(int64_t range_start, int64_t range_end,</div>
|
|
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno"> 255</span> <span class="keywordtype">int</span>* start_segment, <span class="keywordtype">int</span>* end_segment) <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno"> 256</span> <span class="keywordtype">void</span> UpdateStatus() {</div>
|
|
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno"> 257</span> <span class="keywordflow">if</span> (is_modified_) {</div>
|
|
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"> 258</span> is_convex_ = IsConvexInternal();</div>
|
|
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> is_non_decreasing_ = IsNonDecreasingInternal();</div>
|
|
<div class="line"><a id="l00260" name="l00260"></a><span class="lineno"> 260</span> is_non_increasing_ = IsNonIncreasingInternal();</div>
|
|
<div class="line"><a id="l00261" name="l00261"></a><span class="lineno"> 261</span> is_modified_ = <span class="keyword">false</span>;</div>
|
|
<div class="line"><a id="l00262" name="l00262"></a><span class="lineno"> 262</span> }</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> <span class="keywordtype">bool</span> IsConvexInternal() <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00265" name="l00265"></a><span class="lineno"> 265</span> <span class="keywordtype">bool</span> IsNonDecreasingInternal() <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00266" name="l00266"></a><span class="lineno"> 266</span> <span class="keywordtype">bool</span> IsNonIncreasingInternal() <span class="keyword">const</span>;</div>
|
|
<div class="line"><a id="l00267" name="l00267"></a><span class="lineno"> 267</span> </div>
|
|
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"> 268</span> <span class="comment">// The vector of segments in the function, sorted in ascending order of start</span></div>
|
|
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> <span class="comment">// points.</span></div>
|
|
<div class="line"><a id="l00270" name="l00270"></a><span class="lineno"> 270</span> std::vector<PiecewiseSegment> segments_;</div>
|
|
<div class="line"><a id="l00271" name="l00271"></a><span class="lineno"> 271</span> <span class="keywordtype">bool</span> is_modified_;</div>
|
|
<div class="line"><a id="l00272" name="l00272"></a><span class="lineno"> 272</span> <span class="keywordtype">bool</span> is_convex_;</div>
|
|
<div class="line"><a id="l00273" name="l00273"></a><span class="lineno"> 273</span> <span class="keywordtype">bool</span> is_non_decreasing_;</div>
|
|
<div class="line"><a id="l00274" name="l00274"></a><span class="lineno"> 274</span> <span class="keywordtype">bool</span> is_non_increasing_;</div>
|
|
<div class="line"><a id="l00275" name="l00275"></a><span class="lineno"> 275</span>};</div>
|
|
<div class="line"><a id="l00276" name="l00276"></a><span class="lineno"> 276</span>} <span class="comment">// namespace operations_research</span></div>
|
|
<div class="line"><a id="l00277" name="l00277"></a><span class="lineno"> 277</span><span class="preprocessor">#endif </span><span class="comment">// OR_TOOLS_UTIL_PIECEWISE_LINEAR_FUNCTION_H_</span></div>
|
|
<div class="ttc" id="abasictypes_8h_html"><div class="ttname"><a href="basictypes_8h.html">basictypes.h</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html">operations_research::PiecewiseLinearFunction</a></div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8h_source.html#l00101">piecewise_linear_function.h:101</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a015ab667827df32553e28ce8aa79dbc2"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a015ab667827df32553e28ce8aa79dbc2">operations_research::PiecewiseLinearFunction::GetMaximum</a></div><div class="ttdeci">int64_t GetMaximum() const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00509">piecewise_linear_function.cc:509</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a15a70d449d3ef680a50f76d2afadd58b"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a15a70d449d3ef680a50f76d2afadd58b">operations_research::PiecewiseLinearFunction::CreateRightRayFunction</a></div><div class="ttdeci">static PiecewiseLinearFunction * CreateRightRayFunction(int64_t point_x, int64_t point_y, int64_t slope)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00357">piecewise_linear_function.cc:357</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a251fcf13677473e1e7dc22481cedae13"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a251fcf13677473e1e7dc22481cedae13">operations_research::PiecewiseLinearFunction::AddConstantToX</a></div><div class="ttdeci">void AddConstantToX(int64_t constant)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00619">piecewise_linear_function.cc:619</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a3eb064b231f80fc943d2523bebd40f7d"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a3eb064b231f80fc943d2523bebd40f7d">operations_research::PiecewiseLinearFunction::CreateLeftRayFunction</a></div><div class="ttdeci">static PiecewiseLinearFunction * CreateLeftRayFunction(int64_t point_x, int64_t point_y, int64_t slope)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00364">piecewise_linear_function.cc:364</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a455a939cda40e7ff7441a6319c3d2e56"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a455a939cda40e7ff7441a6319c3d2e56">operations_research::PiecewiseLinearFunction::CreateStepFunction</a></div><div class="ttdeci">static PiecewiseLinearFunction * CreateStepFunction(std::vector< int64_t > points_x, std::vector< int64_t > points_y, std::vector< int64_t > other_points_x)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00308">piecewise_linear_function.cc:308</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a506e927ec8e5dd90edb31c9c35965b98"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a506e927ec8e5dd90edb31c9c35965b98">operations_research::PiecewiseLinearFunction::GetSmallestRangeInValueRange</a></div><div class="ttdeci">std::pair< int64_t, int64_t > GetSmallestRangeInValueRange(int64_t range_start, int64_t range_end, int64_t value_min, int64_t value_max) const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00593">piecewise_linear_function.cc:593</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a5b390931557183bd4a55afe4cbf4e2ae"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a5b390931557183bd4a55afe4cbf4e2ae">operations_research::PiecewiseLinearFunction::kNotFound</a></div><div class="ttdeci">static const int kNotFound</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8h_source.html#l00103">piecewise_linear_function.h:103</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a717f65b06206ba8cc7bbe1aa0c4a6c3b"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a717f65b06206ba8cc7bbe1aa0c4a6c3b">operations_research::PiecewiseLinearFunction::Value</a></div><div class="ttdeci">int64_t Value(int64_t x) const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00431">piecewise_linear_function.cc:431</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a731438f9b354082fd002cfce115cac12"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a731438f9b354082fd002cfce115cac12">operations_research::PiecewiseLinearFunction::DecomposeToConvexFunctions</a></div><div class="ttdeci">std::vector< PiecewiseLinearFunction * > DecomposeToConvexFunctions() const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00642">piecewise_linear_function.cc:642</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a764be64f3029f8b8e23511061d8de355"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a764be64f3029f8b8e23511061d8de355">operations_research::PiecewiseLinearFunction::DebugString</a></div><div class="ttdeci">std::string DebugString() const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00675">piecewise_linear_function.cc:675</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a78f2b8d3ca022083cdb9930fa0b15df5"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a78f2b8d3ca022083cdb9930fa0b15df5">operations_research::PiecewiseLinearFunction::Add</a></div><div class="ttdeci">void Add(const PiecewiseLinearFunction &other)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00633">piecewise_linear_function.cc:633</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a7acc75e402d8df05ec7993a45d9ddc6b"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a7acc75e402d8df05ec7993a45d9ddc6b">operations_research::PiecewiseLinearFunction::IsNonDecreasing</a></div><div class="ttdeci">bool IsNonDecreasing() const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00421">piecewise_linear_function.cc:421</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a7cb8cfbc85b138a4cb0b4bedc1a77c6b"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a7cb8cfbc85b138a4cb0b4bedc1a77c6b">operations_research::PiecewiseLinearFunction::CreateOneSegmentFunction</a></div><div class="ttdeci">static PiecewiseLinearFunction * CreateOneSegmentFunction(int64_t point_x, int64_t point_y, int64_t slope, int64_t other_point_x)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00348">piecewise_linear_function.cc:348</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a818e7c52ebc00242ecf48d078085d17f"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a818e7c52ebc00242ecf48d078085d17f">operations_research::PiecewiseLinearFunction::GetMinimum</a></div><div class="ttdeci">int64_t GetMinimum() const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00513">piecewise_linear_function.cc:513</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a84a2672fd5402aad7e9f5ae67fe2a427"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a84a2672fd5402aad7e9f5ae67fe2a427">operations_research::PiecewiseLinearFunction::IsConvex</a></div><div class="ttdeci">bool IsConvex() const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00416">piecewise_linear_function.cc:416</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a8a76bb73d807580286eda7f04188553b"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a8a76bb73d807580286eda7f04188553b">operations_research::PiecewiseLinearFunction::AddConstantToY</a></div><div class="ttdeci">void AddConstantToY(int64_t constant)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00626">piecewise_linear_function.cc:626</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a8b02afe47fa0bc52774a9efa649bd4c3"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a8b02afe47fa0bc52774a9efa649bd4c3">operations_research::PiecewiseLinearFunction::IsNonIncreasing</a></div><div class="ttdeci">bool IsNonIncreasing() const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00426">piecewise_linear_function.cc:426</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a90537d020ac47907e6a02900693834a7"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a90537d020ac47907e6a02900693834a7">operations_research::PiecewiseLinearFunction::GetSmallestRangeGreaterThanValue</a></div><div class="ttdeci">std::pair< int64_t, int64_t > GetSmallestRangeGreaterThanValue(int64_t range_start, int64_t range_end, int64_t value) const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00518">piecewise_linear_function.cc:518</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a92b57f819267cc206b4029357215ede9"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a92b57f819267cc206b4029357215ede9">operations_research::PiecewiseLinearFunction::InDomain</a></div><div class="ttdeci">bool InDomain(int64_t x) const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00405">piecewise_linear_function.cc:405</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_a965281b565adae6a5f090c8f0e84f2fe"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#a965281b565adae6a5f090c8f0e84f2fe">operations_research::PiecewiseLinearFunction::Subtract</a></div><div class="ttdeci">void Subtract(const PiecewiseLinearFunction &other)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00637">piecewise_linear_function.cc:637</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_ac5987a001567895ed27e1e73dbf0a704"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#ac5987a001567895ed27e1e73dbf0a704">operations_research::PiecewiseLinearFunction::GetSmallestRangeLessThanValue</a></div><div class="ttdeci">std::pair< int64_t, int64_t > GetSmallestRangeLessThanValue(int64_t range_start, int64_t range_end, int64_t value) const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00525">piecewise_linear_function.cc:525</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_ac6ffa914bf677c5488cc25a9e3bc7584"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#ac6ffa914bf677c5488cc25a9e3bc7584">operations_research::PiecewiseLinearFunction::segments</a></div><div class="ttdeci">const std::vector< PiecewiseSegment > & segments() const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8h_source.html#l00238">piecewise_linear_function.h:238</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_aca73fef94832f1ac2ee9fca0642ebd8f"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#aca73fef94832f1ac2ee9fca0642ebd8f">operations_research::PiecewiseLinearFunction::CreatePiecewiseLinearFunction</a></div><div class="ttdeci">static PiecewiseLinearFunction * CreatePiecewiseLinearFunction(std::vector< int64_t > points_x, std::vector< int64_t > points_y, std::vector< int64_t > slopes, std::vector< int64_t > other_points_x)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00291">piecewise_linear_function.cc:291</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_ae735aab2f5e1d95727259f865ebb932a"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#ae735aab2f5e1d95727259f865ebb932a">operations_research::PiecewiseLinearFunction::CreateEarlyTardyFunctionWithSlack</a></div><div class="ttdeci">static PiecewiseLinearFunction * CreateEarlyTardyFunctionWithSlack(int64_t early_slack, int64_t late_slack, int64_t earliness_slope, int64_t tardiness_slope)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00392">piecewise_linear_function.cc:392</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_aeeacbd4108ebdc295b15116f01cc562d"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#aeeacbd4108ebdc295b15116f01cc562d">operations_research::PiecewiseLinearFunction::CreateFullDomainFunction</a></div><div class="ttdeci">static PiecewiseLinearFunction * CreateFullDomainFunction(int64_t initial_level, std::vector< int64_t > points_x, std::vector< int64_t > slopes)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00324">piecewise_linear_function.cc:324</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_af63285aea839cbec95812be2889e1d82"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#af63285aea839cbec95812be2889e1d82">operations_research::PiecewiseLinearFunction::CreateEarlyTardyFunction</a></div><div class="ttdeci">static PiecewiseLinearFunction * CreateEarlyTardyFunction(int64_t reference, int64_t earliness_slope, int64_t tardiness_slope)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00381">piecewise_linear_function.cc:381</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_linear_function_html_aff444bc7eb89ca2032c2257b372d3a8b"><div class="ttname"><a href="classoperations__research_1_1_piecewise_linear_function.html#aff444bc7eb89ca2032c2257b372d3a8b">operations_research::PiecewiseLinearFunction::CreateFixedChargeFunction</a></div><div class="ttdeci">static PiecewiseLinearFunction * CreateFixedChargeFunction(int64_t slope, int64_t value)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00371">piecewise_linear_function.cc:371</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_segment_html"><div class="ttname"><a href="classoperations__research_1_1_piecewise_segment.html">operations_research::PiecewiseSegment</a></div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8h_source.html#l00038">piecewise_linear_function.h:38</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_segment_html_a251fcf13677473e1e7dc22481cedae13"><div class="ttname"><a href="classoperations__research_1_1_piecewise_segment.html#a251fcf13677473e1e7dc22481cedae13">operations_research::PiecewiseSegment::AddConstantToX</a></div><div class="ttdeci">void AddConstantToX(int64_t constant)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00241">piecewise_linear_function.cc:241</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_segment_html_a3e0673c584a9281683e7d137fe7476cb"><div class="ttname"><a href="classoperations__research_1_1_piecewise_segment.html#a3e0673c584a9281683e7d137fe7476cb">operations_research::PiecewiseSegment::slope</a></div><div class="ttdeci">int64_t slope() const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8h_source.html#l00054">piecewise_linear_function.h:54</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_segment_html_a47a1fa2007b506d4ec34e2794ef5b1e1"><div class="ttname"><a href="classoperations__research_1_1_piecewise_segment.html#a47a1fa2007b506d4ec34e2794ef5b1e1">operations_research::PiecewiseSegment::start_y</a></div><div class="ttdeci">int64_t start_y() const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8h_source.html#l00050">piecewise_linear_function.h:50</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_segment_html_a535295123475f146509112e5423154cc"><div class="ttname"><a href="classoperations__research_1_1_piecewise_segment.html#a535295123475f146509112e5423154cc">operations_research::PiecewiseSegment::PiecewiseSegment</a></div><div class="ttdeci">PiecewiseSegment(int64_t point_x, int64_t point_y, int64_t slope, int64_t other_point_x)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00077">piecewise_linear_function.cc:77</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_segment_html_a717f65b06206ba8cc7bbe1aa0c4a6c3b"><div class="ttname"><a href="classoperations__research_1_1_piecewise_segment.html#a717f65b06206ba8cc7bbe1aa0c4a6c3b">operations_research::PiecewiseSegment::Value</a></div><div class="ttdeci">int64_t Value(int64_t x) const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00086">piecewise_linear_function.cc:86</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_segment_html_a764be64f3029f8b8e23511061d8de355"><div class="ttname"><a href="classoperations__research_1_1_piecewise_segment.html#a764be64f3029f8b8e23511061d8de355">operations_research::PiecewiseSegment::DebugString</a></div><div class="ttdeci">std::string DebugString() const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00259">piecewise_linear_function.cc:259</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_segment_html_a77ce53a27b88c53f5fa438a08d00af34"><div class="ttname"><a href="classoperations__research_1_1_piecewise_segment.html#a77ce53a27b88c53f5fa438a08d00af34">operations_research::PiecewiseSegment::FindComparator</a></div><div class="ttdeci">static bool FindComparator(int64_t point, const PiecewiseSegment &segment)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00232">piecewise_linear_function.cc:232</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_segment_html_a812c497c8e21c8b38593fc358c2ae6fd"><div class="ttname"><a href="classoperations__research_1_1_piecewise_segment.html#a812c497c8e21c8b38593fc358c2ae6fd">operations_research::PiecewiseSegment::end_x</a></div><div class="ttdeci">int64_t end_x() const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8h_source.html#l00048">piecewise_linear_function.h:48</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_segment_html_a8829bfff4b5ca5e126ff3aa7e29e233c"><div class="ttname"><a href="classoperations__research_1_1_piecewise_segment.html#a8829bfff4b5ca5e126ff3aa7e29e233c">operations_research::PiecewiseSegment::ExpandEnd</a></div><div class="ttdeci">void ExpandEnd(int64_t end_x)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00237">piecewise_linear_function.cc:237</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_segment_html_a8a76bb73d807580286eda7f04188553b"><div class="ttname"><a href="classoperations__research_1_1_piecewise_segment.html#a8a76bb73d807580286eda7f04188553b">operations_research::PiecewiseSegment::AddConstantToY</a></div><div class="ttdeci">void AddConstantToY(int64_t constant)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00251">piecewise_linear_function.cc:251</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_segment_html_aa5f57f858a4566fdb393f06840c52fc8"><div class="ttname"><a href="classoperations__research_1_1_piecewise_segment.html#aa5f57f858a4566fdb393f06840c52fc8">operations_research::PiecewiseSegment::end_y</a></div><div class="ttdeci">int64_t end_y() const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8h_source.html#l00052">piecewise_linear_function.h:52</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_segment_html_aaae2d9393b903d8dea5e9afd1e49fae6"><div class="ttname"><a href="classoperations__research_1_1_piecewise_segment.html#aaae2d9393b903d8dea5e9afd1e49fae6">operations_research::PiecewiseSegment::intersection_y</a></div><div class="ttdeci">int64_t intersection_y() const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8h_source.html#l00056">piecewise_linear_function.h:56</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_segment_html_afcfbd07e95226dfc2556b43e41fe4fae"><div class="ttname"><a href="classoperations__research_1_1_piecewise_segment.html#afcfbd07e95226dfc2556b43e41fe4fae">operations_research::PiecewiseSegment::start_x</a></div><div class="ttdeci">int64_t start_x() const</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8h_source.html#l00046">piecewise_linear_function.h:46</a></div></div>
|
|
<div class="ttc" id="aclassoperations__research_1_1_piecewise_segment_html_afd287f1ff1de1124a2cd8a6fe79cb3fb"><div class="ttname"><a href="classoperations__research_1_1_piecewise_segment.html#afd287f1ff1de1124a2cd8a6fe79cb3fb">operations_research::PiecewiseSegment::SortComparator</a></div><div class="ttdeci">static bool SortComparator(const PiecewiseSegment &segment1, const PiecewiseSegment &segment2)</div><div class="ttdef"><b>Definition:</b> <a href="piecewise__linear__function_8cc_source.html#l00227">piecewise_linear_function.cc:227</a></div></div>
|
|
<div class="ttc" id="ademon__profiler_8cc_html_ac072af30c4ffbc834bb4c681f6ecb514"><div class="ttname"><a href="demon__profiler_8cc.html#ac072af30c4ffbc834bb4c681f6ecb514">value</a></div><div class="ttdeci">int64_t value</div><div class="ttdef"><b>Definition:</b> <a href="demon__profiler_8cc_source.html#l00044">demon_profiler.cc:44</a></div></div>
|
|
<div class="ttc" id="aintegral__types_8h_html"><div class="ttname"><a href="integral__types_8h.html">integral_types.h</a></div></div>
|
|
<div class="ttc" id="amacros_8h_html"><div class="ttname"><a href="macros_8h.html">macros.h</a></div></div>
|
|
<div class="ttc" id="anamespaceoperations__research_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="asaturated__arithmetic_8h_html"><div class="ttname"><a href="saturated__arithmetic_8h.html">saturated_arithmetic.h</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_a3328a0ea67a2aaa160c2783ffbaa5dc.html">util</a></li><li class="navelem"><a class="el" href="piecewise__linear__function_8h.html">piecewise_linear_function.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.2 </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|