diff --git a/src/mlpack/core/tree/cosine_tree/cosine_tree.cpp b/src/mlpack/core/tree/cosine_tree/cosine_tree.cpp index c67dc83b66..f2ca4d4171 100644 --- a/src/mlpack/core/tree/cosine_tree/cosine_tree.cpp +++ b/src/mlpack/core/tree/cosine_tree/cosine_tree.cpp @@ -105,7 +105,7 @@ CosineTree::CosineTree(const arma::mat& dataset, // Pop node from queue with highest projection error. CosineTree* currentNode; currentNode = treeQueue.front(); - std::pop_heap(treeQueue.begin(), treeQueue.end()); + std::pop_heap(treeQueue.begin(), treeQueue.end(), comp); treeQueue.pop_back(); // If the priority is 0, we can't improve anything, and we can assume that