Lines Matching full:gain

23 // A pair of chains giving the maximum gain is merged into a new chain. The
179 /// The gain of merging two chains, that is, the Ext-TSP score of the merge
199 // Update the current gain if Other is preferred over this.
425 void setMergeGain(MergeGainT Gain) { CachedGain = Gain; }
429 double gain() const { return CachedGain.score(); }
438 // Cached gain value for merging the pair of chains.
441 // Cached gain values for merging the pair of chains. Since the gain of
443 // here and a flag indicating which of the options results in a higher gain.
444 // Cached gain values.
777 // Compute the gain of merging the two chains.
845 /// Compute the gain of merging two chains.
849 /// result is a pair with the first element being the gain and the second
861 // This object holds the best chosen gain of merging two chains.
862 MergeGainT Gain = MergeGainT();
865 /// and update Gain with a better alternative.
875 // Apply the merge, compute the corresponding gain, and update the best
878 Gain.updateIfLessThan(
884 Gain.updateIfLessThan(
923 Edge->setCachedMergeGain(ChainPred, ChainSucc, Gain);
924 return Gain;
927 /// Compute the score gain of merging two chains, respecting a given
942 // The gain for the new chain.
1130 // Create a priority queue containing all edges ordered by the merge gain.
1132 return std::make_tuple(-L->gain(), L->srcChain()->Id, L->dstChain()->Id) <
1133 std::make_tuple(-R->gain(), R->srcChain()->Id, R->dstChain()->Id);
1148 if (Edge->gain() != -1.0)
1151 // Compute the gain of merging the two chains.
1152 MergeGainT Gain = getBestMergeGain(Edge);
1153 Edge->setMergeGain(Gain);
1155 if (Edge->gain() > EPS)
1160 // Merge the chains while the gain of merging is positive.
1189 // Compute the gain of merging the two chains.
1190 MergeGainT Gain = getBestMergeGain(Edge);
1191 Edge->setMergeGain(Gain);
1193 if (Edge->gain() > EPS)
1203 /// Compute the gain of merging two chains.
1207 /// result is a pair with the first element being the gain and the second
1216 // This object holds the best currently chosen gain of merging two chains.
1217 MergeGainT Gain = MergeGainT();
1219 /// Given a list of merge types, try to merge two chains and update Gain
1222 // Apply the merge, compute the corresponding gain, and update the best
1230 if (std::abs(Gain.score() - NewGain.score()) < EPS) {
1233 Gain = NewGain;
1235 } else if (NewGain.score() > Gain.score() + EPS) {
1236 Gain = NewGain;
1244 return Gain;
1247 /// Compute the score gain of merging two chains, respecting a given type.