<ahref="lp__data_8h.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aname="l00001"></a><spanclass="lineno"> 1</span> <spanclass="comment">// Copyright 2010-2021 Google LLC</span></div>
<divclass="line"><aname="l00002"></a><spanclass="lineno"> 2</span> <spanclass="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></div>
<divclass="line"><aname="l00003"></a><spanclass="lineno"> 3</span> <spanclass="comment">// you may not use this file except in compliance with the License.</span></div>
<divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment">// You may obtain a copy of the License at</span></div>
<divclass="line"><aname="l00008"></a><spanclass="lineno"> 8</span> <spanclass="comment">// Unless required by applicable law or agreed to in writing, software</span></div>
<divclass="line"><aname="l00009"></a><spanclass="lineno"> 9</span> <spanclass="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></div>
<divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> <spanclass="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> <spanclass="comment">// See the License for the specific language governing permissions and</span></div>
<divclass="line"><aname="l00012"></a><spanclass="lineno"> 12</span> <spanclass="comment">// limitations under the License.</span></div>
<divclass="line"><aname="l00017"></a><spanclass="lineno"> 17</span> <spanclass="comment">// LinearProgram stores the complete data for a Linear Program:</span></div>
<divclass="line"><aname="l00018"></a><spanclass="lineno"> 18</span> <spanclass="comment">// - objective coefficients and offset,</span></div>
<divclass="line"><aname="l00027"></a><spanclass="lineno"> 27</span> <spanclass="preprocessor">#include <algorithm></span><spanclass="comment">// for max</span></div>
<divclass="line"><aname="l00030"></a><spanclass="lineno"> 30</span> <spanclass="preprocessor">#include <string></span><spanclass="comment">// for string</span></div>
<divclass="line"><aname="l00031"></a><spanclass="lineno"> 31</span> <spanclass="preprocessor">#include <vector></span><spanclass="comment">// for vector</span></div>
<divclass="line"><aname="l00037"></a><spanclass="lineno"> 37</span> <spanclass="preprocessor">#include "<aclass="code"href="base_2logging_8h.html">ortools/base/logging.h</a>"</span><spanclass="comment">// for CHECK*</span></div>
<divclass="line"><aname="l00038"></a><spanclass="lineno"> 38</span> <spanclass="preprocessor">#include "<aclass="code"href="macros_8h.html">ortools/base/macros.h</a>"</span><spanclass="comment">// for DISALLOW_COPY_AND_ASSIGN, NULL</span></div>
<divclass="line"><aname="l00049"></a><spanclass="lineno"> 49</span> <spanclass="comment">// The LinearProgram class is used to store a linear problem in a form</span></div>
<divclass="line"><aname="l00050"></a><spanclass="lineno"> 50</span> <spanclass="comment">// accepted by LPSolver.</span></div>
<divclass="line"><aname="l00052"></a><spanclass="lineno"> 52</span> <spanclass="comment">// In addition to the simple setter functions used to create such problems, the</span></div>
<divclass="line"><aname="l00053"></a><spanclass="lineno"> 53</span> <spanclass="comment">// class also contains a few more advanced modification functions used primarily</span></div>
<divclass="line"><aname="l00054"></a><spanclass="lineno"> 54</span> <spanclass="comment">// by preprocessors. A client shouldn't need to use them directly.</span></div>
<divclass="line"><aname="l00058"></a><spanclass="lineno"> 58</span> <spanclass="comment">// The variable can take any value between and including its lower and upper</span></div>
<divclass="line"><aname="l00061"></a><spanclass="lineno"> 61</span> <spanclass="comment">// The variable must only take integer values.</span></div>
<divclass="line"><aname="l00063"></a><spanclass="lineno"> 63</span> <spanclass="comment">// The variable is implied integer variable i.e. it was continuous variable</span></div>
<divclass="line"><aname="l00064"></a><spanclass="lineno"> 64</span> <spanclass="comment">// in the LP and was detected to take only integer values.</span></div>
<divclass="line"><aname="l00070"></a><spanclass="lineno"> 70</span> <spanclass="comment">// Clears, i.e. reset the object to its initial value.</span></div>
<divclass="line"><aname="l00077"></a><spanclass="lineno"> 77</span> <spanclass="comment">// Creates a new variable and returns its index.</span></div>
<divclass="line"><aname="l00078"></a><spanclass="lineno"> 78</span> <spanclass="comment">// By default, the column bounds will be [0, infinity).</span></div>
<divclass="line"><aname="l00081"></a><spanclass="lineno"> 81</span> <spanclass="comment">// Creates a new slack variable and returns its index. Do not use this method</span></div>
<divclass="line"><aname="l00082"></a><spanclass="lineno"> 82</span> <spanclass="comment">// to create non-slack variables.</span></div>
<divclass="line"><aname="l00088"></a><spanclass="lineno"> 88</span> <spanclass="comment">// Creates a new constraint and returns its index.</span></div>
<divclass="line"><aname="l00089"></a><spanclass="lineno"> 89</span> <spanclass="comment">// By default, the constraint bounds will be [0, 0].</span></div>
<divclass="line"><aname="l00092"></a><spanclass="lineno"> 92</span> <spanclass="comment">// Same as CreateNewVariable() or CreateNewConstraint() but also assign an</span></div>
<divclass="line"><aname="l00093"></a><spanclass="lineno"> 93</span> <spanclass="comment">// immutable id to the variable or constraint so they can be retrieved later.</span></div>
<divclass="line"><aname="l00094"></a><spanclass="lineno"> 94</span> <spanclass="comment">// By default, the name is also set to this id, but it can be changed later</span></div>
<divclass="line"><aname="l00095"></a><spanclass="lineno"> 95</span> <spanclass="comment">// without changing the id.</span></div>
<divclass="line"><aname="l00097"></a><spanclass="lineno"> 97</span> <spanclass="comment">// Note that these ids are NOT copied over by the Populate*() functions.</span></div>
<divclass="line"><aname="l00099"></a><spanclass="lineno"> 99</span> <spanclass="comment">// TODO(user): Move these and the two corresponding hash_table into a new</span></div>
<divclass="line"><aname="l00100"></a><spanclass="lineno"> 100</span> <spanclass="comment">// LinearProgramBuilder class to simplify the code of some functions like</span></div>
<divclass="line"><aname="l00101"></a><spanclass="lineno"> 101</span> <spanclass="comment">// DeleteColumns() here and make the behavior on copy clear? or simply remove</span></div>
<divclass="line"><aname="l00102"></a><spanclass="lineno"> 102</span> <spanclass="comment">// them as it is almost as easy to maintain a hash_table on the client side.</span></div>
<divclass="line"><aname="l00106"></a><spanclass="lineno"> 106</span> <spanclass="comment">// Functions to set the name of a variable or constraint. Note that you</span></div>
<divclass="line"><aname="l00107"></a><spanclass="lineno"> 107</span> <spanclass="comment">// won't be able to find those named variables/constraints with</span></div>
<divclass="line"><aname="l00109"></a><spanclass="lineno"> 109</span> <spanclass="comment">// TODO(user): Add PopulateIdsFromNames() so names added via</span></div>
<divclass="line"><aname="l00110"></a><spanclass="lineno"> 110</span> <spanclass="comment">// Set{Variable|Constraint}Name() can be found.</span></div>
<divclass="line"><aname="l00117"></a><spanclass="lineno"> 117</span> <spanclass="comment">// Returns whether the variable at column col is constrained to be integer.</span></div>
<divclass="line"><aname="l00120"></a><spanclass="lineno"> 120</span> <spanclass="comment">// Returns whether the variable at column col must take binary values or not.</span></div>
<divclass="line"><aname="l00123"></a><spanclass="lineno"> 123</span> <spanclass="comment">// Defines lower and upper bounds for the variable at col. Note that the</span></div>
<divclass="line"><aname="l00124"></a><spanclass="lineno"> 124</span> <spanclass="comment">// bounds may be set to +/- infinity. The variable must have been created</span></div>
<divclass="line"><aname="l00125"></a><spanclass="lineno"> 125</span> <spanclass="comment">// before or this will crash in non-debug mode.</span></div>
<divclass="line"><aname="l00129"></a><spanclass="lineno"> 129</span> <spanclass="comment">// Defines lower and upper bounds for the constraint at row. Note that the</span></div>
<divclass="line"><aname="l00130"></a><spanclass="lineno"> 130</span> <spanclass="comment">// bounds may be set to +/- infinity. If the constraint wasn't created before,</span></div>
<divclass="line"><aname="l00131"></a><spanclass="lineno"> 131</span> <spanclass="comment">// all the rows from the current GetNumberOfRows() to the given row will be</span></div>
<divclass="line"><aname="l00132"></a><spanclass="lineno"> 132</span> <spanclass="comment">// created with a range [0,0].</span></div>
<divclass="line"><aname="l00139"></a><spanclass="lineno"> 139</span> <spanclass="comment">// Defines the objective coefficient of column col.</span></div>
<divclass="line"><aname="l00140"></a><spanclass="lineno"> 140</span> <spanclass="comment">// It is set to 0.0 by default.</span></div>
<divclass="line"><aname="l00143"></a><spanclass="lineno"> 143</span> <spanclass="comment">// Define the objective offset (0.0 by default) and scaling factor (positive</span></div>
<divclass="line"><aname="l00144"></a><spanclass="lineno"> 144</span> <spanclass="comment">// and equal to 1.0 by default). This is mainly used for displaying purpose</span></div>
<divclass="line"><aname="l00145"></a><spanclass="lineno"> 145</span> <spanclass="comment">// and the real objective is factor * (objective + offset).</span></div>
<divclass="line"><aname="l00149"></a><spanclass="lineno"> 149</span> <spanclass="comment">// Defines the optimization direction. When maximize is true (resp. false),</span></div>
<divclass="line"><aname="l00150"></a><spanclass="lineno"> 150</span> <spanclass="comment">// the objective is maximized (resp. minimized). The default is false.</span></div>
<divclass="line"><aname="l00153"></a><spanclass="lineno"> 153</span> <spanclass="comment">// Calls CleanUp() on each columns.</span></div>
<divclass="line"><aname="l00154"></a><spanclass="lineno"> 154</span> <spanclass="comment">// That is, removes duplicates, zeros, and orders the coefficients by row.</span></div>
<divclass="line"><aname="l00157"></a><spanclass="lineno"> 157</span> <spanclass="comment">// Returns true if all the columns are ordered by rows and contain no</span></div>
<divclass="line"><aname="l00158"></a><spanclass="lineno"> 158</span> <spanclass="comment">// duplicates or zero entries (i.e. if IsCleanedUp() is true for all columns).</span></div>
<divclass="line"><aname="l00161"></a><spanclass="lineno"> 161</span> <spanclass="comment">// Functions that return the name of a variable or constraint. If the name is</span></div>
<divclass="line"><aname="l00162"></a><spanclass="lineno"> 162</span> <spanclass="comment">// empty, they return a special name that depends on the index.</span></div>
<divclass="line"><aname="l00169"></a><spanclass="lineno"> 169</span> <spanclass="comment">// Returns true (resp. false) when the problem is a maximization</span></div>
<divclass="line"><aname="l00173"></a><spanclass="lineno"> 173</span> <spanclass="comment">// Returns the underlying SparseMatrix or its transpose (which may need to be</span></div>
<divclass="line"><aname="l00178"></a><spanclass="lineno"> 178</span> <spanclass="comment">// Some transformations are better done on the transpose representation. These</span></div>
<divclass="line"><aname="l00179"></a><spanclass="lineno"> 179</span> <spanclass="comment">// two functions are here for that. Note that calling the first function and</span></div>
<divclass="line"><aname="l00180"></a><spanclass="lineno"> 180</span> <spanclass="comment">// modifying the matrix does not change the result of any function in this</span></div>
<divclass="line"><aname="l00181"></a><spanclass="lineno"> 181</span> <spanclass="comment">// class until UseTransposeMatrixAsReference() is called. This is because the</span></div>
<divclass="line"><aname="l00182"></a><spanclass="lineno"> 182</span> <spanclass="comment">// transpose matrix is only used by GetTransposeSparseMatrix() and this</span></div>
<divclass="line"><aname="l00183"></a><spanclass="lineno"> 183</span> <spanclass="comment">// function will recompute the whole transpose from the matrix. In particular,</span></div>
<divclass="line"><aname="l00184"></a><spanclass="lineno"> 184</span> <spanclass="comment">// do not call GetTransposeSparseMatrix() while you modify the matrix returned</span></div>
<divclass="line"><aname="l00185"></a><spanclass="lineno"> 185</span> <spanclass="comment">// by GetMutableTransposeSparseMatrix() otherwise all your changes will be</span></div>
<divclass="line"><aname="l00188"></a><spanclass="lineno"> 188</span> <spanclass="comment">// IMPORTANT: The matrix dimension cannot change. Otherwise this will cause</span></div>
<divclass="line"><aname="l00189"></a><spanclass="lineno"> 189</span> <spanclass="comment">// problems. This is checked in debug mode when calling</span></div>
<divclass="line"><aname="l00194"></a><spanclass="lineno"> 194</span> <spanclass="comment">// Release the memory used by the transpose matrix.</span></div>
<divclass="line"><aname="l00197"></a><spanclass="lineno"> 197</span> <spanclass="comment">// Gets the underlying SparseColumn with the given index.</span></div>
<divclass="line"><aname="l00198"></a><spanclass="lineno"> 198</span> <spanclass="comment">// This is the same as GetSparseMatrix().column(col);</span></div>
<divclass="line"><aname="l00201"></a><spanclass="lineno"> 201</span> <spanclass="comment">// Gets a pointer to the underlying SparseColumn with the given index.</span></div>
<divclass="line"><aname="l00210"></a><spanclass="lineno"> 210</span> <spanclass="comment">// Returns the number of entries in the linear program matrix.</span></div>
<divclass="line"><aname="l00213"></a><spanclass="lineno"> 213</span> <spanclass="comment">// Return the lower bounds (resp. upper bounds) of constraints as a column</span></div>
<divclass="line"><aname="l00214"></a><spanclass="lineno"> 214</span> <spanclass="comment">// vector. Note that the bound values may be +/- infinity.</span></div>
<divclass="line"><aname="l00222"></a><spanclass="lineno"> 222</span> <spanclass="comment">// Returns the objective coefficients (or cost) of variables as a row vector.</span></div>
<divclass="line"><aname="l00227"></a><spanclass="lineno"> 227</span> <spanclass="comment">// Return the lower bounds (resp. upper bounds) of variables as a row vector.</span></div>
<divclass="line"><aname="l00228"></a><spanclass="lineno"> 228</span> <spanclass="comment">// Note that the bound values may be +/- infinity.</span></div>
<divclass="line"><aname="l00236"></a><spanclass="lineno"> 236</span> <spanclass="comment">// Returns a row vector of VariableType representing types of variables.</span></div>
<divclass="line"><aname="l00241"></a><spanclass="lineno"> 241</span> <spanclass="comment">// Returns a list (technically a vector) of the ColIndices of the integer</span></div>
<divclass="line"><aname="l00242"></a><spanclass="lineno"> 242</span> <spanclass="comment">// variables. This vector is lazily computed.</span></div>
<divclass="line"><aname="l00245"></a><spanclass="lineno"> 245</span> <spanclass="comment">// Returns a list (technically a vector) of the ColIndices of the binary</span></div>
<divclass="line"><aname="l00246"></a><spanclass="lineno"> 246</span> <spanclass="comment">// integer variables. This vector is lazily computed.</span></div>
<divclass="line"><aname="l00249"></a><spanclass="lineno"> 249</span> <spanclass="comment">// Returns a list (technically a vector) of the ColIndices of the non-binary</span></div>
<divclass="line"><aname="l00250"></a><spanclass="lineno"> 250</span> <spanclass="comment">// integer variables. This vector is lazily computed.</span></div>
<divclass="line"><aname="l00253"></a><spanclass="lineno"> 253</span> <spanclass="comment">// Returns the objective coefficient (or cost) of the given variable for the</span></div>
<divclass="line"><aname="l00254"></a><spanclass="lineno"> 254</span> <spanclass="comment">// minimization version of the problem. That is, this is the same as</span></div>
<divclass="line"><aname="l00255"></a><spanclass="lineno"> 255</span> <spanclass="comment">// GetObjectiveCoefficient() for a minimization problem and the opposite for a</span></div>
<divclass="line"><aname="l00259"></a><spanclass="lineno"> 259</span> <spanclass="comment">// Returns the objective offset and scaling factor.</span></div>
<divclass="line"><aname="l00265"></a><spanclass="lineno"> 265</span> <spanclass="comment">// Checks if each variable respects its bounds, nothing else.</span></div>
<divclass="line"><aname="l00269"></a><spanclass="lineno"> 269</span> <spanclass="comment">// Tests if the solution is LP-feasible within the given tolerance,</span></div>
<divclass="line"><aname="l00270"></a><spanclass="lineno"> 270</span> <spanclass="comment">// i.e., satisfies all linear constraints within the absolute tolerance level.</span></div>
<divclass="line"><aname="l00271"></a><spanclass="lineno"> 271</span> <spanclass="comment">// The solution does not need to satisfy the integer constraints.</span></div>
<divclass="line"><aname="l00275"></a><spanclass="lineno"> 275</span> <spanclass="comment">// Tests if the solution is integer within the given tolerance, i.e., all</span></div>
<divclass="line"><aname="l00276"></a><spanclass="lineno"> 276</span> <spanclass="comment">// integer variables have integer values within the absolute tolerance level.</span></div>
<divclass="line"><aname="l00277"></a><spanclass="lineno"> 277</span> <spanclass="comment">// The solution does not need to satisfy the linear constraints.</span></div>
<divclass="line"><aname="l00281"></a><spanclass="lineno"> 281</span> <spanclass="comment">// Tests if the solution is both LP-feasible and integer within the tolerance.</span></div>
<divclass="line"><aname="l00285"></a><spanclass="lineno"> 285</span> <spanclass="comment">// Fills the value of the slack from the other variable values.</span></div>
<divclass="line"><aname="l00286"></a><spanclass="lineno"> 286</span> <spanclass="comment">// This requires that the slack have been added.</span></div>
<divclass="line"><aname="l00289"></a><spanclass="lineno"> 289</span> <spanclass="comment">// Functions to translate the sum(solution * objective_coefficients()) to</span></div>
<divclass="line"><aname="l00290"></a><spanclass="lineno"> 290</span> <spanclass="comment">// the real objective of the problem and back. Note that these can also</span></div>
<divclass="line"><aname="l00291"></a><spanclass="lineno"> 291</span> <spanclass="comment">// be used to translate bounds of the objective in the same way.</span></div>
<divclass="line"><aname="l00295"></a><spanclass="lineno"> 295</span> <spanclass="comment">// A short string with the problem dimension.</span></div>
<divclass="line"><aname="l00298"></a><spanclass="lineno"> 298</span> <spanclass="comment">// A short line with some stats on the problem coefficients.</span></div>
<divclass="line"><aname="l00302"></a><spanclass="lineno"> 302</span> <spanclass="comment">// Returns a stringified LinearProgram. We use the LP file format used by</span></div>
<divclass="line"><aname="l00303"></a><spanclass="lineno"> 303</span> <spanclass="comment">// lp_solve (see http://lpsolve.sourceforge.net/5.1/index.htm).</span></div>
<divclass="line"><aname="l00306"></a><spanclass="lineno"> 306</span> <spanclass="comment">// Returns a string that contains the provided solution of the LP in the</span></div>
<divclass="line"><aname="l00307"></a><spanclass="lineno"> 307</span> <spanclass="comment">// format var1 = X, var2 = Y, var3 = Z, ...</span></div>
<divclass="line"><aname="l00310"></a><spanclass="lineno"> 310</span> <spanclass="comment">// Returns a comma-separated string of integers containing (in that order)</span></div>
<divclass="line"><aname="l00316"></a><spanclass="lineno"> 316</span> <spanclass="comment">// Very useful for reporting in the way used in journal articles.</span></div>
<divclass="line"><aname="l00319"></a><spanclass="lineno"> 319</span> <spanclass="comment">// Returns a string containing the same information as with GetProblemStats(),</span></div>
<divclass="line"><aname="l00320"></a><spanclass="lineno"> 320</span> <spanclass="comment">// but in a much more human-readable form, for example:</span></div>
<divclass="line"><aname="l00321"></a><spanclass="lineno"> 321</span> <spanclass="comment">// Number of rows : 27</span></div>
<divclass="line"><aname="l00322"></a><spanclass="lineno"> 322</span> <spanclass="comment">// Number of variables in file : 32</span></div>
<divclass="line"><aname="l00323"></a><spanclass="lineno"> 323</span> <spanclass="comment">// Number of entries (non-zeros) : 83</span></div>
<divclass="line"><aname="l00324"></a><spanclass="lineno"> 324</span> <spanclass="comment">// Number of entries in the objective : 5</span></div>
<divclass="line"><aname="l00325"></a><spanclass="lineno"> 325</span> <spanclass="comment">// Number of entries in the right-hand side : 7</span></div>
<divclass="line"><aname="l00326"></a><spanclass="lineno"> 326</span> <spanclass="comment">// Number of <= constraints : 19</span></div>
<divclass="line"><aname="l00327"></a><spanclass="lineno"> 327</span> <spanclass="comment">// Number of >= constraints : 0</span></div>
<divclass="line"><aname="l00328"></a><spanclass="lineno"> 328</span> <spanclass="comment">// Number of = constraints : 8</span></div>
<divclass="line"><aname="l00329"></a><spanclass="lineno"> 329</span> <spanclass="comment">// Number of range constraints : 0</span></div>
<divclass="line"><aname="l00330"></a><spanclass="lineno"> 330</span> <spanclass="comment">// Number of non-negative variables : 32</span></div>
<divclass="line"><aname="l00331"></a><spanclass="lineno"> 331</span> <spanclass="comment">// Number of boxed variables : 0</span></div>
<divclass="line"><aname="l00332"></a><spanclass="lineno"> 332</span> <spanclass="comment">// Number of free variables : 0</span></div>
<divclass="line"><aname="l00333"></a><spanclass="lineno"> 333</span> <spanclass="comment">// Number of fixed variables : 0</span></div>
<divclass="line"><aname="l00334"></a><spanclass="lineno"> 334</span> <spanclass="comment">// Number of other variables : 0</span></div>
<divclass="line"><aname="l00337"></a><spanclass="lineno"> 337</span> <spanclass="comment">// Returns a comma-separated string of numbers containing (in that order)</span></div>
<divclass="line"><aname="l00338"></a><spanclass="lineno"> 338</span> <spanclass="comment">// fill rate, max number of entries (length) in a row, average row length,</span></div>
<divclass="line"><aname="l00339"></a><spanclass="lineno"> 339</span> <spanclass="comment">// standard deviation of row length, max column length, average column length,</span></div>
<divclass="line"><aname="l00340"></a><spanclass="lineno"> 340</span> <spanclass="comment">// standard deviation of column length</span></div>
<divclass="line"><aname="l00341"></a><spanclass="lineno"> 341</span> <spanclass="comment">// Useful for profiling algorithms.</span></div>
<divclass="line"><aname="l00343"></a><spanclass="lineno"> 343</span> <spanclass="comment">// TODO(user): Theses are statistics about the underlying matrix and should be</span></div>
<divclass="line"><aname="l00344"></a><spanclass="lineno"> 344</span> <spanclass="comment">// moved to SparseMatrix.</span></div>
<divclass="line"><aname="l00347"></a><spanclass="lineno"> 347</span> <spanclass="comment">// Returns a string containing the same information as with GetNonZeroStats(),</span></div>
<divclass="line"><aname="l00348"></a><spanclass="lineno"> 348</span> <spanclass="comment">// but in a much more human-readable form, for example:</span></div>
<divclass="line"><aname="l00349"></a><spanclass="lineno"> 349</span> <spanclass="comment">// Fill rate : 9.61%</span></div>
<divclass="line"><aname="l00350"></a><spanclass="lineno"> 350</span> <spanclass="comment">// Entries in row (Max / average / std, dev.) : 9 / 3.07 / 1.94</span></div>
<divclass="line"><aname="l00351"></a><spanclass="lineno"> 351</span> <spanclass="comment">// Entries in column (Max / average / std, dev.): 4 / 2.59 / 0.96</span></div>
<divclass="line"><aname="l00354"></a><spanclass="lineno"> 354</span> <spanclass="comment">// Adds slack variables to the problem for all rows which don't have slack</span></div>
<divclass="line"><aname="l00355"></a><spanclass="lineno"> 355</span> <spanclass="comment">// variables. The new slack variables have bounds set to opposite of the</span></div>
<divclass="line"><aname="l00356"></a><spanclass="lineno"> 356</span> <spanclass="comment">// bounds of the corresponding constraint, and changes all constraints to</span></div>
<divclass="line"><aname="l00357"></a><spanclass="lineno"> 357</span> <spanclass="comment">// equality constraints with both bounds set to 0.0. If a constraint uses only</span></div>
<divclass="line"><aname="l00358"></a><spanclass="lineno"> 358</span> <spanclass="comment">// integer variables and all their coefficients are integer, it will mark the</span></div>
<divclass="line"><aname="l00359"></a><spanclass="lineno"> 359</span> <spanclass="comment">// slack variable as integer too.</span></div>
<divclass="line"><aname="l00361"></a><spanclass="lineno"> 361</span> <spanclass="comment">// It is an error to call CreateNewVariable() or CreateNewConstraint() on a</span></div>
<divclass="line"><aname="l00362"></a><spanclass="lineno"> 362</span> <spanclass="comment">// linear program on which this method was called.</span></div>
<divclass="line"><aname="l00364"></a><spanclass="lineno"> 364</span> <spanclass="comment">// Note that many of the slack variables may not be useful at all, but in</span></div>
<divclass="line"><aname="l00365"></a><spanclass="lineno"> 365</span> <spanclass="comment">// order not to recompute the matrix from one Solve() to the next, we always</span></div>
<divclass="line"><aname="l00366"></a><spanclass="lineno"> 366</span> <spanclass="comment">// include all of them for a given lp matrix.</span></div>
<divclass="line"><aname="l00368"></a><spanclass="lineno"> 368</span> <spanclass="comment">// TODO(user): investigate the impact on the running time. It seems low</span></div>
<divclass="line"><aname="l00369"></a><spanclass="lineno"> 369</span> <spanclass="comment">// because we almost never iterate on fixed variables.</span></div>
<divclass="line"><aname="l00372"></a><spanclass="lineno"> 372</span> <spanclass="comment">// Returns the index of the first slack variable in the linear program.</span></div>
<divclass="line"><aname="l00373"></a><spanclass="lineno"> 373</span> <spanclass="comment">// Returns kInvalidCol if slack variables were not injected into the problem</span></div>
<divclass="line"><aname="l00377"></a><spanclass="lineno"> 377</span> <spanclass="comment">// Returns the index of the slack variable corresponding to the given</span></div>
<divclass="line"><aname="l00378"></a><spanclass="lineno"> 378</span> <spanclass="comment">// constraint. Returns kInvalidCol if slack variables were not injected into</span></div>
<divclass="line"><aname="l00379"></a><spanclass="lineno"> 379</span> <spanclass="comment">// the problem yet.</span></div>
<divclass="line"><aname="l00382"></a><spanclass="lineno"> 382</span> <spanclass="comment">// Populates the calling object with the dual of the LinearProgram passed as</span></div>
<divclass="line"><aname="l00384"></a><spanclass="lineno"> 384</span> <spanclass="comment">// For the general form that we solve,</span></div>
<divclass="line"><aname="l00385"></a><spanclass="lineno"> 385</span> <spanclass="comment">// min c.x</span></div>
<divclass="line"><aname="l00386"></a><spanclass="lineno"> 386</span> <spanclass="comment">// s.t. A_1 x = b_1</span></div>
<divclass="line"><aname="l00387"></a><spanclass="lineno"> 387</span> <spanclass="comment">// A_2 x <= b_2</span></div>
<divclass="line"><aname="l00388"></a><spanclass="lineno"> 388</span> <spanclass="comment">// A_3 x >= b_3</span></div>
<divclass="line"><aname="l00389"></a><spanclass="lineno"> 389</span> <spanclass="comment">// l <= x <= u</span></div>
<divclass="line"><aname="l00390"></a><spanclass="lineno"> 390</span> <spanclass="comment">// With x: n-column of unknowns</span></div>
<divclass="line"><aname="l00391"></a><spanclass="lineno"> 391</span> <spanclass="comment">// l,u: n-columns of bound coefficients</span></div>
<divclass="line"><aname="l00392"></a><spanclass="lineno"> 392</span> <spanclass="comment">// c: n-row of cost coefficients</span></div>
<divclass="line"><aname="l00393"></a><spanclass="lineno"> 393</span> <spanclass="comment">// A_i: m_i×n-matrix of coefficients</span></div>
<divclass="line"><aname="l00394"></a><spanclass="lineno"> 394</span> <spanclass="comment">// b_i: m_i-column of right-hand side coefficients</span></div>
<divclass="line"><aname="l00405"></a><spanclass="lineno"> 405</span> <spanclass="comment">// If range constraints are present, each of the corresponding row is</span></div>
<divclass="line"><aname="l00406"></a><spanclass="lineno"> 406</span> <spanclass="comment">// duplicated (with one becoming lower bounded and the other upper bounded).</span></div>
<divclass="line"><aname="l00407"></a><spanclass="lineno"> 407</span> <spanclass="comment">// For such ranged row in the primal, duplicated_rows[row] is set to the</span></div>
<divclass="line"><aname="l00408"></a><spanclass="lineno"> 408</span> <spanclass="comment">// column index in the dual of the corresponding column duplicate. For</span></div>
<divclass="line"><aname="l00409"></a><spanclass="lineno"> 409</span> <spanclass="comment">// non-ranged row, duplicated_rows[row] is set to kInvalidCol.</span></div>
<divclass="line"><aname="l00411"></a><spanclass="lineno"> 411</span> <spanclass="comment">// IMPORTANT: The linear_program argument must not have any free constraints.</span></div>
<divclass="line"><aname="l00413"></a><spanclass="lineno"> 413</span> <spanclass="comment">// IMPORTANT: This function always interprets the argument in its minimization</span></div>
<divclass="line"><aname="l00414"></a><spanclass="lineno"> 414</span> <spanclass="comment">// form. So the dual solution of the dual needs to be negated if we want to</span></div>
<divclass="line"><aname="l00415"></a><spanclass="lineno"> 415</span> <spanclass="comment">// compute the solution of a maximization problem given as an argument.</span></div>
<divclass="line"><aname="l00417"></a><spanclass="lineno"> 417</span> <spanclass="comment">// TODO(user): Do not interpret as a minimization problem?</span></div>
<divclass="line"><aname="l00421"></a><spanclass="lineno"> 421</span> <spanclass="comment">// Populates the calling object with the given LinearProgram.</span></div>
<divclass="line"><aname="l00424"></a><spanclass="lineno"> 424</span> <spanclass="comment">// Populates the calling object with the given LinearProgram while permuting</span></div>
<divclass="line"><aname="l00425"></a><spanclass="lineno"> 425</span> <spanclass="comment">// variables and constraints. This is useful mainly for testing to generate</span></div>
<divclass="line"><aname="l00426"></a><spanclass="lineno"> 426</span> <spanclass="comment">// a model with the same optimal objective value.</span></div>
<divclass="line"><aname="l00431"></a><spanclass="lineno"> 431</span> <spanclass="comment">// Populates the calling object with the variables of the given LinearProgram.</span></div>
<divclass="line"><aname="l00432"></a><spanclass="lineno"> 432</span> <spanclass="comment">// The function preserves the bounds, the integrality, the names of the</span></div>
<divclass="line"><aname="l00433"></a><spanclass="lineno"> 433</span> <spanclass="comment">// variables and their objective coefficients. No constraints are copied (the</span></div>
<divclass="line"><aname="l00434"></a><spanclass="lineno"> 434</span> <spanclass="comment">// matrix in the destination has 0 rows).</span></div>
<divclass="line"><aname="l00437"></a><spanclass="lineno"> 437</span> <spanclass="comment">// Adds constraints to the linear program. The constraints are specified using</span></div>
<divclass="line"><aname="l00438"></a><spanclass="lineno"> 438</span> <spanclass="comment">// a sparse matrix of the coefficients, and vectors that represent the</span></div>
<divclass="line"><aname="l00439"></a><spanclass="lineno"> 439</span> <spanclass="comment">// left-hand side and the right-hand side of the constraints, i.e.</span></div>
<divclass="line"><aname="l00441"></a><spanclass="lineno"> 441</span> <spanclass="comment">// The sizes of the columns and the names must be the same as the number of</span></div>
<divclass="line"><aname="l00442"></a><spanclass="lineno"> 442</span> <spanclass="comment">// rows of the sparse matrix; the number of columns of the matrix must be</span></div>
<divclass="line"><aname="l00443"></a><spanclass="lineno"> 443</span> <spanclass="comment">// equal to the number of variables of the linear program.</span></div>
<divclass="line"><aname="l00449"></a><spanclass="lineno"> 449</span> <spanclass="comment">// Calls the AddConstraints method. After adding the constraints it adds slack</span></div>
<divclass="line"><aname="l00450"></a><spanclass="lineno"> 450</span> <spanclass="comment">// variables to the constraints.</span></div>
<divclass="line"><aname="l00457"></a><spanclass="lineno"> 457</span> <spanclass="comment">// Swaps the content of this LinearProgram with the one passed as argument.</span></div>
<divclass="line"><aname="l00458"></a><spanclass="lineno"> 458</span> <spanclass="comment">// Works in O(1).</span></div>
<divclass="line"><aname="l00461"></a><spanclass="lineno"> 461</span> <spanclass="comment">// Removes the given column indices from the LinearProgram.</span></div>
<divclass="line"><aname="l00462"></a><spanclass="lineno"> 462</span> <spanclass="comment">// This needs to allocate O(num_variables) memory to update variable_table_.</span></div>
<divclass="line"><aname="l00465"></a><spanclass="lineno"> 465</span> <spanclass="comment">// Removes slack variables from the linear program. The method restores the</span></div>
<divclass="line"><aname="l00466"></a><spanclass="lineno"> 466</span> <spanclass="comment">// bounds on constraints from the bounds of the slack variables, resets the</span></div>
<divclass="line"><aname="l00467"></a><spanclass="lineno"> 467</span> <spanclass="comment">// index of the first slack variable, and removes the relevant columns from</span></div>
<divclass="line"><aname="l00468"></a><spanclass="lineno"> 468</span> <spanclass="comment">// the matrix.</span></div>
<divclass="line"><aname="l00471"></a><spanclass="lineno"> 471</span> <spanclass="comment">// Scales the problem using the given scaler.</span></div>
<divclass="line"><aname="l00474"></a><spanclass="lineno"> 474</span> <spanclass="comment">// While Scale() makes sure the coefficients inside the linear program matrix</span></div>
<divclass="line"><aname="l00475"></a><spanclass="lineno"> 475</span> <spanclass="comment">// are in [-1, 1], the objective coefficients, variable bounds and constraint</span></div>
<divclass="line"><aname="l00476"></a><spanclass="lineno"> 476</span> <spanclass="comment">// bounds can still take large values (originally or due to the matrix</span></div>
<divclass="line"><aname="l00479"></a><spanclass="lineno"> 479</span> <spanclass="comment">// It makes a lot of sense to also scale them given that internally we use</span></div>
<divclass="line"><aname="l00480"></a><spanclass="lineno"> 480</span> <spanclass="comment">// absolute tolerances, and that it is nice to have the same behavior if users</span></div>
<divclass="line"><aname="l00481"></a><spanclass="lineno"> 481</span> <spanclass="comment">// scale their problems. For instance one could change the unit of ALL the</span></div>
<divclass="line"><aname="l00482"></a><spanclass="lineno"> 482</span> <spanclass="comment">// variables from Bytes to MBytes if they denote memory quantities. Or express</span></div>
<divclass="line"><aname="l00483"></a><spanclass="lineno"> 483</span> <spanclass="comment">// a cost in dollars instead of thousands of dollars.</span></div>
<divclass="line"><aname="l00485"></a><spanclass="lineno"> 485</span> <spanclass="comment">// Here, we are quite prudent and just make sure that the range of the</span></div>
<divclass="line"><aname="l00486"></a><spanclass="lineno"> 486</span> <spanclass="comment">// non-zeros magnitudes contains one. So for instance if all non-zeros costs</span></div>
<divclass="line"><aname="l00487"></a><spanclass="lineno"> 487</span> <spanclass="comment">// are in [1e4, 1e6], we will divide them by 1e4 so that the new range is</span></div>
<divclass="line"><aname="l00490"></a><spanclass="lineno"> 490</span> <spanclass="comment">// TODO(user): Another more aggressive idea is to set the median/mean/geomean</span></div>
<divclass="line"><aname="l00491"></a><spanclass="lineno"> 491</span> <spanclass="comment">// of the magnitudes to one. Investigate if this leads to better results. It</span></div>
<divclass="line"><aname="l00492"></a><spanclass="lineno"> 492</span> <spanclass="comment">// does look more robust.</span></div>
<divclass="line"><aname="l00494"></a><spanclass="lineno"> 494</span> <spanclass="comment">// Both functions update objective_scaling_factor()/objective_offset() and</span></div>
<divclass="line"><aname="l00495"></a><spanclass="lineno"> 495</span> <spanclass="comment">// return the scaling coefficient so that:</span></div>
<divclass="line"><aname="l00496"></a><spanclass="lineno"> 496</span> <spanclass="comment">// - For ScaleObjective(), the old coefficients can be retrieved by</span></div>
<divclass="line"><aname="l00497"></a><spanclass="lineno"> 497</span> <spanclass="comment">// multiplying the new ones by the returned factor.</span></div>
<divclass="line"><aname="l00498"></a><spanclass="lineno"> 498</span> <spanclass="comment">// - For ScaleBounds(), the old variable and constraint bounds can be</span></div>
<divclass="line"><aname="l00499"></a><spanclass="lineno"> 499</span> <spanclass="comment">// retrieved by multiplying the new ones by the returned factor.</span></div>
<divclass="line"><aname="l00503"></a><spanclass="lineno"> 503</span> <spanclass="comment">// Removes the given row indices from the LinearProgram.</span></div>
<divclass="line"><aname="l00504"></a><spanclass="lineno"> 504</span> <spanclass="comment">// This needs to allocate O(num_variables) memory.</span></div>
<divclass="line"><aname="l00507"></a><spanclass="lineno"> 507</span> <spanclass="comment">// Does basic checking on the linear program:</span></div>
<divclass="line"><aname="l00508"></a><spanclass="lineno"> 508</span> <spanclass="comment">// - returns false if some coefficient are NaNs.</span></div>
<divclass="line"><aname="l00509"></a><spanclass="lineno"> 509</span> <spanclass="comment">// - returns false if some coefficient other than the bounds are +/- infinity.</span></div>
<divclass="line"><aname="l00510"></a><spanclass="lineno"> 510</span> <spanclass="comment">// Note that these conditions are also guarded by DCHECK on each of the</span></div>
<divclass="line"><aname="l00511"></a><spanclass="lineno"> 511</span> <spanclass="comment">// SetXXX() function above.</span></div>
<divclass="line"><aname="l00514"></a><spanclass="lineno"> 514</span> <spanclass="comment">// Updates the bounds of the variables to the intersection of their original</span></div>
<divclass="line"><aname="l00515"></a><spanclass="lineno"> 515</span> <spanclass="comment">// bounds and the bounds specified by variable_lower_bounds and</span></div>
<divclass="line"><aname="l00516"></a><spanclass="lineno"> 516</span> <spanclass="comment">// variable_upper_bounds. If the new bounds of all variables are non-empty,</span></div>
<divclass="line"><aname="l00522"></a><spanclass="lineno"> 522</span> <spanclass="comment">// Returns true if the linear program is in equation form Ax = 0 and all slack</span></div>
<divclass="line"><aname="l00523"></a><spanclass="lineno"> 523</span> <spanclass="comment">// variables have been added. This is also called "computational form" in some</span></div>
<divclass="line"><aname="l00524"></a><spanclass="lineno"> 524</span> <spanclass="comment">// of the literature.</span></div>
<divclass="line"><aname="l00527"></a><spanclass="lineno"> 527</span> <spanclass="comment">// Returns true if all integer variables in the linear program have strictly</span></div>
<divclass="line"><aname="l00531"></a><spanclass="lineno"> 531</span> <spanclass="comment">// Returns true if all integer constraints in the linear program have strictly</span></div>
<divclass="line"><aname="l00535"></a><spanclass="lineno"> 535</span> <spanclass="comment">// Advanced usage. Bypass the costly call to CleanUp() when we known that the</span></div>
<divclass="line"><aname="l00536"></a><spanclass="lineno"> 536</span> <spanclass="comment">// change we made kept the matrix columns "clean" (see the comment of</span></div>
<divclass="line"><aname="l00537"></a><spanclass="lineno"> 537</span> <spanclass="comment">// CleanUp()). This is unsafe but can save a big chunk of the running time</span></div>
<divclass="line"><aname="l00538"></a><spanclass="lineno"> 538</span> <spanclass="comment">// when one does a small amount of incremental changes to the problem (like</span></div>
<divclass="line"><aname="l00539"></a><spanclass="lineno"> 539</span> <spanclass="comment">// adding a new row with no duplicates or zero entries).</span></div>
<divclass="line"><aname="l00545"></a><spanclass="lineno"> 545</span> <spanclass="comment">// If true, checks bound validity in debug mode.</span></div>
<divclass="line"><aname="l00548"></a><spanclass="lineno"> 548</span> <spanclass="comment">// In our presolve, the calls and the extra test inside SetConstraintBounds()</span></div>
<divclass="line"><aname="l00549"></a><spanclass="lineno"> 549</span> <spanclass="comment">// can be visible when a lot of substitutions are performed.</span></div>
<divclass="line"><aname="l00558"></a><spanclass="lineno"> 558</span> <spanclass="comment">// A helper function that updates the vectors integer_variables_list_,</span></div>
<divclass="line"><aname="l00559"></a><spanclass="lineno"> 559</span> <spanclass="comment">// binary_variables_list_, and non_binary_variables_list_.</span></div>
<divclass="line"><aname="l00562"></a><spanclass="lineno"> 562</span> <spanclass="comment">// A helper function to format problem statistics. Used by GetProblemStats()</span></div>
<divclass="line"><aname="l00563"></a><spanclass="lineno"> 563</span> <spanclass="comment">// and GetPrettyProblemStats().</span></div>
<divclass="line"><aname="l00566"></a><spanclass="lineno"> 566</span> <spanclass="comment">// A helper function to format non-zero statistics. Used by GetNonZeroStats()</span></div>
<divclass="line"><aname="l00567"></a><spanclass="lineno"> 567</span> <spanclass="comment">// and GetPrettyNonZeroStats().</span></div>
<divclass="line"><aname="l00570"></a><spanclass="lineno"> 570</span> <spanclass="comment">// Resizes all row vectors to include index 'row'.</span></div>
<divclass="line"><aname="l00573"></a><spanclass="lineno"> 573</span> <spanclass="comment">// Populates the definitions of variables, name and objective in the calling</span></div>
<divclass="line"><aname="l00574"></a><spanclass="lineno"> 574</span> <spanclass="comment">// linear program with the data from the given linear program. The method does</span></div>
<divclass="line"><aname="l00575"></a><spanclass="lineno"> 575</span> <spanclass="comment">// not touch the data structures for storing constraints.</span></div>
<divclass="line"><aname="l00582"></a><spanclass="lineno"> 582</span> <spanclass="comment">// The transpose of matrix_. This will be lazily recomputed by</span></div>
<divclass="line"><aname="l00583"></a><spanclass="lineno"> 583</span> <spanclass="comment">// GetTransposeSparseMatrix() if transpose_matrix_is_consistent_ is false.</span></div>
<divclass="line"><aname="l00598"></a><spanclass="lineno"> 598</span> <spanclass="comment">// The vector of the indices of variables constrained to be integer.</span></div>
<divclass="line"><aname="l00599"></a><spanclass="lineno"> 599</span> <spanclass="comment">// Note(user): the set of indices in integer_variables_list_ is the union</span></div>
<divclass="line"><aname="l00600"></a><spanclass="lineno"> 600</span> <spanclass="comment">// of the set of indices in binary_variables_list_ and of the set of indices</span></div>
<divclass="line"><aname="l00601"></a><spanclass="lineno"> 601</span> <spanclass="comment">// in non_binary_variables_list_ below.</span></div>
<divclass="line"><aname="l00604"></a><spanclass="lineno"> 604</span> <spanclass="comment">// The vector of the indices of variables constrained to be binary.</span></div>
<divclass="line"><aname="l00607"></a><spanclass="lineno"> 607</span> <spanclass="comment">// The vector of the indices of variables constrained to be integer, but not</span></div>
<divclass="line"><aname="l00611"></a><spanclass="lineno"> 611</span> <spanclass="comment">// Map used to find the index of a variable based on its id.</span></div>
<divclass="line"><aname="l00614"></a><spanclass="lineno"> 614</span> <spanclass="comment">// Map used to find the index of a constraint based on its id.</span></div>
<divclass="line"><aname="l00617"></a><spanclass="lineno"> 617</span> <spanclass="comment">// Offset of the objective, i.e. value of the objective when all variables</span></div>
<divclass="line"><aname="l00618"></a><spanclass="lineno"> 618</span> <spanclass="comment">// are set to zero.</span></div>
<divclass="line"><aname="l00622"></a><spanclass="lineno"> 622</span> <spanclass="comment">// Boolean true (resp. false) when the problem is a maximization</span></div>
<divclass="line"><aname="l00626"></a><spanclass="lineno"> 626</span> <spanclass="comment">// Boolean to speed-up multiple calls to IsCleanedUp() or</span></div>
<divclass="line"><aname="l00627"></a><spanclass="lineno"> 627</span> <spanclass="comment">// CleanUp(). Mutable so IsCleanedUp() can be const.</span></div>
<divclass="line"><aname="l00630"></a><spanclass="lineno"> 630</span> <spanclass="comment">// Whether transpose_matrix_ is guaranteed to be the transpose of matrix_.</span></div>
<divclass="line"><aname="l00633"></a><spanclass="lineno"> 633</span> <spanclass="comment">// Whether integer_variables_list_ is consistent with the current</span></div>
<divclass="line"><aname="l00640"></a><spanclass="lineno"> 640</span> <spanclass="comment">// The index of the first slack variable added to the linear program by</span></div>
<divclass="line"><aname="l00656"></a><spanclass="lineno"> 656</span> <spanclass="comment">// Contains the solution of a LinearProgram as returned by a preprocessor.</span></div>
<divclass="line"><aname="l00667"></a><spanclass="lineno"> 667</span> <spanclass="comment">// The actual primal/dual solution values. This is what most clients will</span></div>
<divclass="line"><aname="l00668"></a><spanclass="lineno"> 668</span> <spanclass="comment">// need, and this is enough for LPSolver to easily check the optimality.</span></div>
<divclass="line"><aname="l00672"></a><spanclass="lineno"> 672</span> <spanclass="comment">// The status of the variables and constraints which is difficult to</span></div>
<divclass="line"><aname="l00673"></a><spanclass="lineno"> 673</span> <spanclass="comment">// reconstruct from the solution values alone. Some remarks:</span></div>
<divclass="line"><aname="l00674"></a><spanclass="lineno"> 674</span> <spanclass="comment">// - From this information alone, by factorizing the basis, it is easy to</span></div>
<divclass="line"><aname="l00675"></a><spanclass="lineno"> 675</span> <spanclass="comment">// reconstruct the primal and dual values.</span></div>
<divclass="line"><aname="l00676"></a><spanclass="lineno"> 676</span> <spanclass="comment">// - The main difficulty to construct this from the solution values is to</span></div>
<divclass="line"><aname="l00677"></a><spanclass="lineno"> 677</span> <spanclass="comment">// reconstruct the optimal basis if some basic variables are exactly at</span></div>
<divclass="line"><aname="l00678"></a><spanclass="lineno"> 678</span> <spanclass="comment">// one of their bounds (and their reduced costs are close to zero).</span></div>
<divclass="line"><aname="l00679"></a><spanclass="lineno"> 679</span> <spanclass="comment">// - The non-basic information (VariableStatus::FIXED_VALUE,</span></div>
<divclass="line"><aname="l00681"></a><spanclass="lineno"> 681</span> <spanclass="comment">// VariableStatus::FREE) is easy to construct for variables (because</span></div>
<divclass="line"><aname="l00682"></a><spanclass="lineno"> 682</span> <spanclass="comment">// they are at their exact bounds). They can be guessed for constraints</span></div>
<divclass="line"><aname="l00683"></a><spanclass="lineno"> 683</span> <spanclass="comment">// (here a small precision error is unavoidable). However, it is useful to</span></div>
<divclass="line"><aname="l00684"></a><spanclass="lineno"> 684</span> <spanclass="comment">// carry this exact information during post-solve.</span></div>
<divclass="line"><aname="l00691"></a><spanclass="lineno"> 691</span> <spanclass="comment">// Helper function to check the bounds of the SetVariableBounds() and</span></div>
<divclass="ttc"id="aclassoperations__research_1_1glop_1_1_linear_program_html_a2175025047722705a3af86e54229f9cd"><divclass="ttname"><ahref="classoperations__research_1_1glop_1_1_linear_program.html#a2175025047722705a3af86e54229f9cd">operations_research::glop::LinearProgram::GetTransposeSparseMatrix</a></div><divclass="ttdeci">const SparseMatrix & GetTransposeSparseMatrix() const</div><divclass="ttdef"><b>Definition:</b><ahref="lp__data_8cc_source.html#l00376">lp_data.cc:376</a></div></div>
<divclass="ttc"id="aclassoperations__research_1_1glop_1_1_linear_program_html_a33b78d7012477c55f395aaf92ca6e9f4"><divclass="ttname"><ahref="classoperations__research_1_1glop_1_1_linear_program.html#a33b78d7012477c55f395aaf92ca6e9f4">operations_research::glop::LinearProgram::GetSparseMatrix</a></div><divclass="ttdeci">const SparseMatrix & GetSparseMatrix() const</div><divclass="ttdef"><b>Definition:</b><ahref="lp__data_8h_source.html#l00175">lp_data.h:175</a></div></div>
<divclass="ttc"id="aclassoperations__research_1_1glop_1_1_linear_program_html_a4ba664b00317505a0026d2a38e6dd565"><divclass="ttname"><ahref="classoperations__research_1_1glop_1_1_linear_program.html#a4ba664b00317505a0026d2a38e6dd565">operations_research::glop::LinearProgram::variable_lower_bounds</a></div><divclass="ttdeci">const DenseRow & variable_lower_bounds() const</div><divclass="ttdef"><b>Definition:</b><ahref="lp__data_8h_source.html#l00229">lp_data.h:229</a></div></div>
<divclass="ttc"id="aclassoperations__research_1_1glop_1_1_linear_program_html_a4e79763dc85eb10320835bca13697f4d"><divclass="ttname"><ahref="classoperations__research_1_1glop_1_1_linear_program.html#a4e79763dc85eb10320835bca13697f4d">operations_research::glop::LinearProgram::constraint_lower_bounds</a></div><divclass="ttdeci">const DenseColumn & constraint_lower_bounds() const</div><divclass="ttdef"><b>Definition:</b><ahref="lp__data_8h_source.html#l00215">lp_data.h:215</a></div></div>
<divclass="ttc"id="aclassoperations__research_1_1glop_1_1_linear_program_html_a5c8255f82269d42db81cc944eff0180f"><divclass="ttname"><ahref="classoperations__research_1_1glop_1_1_linear_program.html#a5c8255f82269d42db81cc944eff0180f">operations_research::glop::LinearProgram::objective_coefficients</a></div><divclass="ttdeci">const DenseRow & objective_coefficients() const</div><divclass="ttdef"><b>Definition:</b><ahref="lp__data_8h_source.html#l00223">lp_data.h:223</a></div></div>
<divclass="ttc"id="aclassoperations__research_1_1glop_1_1_linear_program_html_aa4e5168f378a3a4e86dcf409faf14937"><divclass="ttname"><ahref="classoperations__research_1_1glop_1_1_linear_program.html#aa4e5168f378a3a4e86dcf409faf14937">operations_research::glop::LinearProgram::constraint_upper_bounds</a></div><divclass="ttdeci">const DenseColumn & constraint_upper_bounds() const</div><divclass="ttdef"><b>Definition:</b><ahref="lp__data_8h_source.html#l00218">lp_data.h:218</a></div></div>
<divclass="ttc"id="aclassoperations__research_1_1glop_1_1_linear_program_html_acd138469679be137d0de53459b1342cb"><divclass="ttname"><ahref="classoperations__research_1_1glop_1_1_linear_program.html#acd138469679be137d0de53459b1342cb">operations_research::glop::LinearProgram::variable_upper_bounds</a></div><divclass="ttdeci">const DenseRow & variable_upper_bounds() const</div><divclass="ttdef"><b>Definition:</b><ahref="lp__data_8h_source.html#l00232">lp_data.h:232</a></div></div>
<divclass="ttc"id="aclassoperations__research_1_1glop_1_1_linear_program_html_ad8227ba86a01f26e4f173cd5e219d5d1"><divclass="ttname"><ahref="classoperations__research_1_1glop_1_1_linear_program.html#ad8227ba86a01f26e4f173cd5e219d5d1">operations_research::glop::LinearProgram::name</a></div><divclass="ttdeci">const std::string & name() const</div><divclass="ttdef"><b>Definition:</b><ahref="lp__data_8h_source.html#l00075">lp_data.h:75</a></div></div>
<divclass="ttc"id="anamespaceoperations__research_html"><divclass="ttname"><ahref="namespaceoperations__research.html">operations_research</a></div><divclass="ttdoc">Collection of objects used to extend the Constraint Solver library.</div><divclass="ttdef"><b>Definition:</b><ahref="dense__doubly__linked__list_8h_source.html#l00021">dense_doubly_linked_list.h:21</a></div></div>