<ahref="basis__representation_8h.html">Go to the documentation of this file.</a><divclass="fragment"><divclass="line"><aid="l00001"name="l00001"></a><spanclass="lineno"> 1</span><spanclass="comment">// Copyright 2010-2021 Google LLC</span></div>
<divclass="line"><aid="l00002"name="l00002"></a><spanclass="lineno"> 2</span><spanclass="comment">// Licensed under the Apache License, Version 2.0 (the "License");</span></div>
<divclass="line"><aid="l00003"name="l00003"></a><spanclass="lineno"> 3</span><spanclass="comment">// you may not use this file except in compliance with the License.</span></div>
<divclass="line"><aid="l00004"name="l00004"></a><spanclass="lineno"> 4</span><spanclass="comment">// You may obtain a copy of the License at</span></div>
<divclass="line"><aid="l00008"name="l00008"></a><spanclass="lineno"> 8</span><spanclass="comment">// Unless required by applicable law or agreed to in writing, software</span></div>
<divclass="line"><aid="l00009"name="l00009"></a><spanclass="lineno"> 9</span><spanclass="comment">// distributed under the License is distributed on an "AS IS" BASIS,</span></div>
<divclass="line"><aid="l00010"name="l00010"></a><spanclass="lineno"> 10</span><spanclass="comment">// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<divclass="line"><aid="l00011"name="l00011"></a><spanclass="lineno"> 11</span><spanclass="comment">// See the License for the specific language governing permissions and</span></div>
<divclass="line"><aid="l00012"name="l00012"></a><spanclass="lineno"> 12</span><spanclass="comment">// limitations under the License.</span></div>
<divclass="line"><aid="l00031"name="l00031"></a><spanclass="lineno"> 31</span><spanclass="comment">// An eta matrix E corresponds to the identity matrix except for one column e of</span></div>
<divclass="line"><aid="l00032"name="l00032"></a><spanclass="lineno"> 32</span><spanclass="comment">// index j. In particular, B.E is the matrix of the new basis obtained from B by</span></div>
<divclass="line"><aid="l00033"name="l00033"></a><spanclass="lineno"> 33</span><spanclass="comment">// replacing the j-th vector of B by B.e, note that this is exactly what happens</span></div>
<divclass="line"><aid="l00034"name="l00034"></a><spanclass="lineno"> 34</span><spanclass="comment">// during a "pivot" of the current basis in the simplex algorithm.</span></div>
<divclass="line"><aid="l00057"name="l00057"></a><spanclass="lineno"> 57</span><spanclass="comment">// Solves the system y.E = c, 'c' beeing the initial value of 'y'.</span></div>
<divclass="line"><aid="l00058"name="l00058"></a><spanclass="lineno"> 58</span><spanclass="comment">// Then y = c.E^{-1}, so y is equal to c except for</span></div>
<divclass="line"><aid="l00062"name="l00062"></a><spanclass="lineno"> 62</span><spanclass="comment">// Same as LeftSolve(), but 'pos' contains the non-zero positions of c. The</span></div>
<divclass="line"><aid="l00063"name="l00063"></a><spanclass="lineno"> 63</span><spanclass="comment">// order of the positions is not important, but there must be no duplicates.</span></div>
<divclass="line"><aid="l00064"name="l00064"></a><spanclass="lineno"> 64</span><spanclass="comment">// The values not in 'pos' are not used. If eta_col_ was not already in 'pos',</span></div>
<divclass="line"><aid="l00065"name="l00065"></a><spanclass="lineno"> 65</span><spanclass="comment">// it is added.</span></div>
<divclass="line"><aid="l00066"name="l00066"></a><spanclass="lineno"> 66</span><spanclass="keywordtype">void</span><aclass="code hl_function"href="classoperations__research_1_1glop_1_1_eta_matrix.html#ad1e32061321d5cc422c6f18a8ed6d33d">SparseLeftSolve</a>(<aclass="code hl_class"href="classoperations__research_1_1glop_1_1_strict_i_t_i_vector.html">DenseRow</a>* y, <aclass="code hl_typedef"href="namespaceoperations__research_1_1glop.html#a2b83a25cb4fd203c57a7155699fab246">ColIndexVector</a>* pos) <spanclass="keyword">const</span>;</div>
<divclass="line"><aid="l00068"name="l00068"></a><spanclass="lineno"> 68</span><spanclass="comment">// Solves the system E.d = a, 'a' beeing the initial value of 'd'.</span></div>
<divclass="line"><aid="l00069"name="l00069"></a><spanclass="lineno"> 69</span><spanclass="comment">// Then d = E^{-1}.a = [ a_0 - e_0 * a_j / e_j</span></div>
<divclass="line"><aid="l00079"name="l00079"></a><spanclass="lineno"> 79</span><spanclass="comment">// Internal RightSolve() and LeftSolve() implementations using either the</span></div>
<divclass="line"><aid="l00080"name="l00080"></a><spanclass="lineno"> 80</span><spanclass="comment">// dense or the sparse representation of the eta vector.</span></div>
<divclass="line"><aid="l00086"name="l00086"></a><spanclass="lineno"> 86</span><spanclass="comment">// If an eta vector density is smaller than this threshold, we use the</span></div>
<divclass="line"><aid="l00087"name="l00087"></a><spanclass="lineno"> 87</span><spanclass="comment">// sparse version of the Solve() functions rather than the dense version.</span></div>
<divclass="line"><aid="l00088"name="l00088"></a><spanclass="lineno"> 88</span><spanclass="comment">// TODO(user): Detect automatically a good parameter? 0.5 is a good value on</span></div>
<divclass="line"><aid="l00089"name="l00089"></a><spanclass="lineno"> 89</span><spanclass="comment">// the Netlib (I only did a few experiments though). Note that in the future</span></div>
<divclass="line"><aid="l00090"name="l00090"></a><spanclass="lineno"> 90</span><spanclass="comment">// we may not even keep the dense representation at all.</span></div>
<divclass="line"><aid="l00096"name="l00096"></a><spanclass="lineno"> 96</span><spanclass="comment">// Note that to optimize solves, the position eta_col_ is set to 0.0 and</span></div>
<divclass="line"><aid="l00097"name="l00097"></a><spanclass="lineno"> 97</span><spanclass="comment">// stored in eta_col_coefficient_ instead.</span></div>
<divclass="line"><aid="l00104"name="l00104"></a><spanclass="lineno"> 104</span><spanclass="comment">// An eta factorization corresponds to the product of k eta matrices,</span></div>
<divclass="line"><aid="l00105"name="l00105"></a><spanclass="lineno"> 105</span><spanclass="comment">// i.e. E = E_0.E_1. ... .E_{k-1}</span></div>
<divclass="line"><aid="l00106"name="l00106"></a><spanclass="lineno"> 106</span><spanclass="comment">// It is used to solve two systems:</span></div>
<divclass="line"><aid="l00107"name="l00107"></a><spanclass="lineno"> 107</span><spanclass="comment">// - E.d = a (where a is usually the entering column).</span></div>
<divclass="line"><aid="l00108"name="l00108"></a><spanclass="lineno"> 108</span><spanclass="comment">// - y.E = c (where c is usually the objective row).</span></div>
<divclass="line"><aid="l00117"name="l00117"></a><spanclass="lineno"> 117</span><spanclass="comment">// Updates the eta factorization, i.e. adds the new eta matrix defined by</span></div>
<divclass="line"><aid="l00118"name="l00118"></a><spanclass="lineno"> 118</span><spanclass="comment">// the leaving variable and the corresponding eta column.</span></div>
<divclass="line"><aid="l00122"name="l00122"></a><spanclass="lineno"> 122</span><spanclass="comment">// Left solves all systems from right to left, i.e. y_i = y_{i+1}.(E_i)^{-1}</span></div>
<divclass="line"><aid="l00125"name="l00125"></a><spanclass="lineno"> 125</span><spanclass="comment">// Same as LeftSolve(), but 'pos' contains the non-zero positions of c. The</span></div>
<divclass="line"><aid="l00126"name="l00126"></a><spanclass="lineno"> 126</span><spanclass="comment">// order of the positions is not important, but there must be no duplicates.</span></div>
<divclass="line"><aid="l00127"name="l00127"></a><spanclass="lineno"> 127</span><spanclass="comment">// The values not in 'pos' are not used. If eta_col_ was not already in 'pos',</span></div>
<divclass="line"><aid="l00128"name="l00128"></a><spanclass="lineno"> 128</span><spanclass="comment">// it is added.</span></div>
<divclass="line"><aid="l00129"name="l00129"></a><spanclass="lineno"> 129</span><spanclass="keywordtype">void</span><aclass="code hl_function"href="classoperations__research_1_1glop_1_1_eta_factorization.html#ad1e32061321d5cc422c6f18a8ed6d33d">SparseLeftSolve</a>(<aclass="code hl_class"href="classoperations__research_1_1glop_1_1_strict_i_t_i_vector.html">DenseRow</a>* y, <aclass="code hl_typedef"href="namespaceoperations__research_1_1glop.html#a2b83a25cb4fd203c57a7155699fab246">ColIndexVector</a>* pos) <spanclass="keyword">const</span>;</div>
<divclass="line"><aid="l00131"name="l00131"></a><spanclass="lineno"> 131</span><spanclass="comment">// Right solves all systems from left to right, i.e. E_i.d_{i+1} = d_i</span></div>
<divclass="line"><aid="l00140"name="l00140"></a><spanclass="lineno"> 140</span><spanclass="comment">// A basis factorization is the product of an eta factorization and</span></div>
<divclass="line"><aid="l00141"name="l00141"></a><spanclass="lineno"> 141</span><spanclass="comment">// a L.U decomposition, i.e. B = L.U.E_0.E_1. ... .E_{k-1}</span></div>
<divclass="line"><aid="l00142"name="l00142"></a><spanclass="lineno"> 142</span><spanclass="comment">// It is used to solve two systems:</span></div>
<divclass="line"><aid="l00143"name="l00143"></a><spanclass="lineno"> 143</span><spanclass="comment">// - B.d = a where a is the entering column.</span></div>
<divclass="line"><aid="l00144"name="l00144"></a><spanclass="lineno"> 144</span><spanclass="comment">// - y.B = c where c is the objective row.</span></div>
<divclass="line"><aid="l00146"name="l00146"></a><spanclass="lineno"> 146</span><spanclass="comment">// To speed-up and improve stability the factorization is refactorized at least</span></div>
<divclass="line"><aid="l00147"name="l00147"></a><spanclass="lineno"> 147</span><spanclass="comment">// every 'refactorization_period' updates.</span></div>
<divclass="line"><aid="l00149"name="l00149"></a><spanclass="lineno"> 149</span><spanclass="comment">// This class does not take ownership of the underlying matrix and basis, and</span></div>
<divclass="line"><aid="l00150"name="l00150"></a><spanclass="lineno"> 150</span><spanclass="comment">// thus they must outlive this class (and keep the same address in memory).</span></div>
<divclass="line"><aid="l00157"name="l00157"></a><spanclass="lineno"> 157</span><spanclass="comment">// Sets the parameters for this component.</span></div>
<divclass="line"><aid="l00166"name="l00166"></a><spanclass="lineno"> 166</span><spanclass="comment">// Returns the column permutation used by the LU factorization.</span></div>
<divclass="line"><aid="l00167"name="l00167"></a><spanclass="lineno"> 167</span><spanclass="comment">// This call only makes sense if the basis was just refactorized.</span></div>
<divclass="line"><aid="l00173"name="l00173"></a><spanclass="lineno"> 173</span><spanclass="comment">// Sets the column permutation used by the LU factorization to the identity.</span></div>
<divclass="line"><aid="l00174"name="l00174"></a><spanclass="lineno"> 174</span><spanclass="comment">// Hense the Solve() results will be computed without this permutation.</span></div>
<divclass="line"><aid="l00175"name="l00175"></a><spanclass="lineno"> 175</span><spanclass="comment">// This call only makes sense if the basis was just refactorized.</span></div>
<divclass="line"><aid="l00181"name="l00181"></a><spanclass="lineno"> 181</span><spanclass="comment">// Clears the factorization and resets it to an identity matrix of size given</span></div>
<divclass="line"><aid="l00182"name="l00182"></a><spanclass="lineno"> 182</span><spanclass="comment">// by matrix_.num_rows().</span></div>
<divclass="line"><aid="l00185"name="l00185"></a><spanclass="lineno"> 185</span><spanclass="comment">// Clears the factorization and initializes the class using the current</span></div>
<divclass="line"><aid="l00186"name="l00186"></a><spanclass="lineno"> 186</span><spanclass="comment">// matrix_ and basis_. This is fast if IsIdentityBasis() is true, otherwise</span></div>
<divclass="line"><aid="l00187"name="l00187"></a><spanclass="lineno"> 187</span><spanclass="comment">// it will trigger a refactorization and will return an error if the matrix</span></div>
<divclass="line"><aid="l00188"name="l00188"></a><spanclass="lineno"> 188</span><spanclass="comment">// could not be factorized.</span></div>
<divclass="line"><aid="l00191"name="l00191"></a><spanclass="lineno"> 191</span><spanclass="comment">// This mainly forward the call to LuFactorization::ComputeInitialBasis().</span></div>
<divclass="line"><aid="l00193"name="l00193"></a><spanclass="lineno"> 193</span><spanclass="comment">// Note that once this is called, one would need to call Initialize() to</span></div>
<divclass="line"><aid="l00194"name="l00194"></a><spanclass="lineno"> 194</span><spanclass="comment">// actually create the factorization. The only side effect of this is to</span></div>
<divclass="line"><aid="l00195"name="l00195"></a><spanclass="lineno"> 195</span><spanclass="comment">// update the deterministic time.</span></div>
<divclass="line"><aid="l00197"name="l00197"></a><spanclass="lineno"> 197</span><spanclass="comment">// TODO(user): This "double" factorization is a bit inefficient, and we should</span></div>
<divclass="line"><aid="l00198"name="l00198"></a><spanclass="lineno"> 198</span><spanclass="comment">// probably Initialize() right away the factorization with the new basis, but</span></div>
<divclass="line"><aid="l00199"name="l00199"></a><spanclass="lineno"> 199</span><spanclass="comment">// more code is needed for that. It is also not that easy also because we want</span></div>
<divclass="line"><aid="l00200"name="l00200"></a><spanclass="lineno"> 200</span><spanclass="comment">// to permute all the added slack first.</span></div>
<divclass="line"><aid="l00203"name="l00203"></a><spanclass="lineno"> 203</span><spanclass="comment">// Return the number of rows in the basis.</span></div>
<divclass="line"><aid="l00206"name="l00206"></a><spanclass="lineno"> 206</span><spanclass="comment">// Clears eta factorization and refactorizes LU.</span></div>
<divclass="line"><aid="l00207"name="l00207"></a><spanclass="lineno"> 207</span><spanclass="comment">// Nothing happens if this is called on an already refactorized basis.</span></div>
<divclass="line"><aid="l00208"name="l00208"></a><spanclass="lineno"> 208</span><spanclass="comment">// Returns an error if the matrix could not be factorized: i.e. not a basis.</span></div>
<divclass="line"><aid="l00211"name="l00211"></a><spanclass="lineno"> 211</span><spanclass="comment">// Like Refactorize(), but do it even if IsRefactorized() is true.</span></div>
<divclass="line"><aid="l00212"name="l00212"></a><spanclass="lineno"> 212</span><spanclass="comment">// Call this if the underlying basis_ changed and Update() wasn't called.</span></div>
<divclass="line"><aid="l00215"name="l00215"></a><spanclass="lineno"> 215</span><spanclass="comment">// Returns true if the factorization was just recomputed.</span></div>
<divclass="line"><aid="l00218"name="l00218"></a><spanclass="lineno"> 218</span><spanclass="comment">// Updates the factorization. The 'eta' column will be modified with a swap to</span></div>
<divclass="line"><aid="l00219"name="l00219"></a><spanclass="lineno"> 219</span><spanclass="comment">// avoid a copy (only if the standard eta update is used). Returns an error if</span></div>
<divclass="line"><aid="l00220"name="l00220"></a><spanclass="lineno"> 220</span><spanclass="comment">// the matrix could not be factorized: i.e. not a basis.</span></div>
<divclass="line"><aid="l00225"name="l00225"></a><spanclass="lineno"> 225</span><spanclass="comment">// Left solves the system y.B = rhs, where y initially contains rhs.</span></div>
<divclass="line"><aid="l00228"name="l00228"></a><spanclass="lineno"> 228</span><spanclass="comment">// Left solves the system y.B = e_j, where e_j has only 1 non-zero</span></div>
<divclass="line"><aid="l00229"name="l00229"></a><spanclass="lineno"> 229</span><spanclass="comment">// coefficient of value 1.0 at position 'j'.</span></div>
<divclass="line"><aid="l00232"name="l00232"></a><spanclass="lineno"> 232</span><spanclass="comment">// Same as LeftSolveForUnitRow() but does not update any internal data.</span></div>
<divclass="line"><aid="l00235"name="l00235"></a><spanclass="lineno"> 235</span><spanclass="comment">// Right solves the system B.d = a where the input is the initial value of d.</span></div>
<divclass="line"><aid="l00238"name="l00238"></a><spanclass="lineno"> 238</span><spanclass="comment">// Same as RightSolve() for matrix.column(col). This also exploits its</span></div>
<divclass="line"><aid="l00242"name="l00242"></a><spanclass="lineno"> 242</span><spanclass="comment">// Specialized version for ComputeTau() in DualEdgeNorms. This reuses an</span></div>
<divclass="line"><aid="l00243"name="l00243"></a><spanclass="lineno"> 243</span><spanclass="comment">// intermediate result of the last LeftSolveForUnitRow() in order to save a</span></div>
<divclass="line"><aid="l00244"name="l00244"></a><spanclass="lineno"> 244</span><spanclass="comment">// permutation if it is available. Note that the input 'a' should always be</span></div>
<divclass="line"><aid="l00245"name="l00245"></a><spanclass="lineno"> 245</span><spanclass="comment">// equal to the last result of LeftSolveForUnitRow() and will be used for a</span></div>
<divclass="line"><aid="l00246"name="l00246"></a><spanclass="lineno"> 246</span><spanclass="comment">// DCHECK() or if the intermediate result wasn't kept.</span></div>
<divclass="line"><aid="l00249"name="l00249"></a><spanclass="lineno"> 249</span><spanclass="comment">// Returns the norm of B^{-1}.a, this is a specific function because</span></div>
<divclass="line"><aid="l00250"name="l00250"></a><spanclass="lineno"> 250</span><spanclass="comment">// it is a bit faster and it avoids polluting the stats of RightSolve().</span></div>
<divclass="line"><aid="l00251"name="l00251"></a><spanclass="lineno"> 251</span><spanclass="comment">// It can be called only when IsRefactorized() is true.</span></div>
<divclass="line"><aid="l00254"name="l00254"></a><spanclass="lineno"> 254</span><spanclass="comment">// Returns the norm of (B^T)^{-1}.e_row where e is an unit vector.</span></div>
<divclass="line"><aid="l00255"name="l00255"></a><spanclass="lineno"> 255</span><spanclass="comment">// This is a bit faster and avoids polluting the stats of LeftSolve().</span></div>
<divclass="line"><aid="l00256"name="l00256"></a><spanclass="lineno"> 256</span><spanclass="comment">// It can be called only when IsRefactorized() is true.</span></div>
<divclass="line"><aid="l00259"name="l00259"></a><spanclass="lineno"> 259</span><spanclass="comment">// Computes the condition number of B.</span></div>
<divclass="line"><aid="l00260"name="l00260"></a><spanclass="lineno"> 260</span><spanclass="comment">// For a given norm, this is the matrix norm times the norm of its inverse.</span></div>
<divclass="line"><aid="l00261"name="l00261"></a><spanclass="lineno"> 261</span><spanclass="comment">// A condition number greater than 1E7 will lead to precision problems.</span></div>
<divclass="line"><aid="l00266"name="l00266"></a><spanclass="lineno"> 266</span><spanclass="comment">// Computes the 1-norm of B.</span></div>
<divclass="line"><aid="l00267"name="l00267"></a><spanclass="lineno"> 267</span><spanclass="comment">// The 1-norm |A| is defined as max_j sum_i |a_ij|</span></div>
<divclass="line"><aid="l00271"name="l00271"></a><spanclass="lineno"> 271</span><spanclass="comment">// Computes the infinity-norm of B.</span></div>
<divclass="line"><aid="l00272"name="l00272"></a><spanclass="lineno"> 272</span><spanclass="comment">// The infinity-norm |A| is defined as max_i sum_j |a_ij|</span></div>
<divclass="line"><aid="l00276"name="l00276"></a><spanclass="lineno"> 276</span><spanclass="comment">// Computes the 1-norm of the inverse of B.</span></div>
<divclass="line"><aid="l00277"name="l00277"></a><spanclass="lineno"> 277</span><spanclass="comment">// For this we iteratively solve B.x = e_j, where e_j is the jth unit vector.</span></div>
<divclass="line"><aid="l00278"name="l00278"></a><spanclass="lineno"> 278</span><spanclass="comment">// The result of this computation is the jth column of B^-1.</span></div>
<divclass="line"><aid="l00281"name="l00281"></a><spanclass="lineno"> 281</span><spanclass="comment">// Computes the infinity-norm of the inverse of B.</span></div>
<divclass="line"><aid="l00284"name="l00284"></a><spanclass="lineno"> 284</span><spanclass="comment">// Stats related function.</span></div>
<divclass="line"><aid="l00285"name="l00285"></a><spanclass="lineno"> 285</span><spanclass="comment">// Note that ResetStats() could be const, but until needed it is not to</span></div>
<divclass="line"><aid="l00286"name="l00286"></a><spanclass="lineno"> 286</span><spanclass="comment">// prevent anyone holding a const BasisFactorization& to call it.</span></div>
<divclass="line"><aid="l00292"name="l00292"></a><spanclass="lineno"> 292</span><spanclass="comment">// The deterministic time used by this class. It is incremented for each</span></div>
<divclass="line"><aid="l00293"name="l00293"></a><spanclass="lineno"> 293</span><spanclass="comment">// solve and each factorization.</span></div>
<divclass="line"><aid="l00297"name="l00297"></a><spanclass="lineno"> 297</span><spanclass="comment">// Called by ForceRefactorization() or Refactorize() or Initialize().</span></div>
<divclass="line"><aid="l00300"name="l00300"></a><spanclass="lineno"> 300</span><spanclass="comment">// Return true if the submatrix of matrix_ given by basis_ is exactly the</span></div>
<divclass="line"><aid="l00304"name="l00304"></a><spanclass="lineno"> 304</span><spanclass="comment">// Updates the factorization using the middle product form update.</span></div>
<divclass="line"><aid="l00305"name="l00305"></a><spanclass="lineno"> 305</span><spanclass="comment">// Qi Huangfu, J. A. Julian Hall, "Novel update techniques for the revised</span></div>
<divclass="line"><aid="l00306"name="l00306"></a><spanclass="lineno"> 306</span><spanclass="comment">// simplex method", 28 january 2013, Technical Report ERGO-13-0001</span></div>
<divclass="line"><aid="l00310"name="l00310"></a><spanclass="lineno"> 310</span><spanclass="comment">// Increases the deterministic time for a solve operation with a vector having</span></div>
<divclass="line"><aid="l00311"name="l00311"></a><spanclass="lineno"> 311</span><spanclass="comment">// this number of non-zero entries (it can be an approximation).</span></div>
<divclass="line"><aid="l00322"name="l00322"></a><spanclass="lineno"> 322</span><spanclass="comment">// Mutable because we track the running time of const method like</span></div>
<divclass="line"><aid="l00323"name="l00323"></a><spanclass="lineno"> 323</span><spanclass="comment">// RightSolve() and LeftSolve().</span></div>
<divclass="line"><aid="l00327"name="l00327"></a><spanclass="lineno"> 327</span><spanclass="comment">// References to the basis subpart of the linear program matrix.</span></div>
<divclass="line"><aid="l00331"name="l00331"></a><spanclass="lineno"> 331</span><spanclass="comment">// Middle form product update factorization and scratchpad_ used to construct</span></div>
<divclass="line"><aid="l00332"name="l00332"></a><spanclass="lineno"> 332</span><spanclass="comment">// new rank one matrices.</span></div>
<divclass="line"><aid="l00337"name="l00337"></a><spanclass="lineno"> 337</span><spanclass="comment">// This is used by RightSolveForTau(). It holds an intermediate result from</span></div>
<divclass="line"><aid="l00338"name="l00338"></a><spanclass="lineno"> 338</span><spanclass="comment">// the last LeftSolveForUnitRow() and also the final result of</span></div>
<divclass="line"><aid="l00342"name="l00342"></a><spanclass="lineno"> 342</span><spanclass="comment">// Booleans controlling the interaction between LeftSolveForUnitRow() that may</span></div>
<divclass="line"><aid="l00343"name="l00343"></a><spanclass="lineno"> 343</span><spanclass="comment">// or may not keep its intermediate results for the optimized</span></div>
<divclass="line"><aid="l00346"name="l00346"></a><spanclass="lineno"> 346</span><spanclass="comment">// tau_computation_can_be_optimized_ will be true iff LeftSolveForUnitRow()</span></div>
<divclass="line"><aid="l00347"name="l00347"></a><spanclass="lineno"> 347</span><spanclass="comment">// kept its intermediate result when it was called and the factorization</span></div>
<divclass="line"><aid="l00348"name="l00348"></a><spanclass="lineno"> 348</span><spanclass="comment">// didn't change since then. If it is true, then RightSolveForTau() can use</span></div>
<divclass="line"><aid="l00349"name="l00349"></a><spanclass="lineno"> 349</span><spanclass="comment">// this result for a faster computation.</span></div>
<divclass="line"><aid="l00351"name="l00351"></a><spanclass="lineno"> 351</span><spanclass="comment">// tau_is_computed_ is used as an heuristic by LeftSolveForUnitRow() to decide</span></div>
<divclass="line"><aid="l00352"name="l00352"></a><spanclass="lineno"> 352</span><spanclass="comment">// if it is worth keeping its intermediate result (which is sligthly slower).</span></div>
<divclass="line"><aid="l00353"name="l00353"></a><spanclass="lineno"> 353</span><spanclass="comment">// It is simply set to true by RightSolveForTau() and to false by</span></div>
<divclass="line"><aid="l00354"name="l00354"></a><spanclass="lineno"> 354</span><spanclass="comment">// LeftSolveForUnitRow(), this way the optimization will automatically switch</span></div>
<divclass="line"><aid="l00355"name="l00355"></a><spanclass="lineno"> 355</span><spanclass="comment">// itself on when switching from the primal simplex (where RightSolveForTau()</span></div>
<divclass="line"><aid="l00356"name="l00356"></a><spanclass="lineno"> 356</span><spanclass="comment">// is never called) to the dual where it is called after each</span></div>
<divclass="line"><aid="l00357"name="l00357"></a><spanclass="lineno"> 357</span><spanclass="comment">// LeftSolveForUnitRow(), and back off again in the other direction.</span></div>
<divclass="line"><aid="l00361"name="l00361"></a><spanclass="lineno"> 361</span><spanclass="comment">// Data structure to store partial solve results for the middle form product</span></div>
<divclass="line"><aid="l00362"name="l00362"></a><spanclass="lineno"> 362</span><spanclass="comment">// update. See LeftSolveForUnitRow() and RightSolveForProblemColumn(). We use</span></div>
<divclass="line"><aid="l00363"name="l00363"></a><spanclass="lineno"> 363</span><spanclass="comment">// two CompactSparseMatrix to have a better cache behavior when solving with</span></div>
<divclass="line"><aid="l00364"name="l00364"></a><spanclass="lineno"> 364</span><spanclass="comment">// the rank_one_factorization_.</span></div>
<divclass="line"><aid="l00376"name="l00376"></a><spanclass="lineno"> 376</span><spanclass="comment">// mutable because the Solve() functions are const but need to update this.</span></div>
<divclass="ttc"id="aclassoperations__research_1_1glop_1_1_basis_factorization_html_a39b7e347f32f4024a988cb93f5e81a2d"><divclass="ttname"><ahref="classoperations__research_1_1glop_1_1_basis_factorization.html#a39b7e347f32f4024a988cb93f5e81a2d">operations_research::glop::BasisFactorization::Refactorize</a></div><divclass="ttdeci">ABSL_MUST_USE_RESULT Status Refactorize()</div><divclass="ttdef"><b>Definition:</b><ahref="basis__representation_8cc_source.html#l00224">basis_representation.cc:224</a></div></div>
<divclass="ttc"id="aclassoperations__research_1_1glop_1_1_basis_factorization_html_a5a3deeb8998f541c08d96dc079591a54"><divclass="ttname"><ahref="classoperations__research_1_1glop_1_1_basis_factorization.html#a5a3deeb8998f541c08d96dc079591a54">operations_research::glop::BasisFactorization::GetColumnPermutation</a></div><divclass="ttdeci">const ColumnPermutation & GetColumnPermutation() const</div><divclass="ttdef"><b>Definition:</b><ahref="basis__representation_8h_source.html#l00168">basis_representation.h:168</a></div></div>
<divclass="ttc"id="aclassoperations__research_1_1glop_1_1_basis_factorization_html_a697f638cbd5a2dab2977b24e550bd7f9"><divclass="ttname"><ahref="classoperations__research_1_1glop_1_1_basis_factorization.html#a697f638cbd5a2dab2977b24e550bd7f9">operations_research::glop::BasisFactorization::Initialize</a></div><divclass="ttdeci">ABSL_MUST_USE_RESULT Status Initialize()</div><divclass="ttdef"><b>Definition:</b><ahref="basis__representation_8cc_source.html#l00206">basis_representation.cc:206</a></div></div>
<divclass="ttc"id="aclassoperations__research_1_1glop_1_1_basis_factorization_html_aedf255db8741ebb2011757ff37dfc02e"><divclass="ttname"><ahref="classoperations__research_1_1glop_1_1_basis_factorization.html#aedf255db8741ebb2011757ff37dfc02e">operations_research::glop::BasisFactorization::ForceRefactorization</a></div><divclass="ttdeci">ABSL_MUST_USE_RESULT Status ForceRefactorization()</div><divclass="ttdef"><b>Definition:</b><ahref="basis__representation_8cc_source.html#l00229">basis_representation.cc:229</a></div></div>
<divclass="ttc"id="aclassoperations__research_1_1glop_1_1_lu_factorization_html_a5a3deeb8998f541c08d96dc079591a54"><divclass="ttname"><ahref="classoperations__research_1_1glop_1_1_lu_factorization.html#a5a3deeb8998f541c08d96dc079591a54">operations_research::glop::LuFactorization::GetColumnPermutation</a></div><divclass="ttdeci">const ColumnPermutation & GetColumnPermutation() const</div><divclass="ttdef"><b>Definition:</b><ahref="lu__factorization_8h_source.html#l00066">lu_factorization.h:66</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>