use KeyVector and iterator constructor

release/4.3a0
Varun Agrawal 2022-06-04 11:45:42 -04:00
parent e25b0c8879
commit 28db8b20ff
1 changed files with 6 additions and 8 deletions

View File

@ -82,14 +82,12 @@ HybridBayesNet HybridBayesNet::prune(
// reverse keys to get a natural ordering
std::reverse(discreteKeys.begin(), discreteKeys.end());
// Convert from boost::iterator_range to std::vector.
std::vector<Key> frontals, parents;
for (Key key : gaussianMixture->frontals()) {
frontals.push_back(key);
}
for (Key key : gaussianMixture->parents()) {
parents.push_back(key);
}
// Convert from boost::iterator_range to KeyVector
// so we can pass it to constructor.
KeyVector frontals(gaussianMixture->frontals().begin(),
gaussianMixture->frontals().end()),
parents(gaussianMixture->parents().begin(),
gaussianMixture->parents().end());
// Create the new gaussian mixture and add it to the bayes net.
auto prunedGaussianMixture = boost::make_shared<GaussianMixture>(