- unsigned int pivot = (*arr)[high]->get_depth();
- int i = low - 1;
-
- for (int j = low; j <= high - 1; j++) {
- if ( (*arr)[j]->get_depth() < pivot ) {
- i++;
- Predicate *tmp = (*arr)[i];
- (*arr)[i] = (*arr)[j];
- (*arr)[j] = tmp;
- }
- }
-
- Predicate * tmp = (*arr)[i + 1];
- (*arr)[i + 1] = (*arr)[high];
- (*arr)[high] = tmp;
-
- return i + 1;
-}
-
-/* Implement quick sort to sort leaves before assigning base scores */
-static void quickSort(SnapVector<Predicate *> * arr, int low, int high)
-{
- if (low < high) {
- int pi = partition(arr, low, high);
-
- quickSort(arr, low, pi - 1);
- quickSort(arr, pi + 1, high);
- }
-}
-
-void FuncNode::assign_initial_weight()
-{
- PredSetIter * it = predicate_leaves.iterator();
- SnapVector<Predicate *> leaves;
- while (it->hasNext()) {
- Predicate * pred = it->next();
- double weight = 100.0 / sqrt(pred->get_expl_count() + 1);
- pred->set_weight(weight);
- leaves.push_back(pred);
- }
-
- quickSort(&leaves, 0, leaves.size() - 1);