543 lines
30 KiB
HTML
543 lines
30 KiB
HTML
<!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"/>-->
|
|
<link rel="stylesheet" type="text/css" href="ortools.css" title="default" media="screen,print" />
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="banner-container">
|
|
<div id="banner">
|
|
<span id="sfml">Google OR-Tools 7.5</span>
|
|
</div>
|
|
</div>
|
|
<div id="content" style="width: 100%; overflow: hidden;">
|
|
<div style="margin-left: 15px; margin-top: 5px; float: left; color: #145A32;">
|
|
<h2>C++ Reference</h2>
|
|
<ul>
|
|
<li><a href="../cpp_algorithms/annotated.html">Algorithms</a></li>
|
|
<li><a href="../cpp_sat/annotated.html">CP-SAT</a></li>
|
|
<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>
|
|
<div id="content">
|
|
<div align="center">
|
|
<h1 style="color: #145A32;">C++ Reference: Linear solver</h1>
|
|
</div>
|
|
<!-- Generated by Doxygen 1.8.16 -->
|
|
<div id="navrow1" class="tabs">
|
|
<ul class="tablist">
|
|
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
|
|
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="nav-path" class="navpath">
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="namespaceoperations__research.html">operations_research</a></li><li class="navelem"><a class="el" href="classoperations__research_1_1MPObjective.html">MPObjective</a></li> </ul>
|
|
</div>
|
|
</div><!-- top -->
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#pub-methods">Public Member Functions</a> |
|
|
<a href="classoperations__research_1_1MPObjective-members.html">List of all members</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">MPObjective</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p>A class to express a linear objective. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="linear__solver_8h_source.html#l00883">883</a> of file <a class="el" href="linear__solver_8h_source.html">linear_solver.h</a>.</p>
|
|
</div><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
|
|
Public Member Functions</h2></td></tr>
|
|
<tr class="memitem:aa71d36872f416feaa853788a7a7a7ef8"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MPObjective.html#aa71d36872f416feaa853788a7a7a7ef8">Clear</a> ()</td></tr>
|
|
<tr class="memdesc:aa71d36872f416feaa853788a7a7a7ef8"><td class="mdescLeft"> </td><td class="mdescRight">Clears the offset, all variables and coefficients, and the optimization direction. <a href="classoperations__research_1_1MPObjective.html#aa71d36872f416feaa853788a7a7a7ef8">More...</a><br /></td></tr>
|
|
<tr class="separator:aa71d36872f416feaa853788a7a7a7ef8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a2def997791a2a5119c3502aa68c34181"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MPObjective.html#a2def997791a2a5119c3502aa68c34181">SetCoefficient</a> (const <a class="el" href="classoperations__research_1_1MPVariable.html">MPVariable</a> *const var, double coeff)</td></tr>
|
|
<tr class="memdesc:a2def997791a2a5119c3502aa68c34181"><td class="mdescLeft"> </td><td class="mdescRight">Sets the coefficient of the variable in the objective. <a href="classoperations__research_1_1MPObjective.html#a2def997791a2a5119c3502aa68c34181">More...</a><br /></td></tr>
|
|
<tr class="separator:a2def997791a2a5119c3502aa68c34181"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a356d08f701ec7c64a00c19818bb72886"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MPObjective.html#a356d08f701ec7c64a00c19818bb72886">GetCoefficient</a> (const <a class="el" href="classoperations__research_1_1MPVariable.html">MPVariable</a> *const var) const</td></tr>
|
|
<tr class="memdesc:a356d08f701ec7c64a00c19818bb72886"><td class="mdescLeft"> </td><td class="mdescRight">Gets the coefficient of a given variable in the objective. <a href="classoperations__research_1_1MPObjective.html#a356d08f701ec7c64a00c19818bb72886">More...</a><br /></td></tr>
|
|
<tr class="separator:a356d08f701ec7c64a00c19818bb72886"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a665001590f89bb9446d0030e2ef8047b"><td class="memItemLeft" align="right" valign="top">const absl::flat_hash_map< const <a class="el" href="classoperations__research_1_1MPVariable.html">MPVariable</a> *, double > & </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MPObjective.html#a665001590f89bb9446d0030e2ef8047b">terms</a> () const</td></tr>
|
|
<tr class="memdesc:a665001590f89bb9446d0030e2ef8047b"><td class="mdescLeft"> </td><td class="mdescRight">Returns a map from variables to their coefficients in the objective. <a href="classoperations__research_1_1MPObjective.html#a665001590f89bb9446d0030e2ef8047b">More...</a><br /></td></tr>
|
|
<tr class="separator:a665001590f89bb9446d0030e2ef8047b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a3d269786b0c64ba034e7e8a8a09213fc"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MPObjective.html#a3d269786b0c64ba034e7e8a8a09213fc">SetOffset</a> (double value)</td></tr>
|
|
<tr class="memdesc:a3d269786b0c64ba034e7e8a8a09213fc"><td class="mdescLeft"> </td><td class="mdescRight">Sets the constant term in the objective. <a href="classoperations__research_1_1MPObjective.html#a3d269786b0c64ba034e7e8a8a09213fc">More...</a><br /></td></tr>
|
|
<tr class="separator:a3d269786b0c64ba034e7e8a8a09213fc"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a96ffc785b7b2135c7980c985883ffdd3"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MPObjective.html#a96ffc785b7b2135c7980c985883ffdd3">offset</a> () const</td></tr>
|
|
<tr class="memdesc:a96ffc785b7b2135c7980c985883ffdd3"><td class="mdescLeft"> </td><td class="mdescRight">Gets the constant term in the objective. <a href="classoperations__research_1_1MPObjective.html#a96ffc785b7b2135c7980c985883ffdd3">More...</a><br /></td></tr>
|
|
<tr class="separator:a96ffc785b7b2135c7980c985883ffdd3"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a3eee00e1029a4006afbd791f78d91657"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MPObjective.html#a3eee00e1029a4006afbd791f78d91657">OptimizeLinearExpr</a> (const <a class="el" href="classoperations__research_1_1LinearExpr.html">LinearExpr</a> &linear_expr, bool is_maximization)</td></tr>
|
|
<tr class="memdesc:a3eee00e1029a4006afbd791f78d91657"><td class="mdescLeft"> </td><td class="mdescRight">Resets the current objective to take the value of linear_expr, and sets the objective direction to maximize if "is_maximize", otherwise minimizes. <a href="classoperations__research_1_1MPObjective.html#a3eee00e1029a4006afbd791f78d91657">More...</a><br /></td></tr>
|
|
<tr class="separator:a3eee00e1029a4006afbd791f78d91657"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac195da617c5cdd546ab7ecc67a2e7235"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MPObjective.html#ac195da617c5cdd546ab7ecc67a2e7235">MaximizeLinearExpr</a> (const <a class="el" href="classoperations__research_1_1LinearExpr.html">LinearExpr</a> &linear_expr)</td></tr>
|
|
<tr class="memdesc:ac195da617c5cdd546ab7ecc67a2e7235"><td class="mdescLeft"> </td><td class="mdescRight">Resets the current objective to maximize linear_expr. <a href="classoperations__research_1_1MPObjective.html#ac195da617c5cdd546ab7ecc67a2e7235">More...</a><br /></td></tr>
|
|
<tr class="separator:ac195da617c5cdd546ab7ecc67a2e7235"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a68da85394a0aa65bda40355466afba93"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MPObjective.html#a68da85394a0aa65bda40355466afba93">MinimizeLinearExpr</a> (const <a class="el" href="classoperations__research_1_1LinearExpr.html">LinearExpr</a> &linear_expr)</td></tr>
|
|
<tr class="memdesc:a68da85394a0aa65bda40355466afba93"><td class="mdescLeft"> </td><td class="mdescRight">Resets the current objective to minimize linear_expr. <a href="classoperations__research_1_1MPObjective.html#a68da85394a0aa65bda40355466afba93">More...</a><br /></td></tr>
|
|
<tr class="separator:a68da85394a0aa65bda40355466afba93"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a615d9bd9c0c88aa56d31fdf95fbb5749"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MPObjective.html#a615d9bd9c0c88aa56d31fdf95fbb5749">AddLinearExpr</a> (const <a class="el" href="classoperations__research_1_1LinearExpr.html">LinearExpr</a> &linear_expr)</td></tr>
|
|
<tr class="memdesc:a615d9bd9c0c88aa56d31fdf95fbb5749"><td class="mdescLeft"> </td><td class="mdescRight">Adds linear_expr to the current objective, does not change the direction. <a href="classoperations__research_1_1MPObjective.html#a615d9bd9c0c88aa56d31fdf95fbb5749">More...</a><br /></td></tr>
|
|
<tr class="separator:a615d9bd9c0c88aa56d31fdf95fbb5749"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:addbc1b5c5e43ec84e2ffc8ec3ab9d830"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MPObjective.html#addbc1b5c5e43ec84e2ffc8ec3ab9d830">SetOptimizationDirection</a> (bool maximize)</td></tr>
|
|
<tr class="memdesc:addbc1b5c5e43ec84e2ffc8ec3ab9d830"><td class="mdescLeft"> </td><td class="mdescRight">Sets the optimization direction (maximize: true or minimize: false). <a href="classoperations__research_1_1MPObjective.html#addbc1b5c5e43ec84e2ffc8ec3ab9d830">More...</a><br /></td></tr>
|
|
<tr class="separator:addbc1b5c5e43ec84e2ffc8ec3ab9d830"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac187b2ba08422f3a06b8d1e1502ceea6"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MPObjective.html#ac187b2ba08422f3a06b8d1e1502ceea6">SetMinimization</a> ()</td></tr>
|
|
<tr class="memdesc:ac187b2ba08422f3a06b8d1e1502ceea6"><td class="mdescLeft"> </td><td class="mdescRight">Sets the optimization direction to minimize. <a href="classoperations__research_1_1MPObjective.html#ac187b2ba08422f3a06b8d1e1502ceea6">More...</a><br /></td></tr>
|
|
<tr class="separator:ac187b2ba08422f3a06b8d1e1502ceea6"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a0ae674872034b9d61b389da66cb9503a"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MPObjective.html#a0ae674872034b9d61b389da66cb9503a">SetMaximization</a> ()</td></tr>
|
|
<tr class="memdesc:a0ae674872034b9d61b389da66cb9503a"><td class="mdescLeft"> </td><td class="mdescRight">Sets the optimization direction to maximize. <a href="classoperations__research_1_1MPObjective.html#a0ae674872034b9d61b389da66cb9503a">More...</a><br /></td></tr>
|
|
<tr class="separator:a0ae674872034b9d61b389da66cb9503a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a3df780d69d67985929c76e750f913e21"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MPObjective.html#a3df780d69d67985929c76e750f913e21">maximization</a> () const</td></tr>
|
|
<tr class="memdesc:a3df780d69d67985929c76e750f913e21"><td class="mdescLeft"> </td><td class="mdescRight">Is the optimization direction set to maximize? <a href="classoperations__research_1_1MPObjective.html#a3df780d69d67985929c76e750f913e21">More...</a><br /></td></tr>
|
|
<tr class="separator:a3df780d69d67985929c76e750f913e21"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa3d71b1d66352ee439fdcdf8f3b93067"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MPObjective.html#aa3d71b1d66352ee439fdcdf8f3b93067">minimization</a> () const</td></tr>
|
|
<tr class="memdesc:aa3d71b1d66352ee439fdcdf8f3b93067"><td class="mdescLeft"> </td><td class="mdescRight">Is the optimization direction set to minimize? <a href="classoperations__research_1_1MPObjective.html#aa3d71b1d66352ee439fdcdf8f3b93067">More...</a><br /></td></tr>
|
|
<tr class="separator:aa3d71b1d66352ee439fdcdf8f3b93067"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a8554e97d98d05016f16300cedf2be9f6"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MPObjective.html#a8554e97d98d05016f16300cedf2be9f6">Value</a> () const</td></tr>
|
|
<tr class="memdesc:a8554e97d98d05016f16300cedf2be9f6"><td class="mdescLeft"> </td><td class="mdescRight">Returns the objective value of the best solution found so far. <a href="classoperations__research_1_1MPObjective.html#a8554e97d98d05016f16300cedf2be9f6">More...</a><br /></td></tr>
|
|
<tr class="separator:a8554e97d98d05016f16300cedf2be9f6"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a9ec8e5b1017d35c4ce048c67330b0a10"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classoperations__research_1_1MPObjective.html#a9ec8e5b1017d35c4ce048c67330b0a10">BestBound</a> () const</td></tr>
|
|
<tr class="memdesc:a9ec8e5b1017d35c4ce048c67330b0a10"><td class="mdescLeft"> </td><td class="mdescRight">Returns the best objective bound. <a href="classoperations__research_1_1MPObjective.html#a9ec8e5b1017d35c4ce048c67330b0a10">More...</a><br /></td></tr>
|
|
<tr class="separator:a9ec8e5b1017d35c4ce048c67330b0a10"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<h2 class="groupheader">Member Function Documentation</h2>
|
|
<a id="a615d9bd9c0c88aa56d31fdf95fbb5749"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a615d9bd9c0c88aa56d31fdf95fbb5749">◆ </a></span>AddLinearExpr()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void AddLinearExpr </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classoperations__research_1_1LinearExpr.html">LinearExpr</a> & </td>
|
|
<td class="paramname"><em>linear_expr</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Adds linear_expr to the current objective, does not change the direction. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a9ec8e5b1017d35c4ce048c67330b0a10"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a9ec8e5b1017d35c4ce048c67330b0a10">◆ </a></span>BestBound()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double BestBound </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns the best objective bound. </p>
|
|
<p>In case of minimization, it is a lower bound on the objective value of the optimal integer solution. Only available for discrete problems. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aa71d36872f416feaa853788a7a7a7ef8"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa71d36872f416feaa853788a7a7a7ef8">◆ </a></span>Clear()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void Clear </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Clears the offset, all variables and coefficients, and the optimization direction. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a356d08f701ec7c64a00c19818bb72886"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a356d08f701ec7c64a00c19818bb72886">◆ </a></span>GetCoefficient()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double GetCoefficient </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classoperations__research_1_1MPVariable.html">MPVariable</a> *const </td>
|
|
<td class="paramname"><em>var</em></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Gets the coefficient of a given variable in the objective. </p>
|
|
<p>It returns 0 if the variable does not appear in the objective). </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a3df780d69d67985929c76e750f913e21"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a3df780d69d67985929c76e750f913e21">◆ </a></span>maximization()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool maximization </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Is the optimization direction set to maximize? </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ac195da617c5cdd546ab7ecc67a2e7235"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac195da617c5cdd546ab7ecc67a2e7235">◆ </a></span>MaximizeLinearExpr()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void MaximizeLinearExpr </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classoperations__research_1_1LinearExpr.html">LinearExpr</a> & </td>
|
|
<td class="paramname"><em>linear_expr</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Resets the current objective to maximize linear_expr. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="linear__solver_8h_source.html#l00928">928</a> of file <a class="el" href="linear__solver_8h_source.html">linear_solver.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aa3d71b1d66352ee439fdcdf8f3b93067"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa3d71b1d66352ee439fdcdf8f3b93067">◆ </a></span>minimization()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool minimization </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Is the optimization direction set to minimize? </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a68da85394a0aa65bda40355466afba93"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a68da85394a0aa65bda40355466afba93">◆ </a></span>MinimizeLinearExpr()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void MinimizeLinearExpr </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classoperations__research_1_1LinearExpr.html">LinearExpr</a> & </td>
|
|
<td class="paramname"><em>linear_expr</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Resets the current objective to minimize linear_expr. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="linear__solver_8h_source.html#l00932">932</a> of file <a class="el" href="linear__solver_8h_source.html">linear_solver.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a96ffc785b7b2135c7980c985883ffdd3"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a96ffc785b7b2135c7980c985883ffdd3">◆ </a></span>offset()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double offset </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Gets the constant term in the objective. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="linear__solver_8h_source.html#l00919">919</a> of file <a class="el" href="linear__solver_8h_source.html">linear_solver.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a3eee00e1029a4006afbd791f78d91657"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a3eee00e1029a4006afbd791f78d91657">◆ </a></span>OptimizeLinearExpr()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void OptimizeLinearExpr </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classoperations__research_1_1LinearExpr.html">LinearExpr</a> & </td>
|
|
<td class="paramname"><em>linear_expr</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>is_maximization</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Resets the current objective to take the value of linear_expr, and sets the objective direction to maximize if "is_maximize", otherwise minimizes. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a2def997791a2a5119c3502aa68c34181"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a2def997791a2a5119c3502aa68c34181">◆ </a></span>SetCoefficient()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void SetCoefficient </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classoperations__research_1_1MPVariable.html">MPVariable</a> *const </td>
|
|
<td class="paramname"><em>var</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">double </td>
|
|
<td class="paramname"><em>coeff</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Sets the coefficient of the variable in the objective. </p>
|
|
<p>If the variable does not belong to the solver, the function just returns, or crashes in non-opt mode. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a0ae674872034b9d61b389da66cb9503a"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a0ae674872034b9d61b389da66cb9503a">◆ </a></span>SetMaximization()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void SetMaximization </td>
|
|
<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> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Sets the optimization direction to maximize. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="linear__solver_8h_source.html#l00946">946</a> of file <a class="el" href="linear__solver_8h_source.html">linear_solver.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ac187b2ba08422f3a06b8d1e1502ceea6"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac187b2ba08422f3a06b8d1e1502ceea6">◆ </a></span>SetMinimization()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void SetMinimization </td>
|
|
<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> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Sets the optimization direction to minimize. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="linear__solver_8h_source.html#l00943">943</a> of file <a class="el" href="linear__solver_8h_source.html">linear_solver.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a3d269786b0c64ba034e7e8a8a09213fc"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a3d269786b0c64ba034e7e8a8a09213fc">◆ </a></span>SetOffset()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void SetOffset </td>
|
|
<td>(</td>
|
|
<td class="paramtype">double </td>
|
|
<td class="paramname"><em>value</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Sets the constant term in the objective. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="addbc1b5c5e43ec84e2ffc8ec3ab9d830"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#addbc1b5c5e43ec84e2ffc8ec3ab9d830">◆ </a></span>SetOptimizationDirection()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void SetOptimizationDirection </td>
|
|
<td>(</td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"><em>maximize</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Sets the optimization direction (maximize: true or minimize: false). </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a665001590f89bb9446d0030e2ef8047b"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a665001590f89bb9446d0030e2ef8047b">◆ </a></span>terms()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const absl::flat_hash_map<const <a class="el" href="classoperations__research_1_1MPVariable.html">MPVariable</a>*, double>& terms </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns a map from variables to their coefficients in the objective. </p>
|
|
<p>If a variable is not present in the map, then its coefficient is zero. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="linear__solver_8h_source.html#l00911">911</a> of file <a class="el" href="linear__solver_8h_source.html">linear_solver.h</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a8554e97d98d05016f16300cedf2be9f6"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a8554e97d98d05016f16300cedf2be9f6">◆ </a></span>Value()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">double Value </td>
|
|
<td>(</td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td> const</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Returns the objective value of the best solution found so far. </p>
|
|
<p>It is the optimal objective value if the problem has been solved to optimality.</p>
|
|
<p>Note: the objective value may be slightly different than what you could compute yourself using <code><a class="el" href="classoperations__research_1_1MPVariable.html#adf1a0cc6a3736f3db9880392efe02f0e" title="Returns the value of the variable in the current solution.">MPVariable::solution_value()</a></code>; please use the –verify_solution flag to gain confidence about the numerical stability of your solution. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="linear__solver_8h_source.html">linear_solver.h</a></li>
|
|
</ul>
|
|
</div><!-- contents -->
|
|
</div>
|
|
</div>
|
|
<div id="footer-container">
|
|
<div id="footer">
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|