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