2019-06-13 15:36:14 +02:00
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
< html xmlns = "http://www.w3.org/1999/xhtml" >
< head >
< title > OR-Tools< / title >
< meta http-equiv = "Content-Type" content = "text/html;" / >
< meta charset = "utf-8" / >
<!-- <link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/> -->
< script type = "text/javascript" src = "jquery.js" > < / script >
< script type = "text/javascript" src = "dynsections.js" > < / script >
2020-09-01 16:00:33 +02:00
< link href = "doxygen.css" rel = "stylesheet" type = "text/css" / >
< link href = "styleSheet.tmp.css" rel = "stylesheet" type = "text/css" / >
2019-06-13 15:36:14 +02:00
< / head >
< body >
< div id = "banner-container" >
< div id = "banner" >
2020-09-01 16:00:33 +02:00
< span id = "sfml" > Google OR-Tools 8.0< / span >
2019-06-13 15:36:14 +02:00
< / div >
< / div >
2019-08-07 18:01:08 -07:00
< div id = "content" style = "width: 100%; overflow: hidden;" >
< div style = "margin-left: 15px; margin-top: 5px; float: left; color: #145A32;" >
2019-08-12 09:16:03 -07:00
< h2 > C++ Reference< / h2 >
2019-08-07 18:01:08 -07:00
< ul >
< li > < a href = "../cpp_algorithms/annotated.html" > Algorithms< / a > < / li >
2019-08-12 09:16:03 -07:00
< li > < a href = "../cpp_sat/annotated.html" > CP-SAT< / a > < / li >
2019-08-07 18:01:08 -07:00
< li > < a href = "../cpp_graph/annotated.html" > Graph< / a > < / li >
< li > < a href = "../cpp_routing/annotated.html" > Routing< / a > < / li >
< li > < a href = "../cpp_linear/annotated.html" > Linear solver< / a > < / li >
< / ul >
< / div >
2019-06-13 15:36:14 +02:00
< div id = "content" >
2019-08-07 18:01:08 -07:00
< div align = "center" >
< h1 style = "color: #145A32;" > C++ Reference: Routing< / h1 >
< / div >
2020-06-11 12:23:09 +02:00
<!-- Generated by Doxygen 1.8.18 -->
2020-09-01 16:00:33 +02:00
< script type = "text/javascript" >
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3& dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
< / script >
< script type = "text/javascript" src = "menudata.js" > < / script >
< script type = "text/javascript" src = "menu.js" > < / script >
< script type = "text/javascript" >
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3& dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */< / script >
< div id = "main-nav" > < / div >
< / div > <!-- top -->
< div id = "side-nav" class = "ui-resizable side-nav-resizable" >
< div id = "nav-tree" >
< div id = "nav-tree-contents" >
< div id = "nav-sync" class = "sync" > < / div >
< / div >
< / div >
< div id = "splitbar" style = "-moz-user-select:none;"
class="ui-resizable-handle">
2019-06-13 15:36:14 +02:00
< / div >
< / div >
2020-09-01 16:00:33 +02:00
< script type = "text/javascript" >
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3& dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classoperations__research_1_1BaseIntExpr.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 >
2019-06-13 15:36:14 +02:00
< div class = "header" >
< div class = "summary" >
< a href = "#pub-methods" > Public Member Functions< / a > |
< a href = "classoperations__research_1_1BaseIntExpr-members.html" > List of all members< / a > < / div >
< div class = "headertitle" >
2020-06-11 12:23:09 +02:00
< div class = "title" > BaseIntExpr< / div > < / div >
2019-06-13 15:36:14 +02:00
< / div > <!-- header -->
< div class = "contents" >
2019-08-12 23:15:11 -07:00
< a name = "details" id = "details" > < / a > < h2 class = "groupheader" > Detailed Description< / h2 >
< div class = "textblock" > < p > This is the base class for all expressions that are not variables. < / p >
< p > It provides a basic '< a class = "el" href = "classoperations__research_1_1BaseIntExpr.html#a721f17985ccfb96fcc971ce2e474bbed" > CastToVar()< / a > ' implementation.< / p >
< p > The class of expressions represent two types of objects: variables and subclasses of < a class = "el" href = "classoperations__research_1_1BaseIntExpr.html" title = "This is the base class for all expressions that are not variables." > BaseIntExpr< / a > . Variables are stateful objects that provide a rich API (remove values, WhenBound...). On the other hand, subclasses of < a class = "el" href = "classoperations__research_1_1BaseIntExpr.html" title = "This is the base class for all expressions that are not variables." > BaseIntExpr< / a > represent range-only stateless objects. That is, min(A + B) is recomputed each time as min(A) + min(B).< / p >
2020-06-11 12:23:09 +02:00
< p > Furthermore, sometimes, the propagation on an expression is not complete, and Min(), Max() are not monotonic with respect to SetMin() and SetMax(). For instance, if A is a var with domain [0 .. 5], and B another variable with domain [0 .. 5], then Plus(A, B) has domain [0, 10].< / p >
< p > If we apply SetMax(Plus(A, B), 4)), we will deduce that both A and B have domain [0 .. 4]. In that case, Max(Plus(A, B)) is 8 and not 4. To get back monotonicity, we 'cast' the expression into a variable using the < a class = "el" href = "classoperations__research_1_1BaseIntExpr.html#a36d71f28bff7448b6490fe4720ab2fe0" > Var()< / a > method (that will call < a class = "el" href = "classoperations__research_1_1BaseIntExpr.html#a721f17985ccfb96fcc971ce2e474bbed" > CastToVar()< / a > internally). The resulting variable will be stateful and monotonic.< / p >
< p > Finally, one should never store a pointer to a IntExpr, or < a class = "el" href = "classoperations__research_1_1BaseIntExpr.html" title = "This is the base class for all expressions that are not variables." > BaseIntExpr< / a > in the code. The safe code should always call < a class = "el" href = "classoperations__research_1_1BaseIntExpr.html#a36d71f28bff7448b6490fe4720ab2fe0" > Var()< / a > on an expression built by the solver, and store the object as an IntVar*. This is a consequence of the stateless nature of the expressions that makes the code error-prone. < / p >
2019-08-07 18:01:08 -07:00
2019-08-12 23:15:11 -07:00
< p class = "definition" > Definition at line < a class = "el" href = "constraint__solveri_8h_source.html#l00109" > 109< / a > of file < a class = "el" href = "constraint__solveri_8h_source.html" > constraint_solveri.h< / a > .< / p >
< / div > < table class = "memberdecls" >
2019-08-07 18:01:08 -07:00
< tr class = "heading" > < td colspan = "2" > < h2 class = "groupheader" > < a name = "pub-methods" > < / a >
Public Member Functions< / h2 > < / td > < / tr >
2020-06-11 12:23:09 +02:00
< tr class = "memitem:a1040963d944bb74b3f2cbfb4f03a89d0" > < td class = "memItemLeft" align = "right" valign = "top" >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "classoperations__research_1_1BaseIntExpr.html#a1040963d944bb74b3f2cbfb4f03a89d0" > BaseIntExpr< / a > (Solver *const s)< / td > < / tr >
2019-08-07 18:01:08 -07:00
< tr class = "separator:a1040963d944bb74b3f2cbfb4f03a89d0" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< tr class = "memitem:ad10ba599bb4d5563b023f6d80363e713" > < td class = "memItemLeft" align = "right" valign = "top" >   < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "classoperations__research_1_1BaseIntExpr.html#ad10ba599bb4d5563b023f6d80363e713" > ~BaseIntExpr< / a > () override< / td > < / tr >
< tr class = "separator:ad10ba599bb4d5563b023f6d80363e713" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2020-06-11 12:23:09 +02:00
< tr class = "memitem:a36d71f28bff7448b6490fe4720ab2fe0" > < td class = "memItemLeft" align = "right" valign = "top" > IntVar *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "classoperations__research_1_1BaseIntExpr.html#a36d71f28bff7448b6490fe4720ab2fe0" > Var< / a > () override< / td > < / tr >
2019-08-07 18:01:08 -07:00
< tr class = "separator:a36d71f28bff7448b6490fe4720ab2fe0" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
2020-06-11 12:23:09 +02:00
< tr class = "memitem:a721f17985ccfb96fcc971ce2e474bbed" > < td class = "memItemLeft" align = "right" valign = "top" > virtual IntVar *  < / td > < td class = "memItemRight" valign = "bottom" > < a class = "el" href = "classoperations__research_1_1BaseIntExpr.html#a721f17985ccfb96fcc971ce2e474bbed" > CastToVar< / a > ()< / td > < / tr >
2019-08-07 18:01:08 -07:00
< tr class = "separator:a721f17985ccfb96fcc971ce2e474bbed" > < td class = "memSeparator" colspan = "2" >   < / td > < / tr >
< / table >
2019-08-12 23:15:11 -07:00
< h2 class = "groupheader" > Constructor & Destructor Documentation< / h2 >
2019-08-07 18:01:08 -07:00
< a id = "a1040963d944bb74b3f2cbfb4f03a89d0" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a1040963d944bb74b3f2cbfb4f03a89d0" > ◆ < / a > < / span > BaseIntExpr()< / h2 >
2019-06-13 15:36:14 +02:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "mlabels" >
< tr >
< td class = "mlabels-left" >
< table class = "memname" >
< tr >
2019-08-07 18:01:08 -07:00
< td class = "memname" > < a class = "el" href = "classoperations__research_1_1BaseIntExpr.html" > BaseIntExpr< / a > < / td >
2019-06-13 15:36:14 +02:00
< td > (< / td >
2020-06-11 12:23:09 +02:00
< td class = "paramtype" > Solver *const  < / td >
2019-06-13 15:36:14 +02:00
< td class = "paramname" > < em > s< / em > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / td >
< td class = "mlabels-right" >
< span class = "mlabels" > < span class = "mlabel" > inline< / span > < span class = "mlabel" > explicit< / span > < / span > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p class = "definition" > Definition at line < a class = "el" href = "constraint__solveri_8h_source.html#l00111" > 111< / a > of file < a class = "el" href = "constraint__solveri_8h_source.html" > constraint_solveri.h< / a > .< / p >
< / div >
< / div >
2019-08-07 18:01:08 -07:00
< a id = "ad10ba599bb4d5563b023f6d80363e713" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#ad10ba599bb4d5563b023f6d80363e713" > ◆ < / a > < / span > ~BaseIntExpr()< / h2 >
2019-06-13 15:36:14 +02:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "mlabels" >
< tr >
< td class = "mlabels-left" >
< table class = "memname" >
< tr >
2019-08-07 18:01:08 -07:00
< td class = "memname" > ~< a class = "el" href = "classoperations__research_1_1BaseIntExpr.html" > BaseIntExpr< / a > < / td >
2019-06-13 15:36:14 +02:00
< td > (< / td >
< td class = "paramname" > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / td >
< td class = "mlabels-right" >
< span class = "mlabels" > < span class = "mlabel" > inline< / span > < span class = "mlabel" > override< / span > < / span > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< p class = "definition" > Definition at line < a class = "el" href = "constraint__solveri_8h_source.html#l00112" > 112< / a > of file < a class = "el" href = "constraint__solveri_8h_source.html" > constraint_solveri.h< / a > .< / p >
< / div >
< / div >
< h2 class = "groupheader" > Member Function Documentation< / h2 >
2019-08-07 18:01:08 -07:00
< a id = "a721f17985ccfb96fcc971ce2e474bbed" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a721f17985ccfb96fcc971ce2e474bbed" > ◆ < / a > < / span > CastToVar()< / h2 >
2019-06-13 15:36:14 +02:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "mlabels" >
< tr >
< td class = "mlabels-left" >
< table class = "memname" >
< tr >
2020-06-11 12:23:09 +02:00
< td class = "memname" > virtual IntVar* CastToVar < / td >
2019-06-13 15:36:14 +02:00
< td > (< / td >
< td class = "paramname" > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / td >
< td class = "mlabels-right" >
< span class = "mlabels" > < span class = "mlabel" > virtual< / span > < / span > < / td >
< / tr >
< / table >
< / div > < div class = "memdoc" >
< / div >
< / div >
2020-06-11 12:23:09 +02:00
< a id = "a36d71f28bff7448b6490fe4720ab2fe0" > < / a >
< h2 class = "memtitle" > < span class = "permalink" > < a href = "#a36d71f28bff7448b6490fe4720ab2fe0" > ◆ < / a > < / span > Var()< / h2 >
2019-06-13 15:36:14 +02:00
< div class = "memitem" >
< div class = "memproto" >
< table class = "mlabels" >
< tr >
< td class = "mlabels-left" >
< table class = "memname" >
< tr >
2020-06-11 12:23:09 +02:00
< td class = "memname" > IntVar* Var < / td >
2019-06-13 15:36:14 +02:00
< td > (< / td >
< td class = "paramname" > < / td > < td > )< / td >
< td > < / td >
< / tr >
< / table >
< / td >
< td class = "mlabels-right" >
2020-06-11 12:23:09 +02:00
< span class = "mlabels" > < span class = "mlabel" > override< / span > < / span > < / td >
2019-06-13 15:36:14 +02:00
< / tr >
< / table >
< / div > < div class = "memdoc" >
< / div >
< / div >
< hr / > The documentation for this class was generated from the following file:< ul >
< li > < a class = "el" href = "constraint__solveri_8h_source.html" > constraint_solveri.h< / a > < / li >
< / ul >
< / div > <!-- contents -->
2020-09-01 16:00:33 +02:00
< / div > <!-- doc - content -->
2019-08-07 18:01:08 -07:00
< / div >
2019-06-13 15:36:14 +02:00
< / div >
< div id = "footer-container" >
< div id = "footer" >
< / div >
< / div >
< / body >
< / html >