Home | History | Annotate | Download | only in Analysis

Lines Matching full:weights

64 ///  1. Initialize by saving the sum of the weights in \a RemWeight and the
117 Weights.push_back(Weight(Type, Node, Amount));
136 static void combineWeightsBySorting(WeightList &Weights) {
138 std::sort(Weights.begin(), Weights.end(),
143 WeightList::iterator O = Weights.begin();
144 for (WeightList::const_iterator I = O, L = O, E = Weights.end(); I != E;
148 // Find the adjacent weights to the same node.
154 Weights.erase(O, Weights.end());
157 static void combineWeightsByHashing(WeightList &Weights) {
158 // Collect weights into a DenseMap.
160 HashTable Combined(NextPowerOf2(2 * Weights.size()));
161 for (const Weight &W : Weights)
165 if (Weights.size() == Combined.size())
168 // Fill in the new weights.
169 Weights.clear();
170 Weights.reserve(Combined.size());
172 Weights.push_back(I.second);
175 static void combineWeights(WeightList &Weights) {
177 if (Weights.size() > 128) {
178 combineWeightsByHashing(Weights);
182 combineWeightsBySorting(Weights);
195 if (Weights.empty())
199 if (Weights.size() > 1)
200 combineWeights(Weights);
203 if (Weights.size() == 1) {
205 Weights.front().Amount = 1;
222 // sum of the weights, but let's double-check.
223 assert(Total == std::accumulate(Weights.begin(), Weights.end(), UINT64_C(0),
235 // Sum the weights to each node and shift right if necessary.
236 for (Weight &W : Weights) {
409 for (const Weight &W : Dist.Weights) {
769 // as weights for the distribution.
788 << " to headers using above weights\n");
789 for (const Weight &W : Dist.Weights) {
791 assert(W.Type == Weight::Local && "all weights should be local");