Foam::SortableList<T>::SortableList(const SortableList<T>& lst) : List<T>(lst), indices_(lst.indices()) {}
// and the tree should therefore take them into account SortableList<scalar> phiMaxDir(chemPoints.size(),0.0); forAll(chemPoints, j) { phiMaxDir[j] = chemPoints[j]->phi()[maxDir]; } phiMaxDir.sort(); // delete reference to all node since the tree is reshaped deleteAllNode(); root_ = nullptr; // add the node for the two extremum bn* newNode = new bn ( chemPoints[phiMaxDir.indices()[0]], chemPoints[phiMaxDir.indices()[phiMaxDir.size()-1]], nullptr ); root_ = newNode; chemPoints[phiMaxDir.indices()[0]]->node() = newNode; chemPoints[phiMaxDir.indices()[phiMaxDir.size()-1]]->node() = newNode; for (label cpi=1; cpi<chemPoints.size()-1; cpi++) { chP* phi0; binaryTreeSearch ( chemPoints[phiMaxDir.indices()[cpi]]->phi(), root_,