undo change in GaussianMixture
parent
6b1d89d0a7
commit
6d9fc8e5f2
|
@ -71,23 +71,26 @@ GaussianMixture::GaussianMixture(
|
||||||
Conditionals(discreteParents, conditionals)) {}
|
Conditionals(discreteParents, conditionals)) {}
|
||||||
|
|
||||||
/* *******************************************************************************/
|
/* *******************************************************************************/
|
||||||
GaussianBayesNetTree GaussianMixture::asGaussianBayesNetTree() const {
|
// TODO(dellaert): This is copy/paste: GaussianMixture should be derived from
|
||||||
auto wrap = [](const GaussianConditional::shared_ptr &gc) {
|
// GaussianMixtureFactor, no?
|
||||||
if (gc) {
|
GaussianFactorGraphTree GaussianMixture::add(
|
||||||
return GaussianBayesNet{gc};
|
const GaussianFactorGraphTree &sum) const {
|
||||||
} else {
|
using Y = GaussianFactorGraph;
|
||||||
return GaussianBayesNet();
|
auto add = [](const Y &graph1, const Y &graph2) {
|
||||||
}
|
auto result = graph1;
|
||||||
|
result.push_back(graph2);
|
||||||
|
return result;
|
||||||
};
|
};
|
||||||
return {conditionals_, wrap};
|
const auto tree = asGaussianFactorGraphTree();
|
||||||
|
return sum.empty() ? tree : sum.apply(tree, add);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *******************************************************************************/
|
/* *******************************************************************************/
|
||||||
GaussianFactorGraphTree GaussianMixture::asGaussianFactorGraphTree() const {
|
GaussianFactorGraphTree GaussianMixture::asGaussianFactorGraphTree() const {
|
||||||
auto wrap = [](const GaussianBayesNet &gbn) {
|
auto wrap = [](const GaussianConditional::shared_ptr &gc) {
|
||||||
return GaussianFactorGraph(gbn);
|
return GaussianFactorGraph{gc};
|
||||||
};
|
};
|
||||||
return {this->asGaussianBayesNetTree(), wrap};
|
return {conditionals_, wrap};
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -108,18 +111,15 @@ GaussianBayesNetTree GaussianMixture::add(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *******************************************************************************/
|
/* *******************************************************************************/
|
||||||
// TODO(dellaert): This is copy/paste: GaussianMixture should be derived from
|
GaussianBayesNetTree GaussianMixture::asGaussianBayesNetTree() const {
|
||||||
// GaussianMixtureFactor, no?
|
auto wrap = [](const GaussianConditional::shared_ptr &gc) {
|
||||||
GaussianFactorGraphTree GaussianMixture::add(
|
if (gc) {
|
||||||
const GaussianFactorGraphTree &sum) const {
|
return GaussianBayesNet{gc};
|
||||||
using Y = GaussianFactorGraph;
|
} else {
|
||||||
auto add = [](const Y &graph1, const Y &graph2) {
|
return GaussianBayesNet();
|
||||||
auto result = graph1;
|
}
|
||||||
result.push_back(graph2);
|
|
||||||
return result;
|
|
||||||
};
|
};
|
||||||
const auto tree = asGaussianFactorGraphTree();
|
return {conditionals_, wrap};
|
||||||
return sum.empty() ? tree : sum.apply(tree, add);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* *******************************************************************************/
|
/* *******************************************************************************/
|
||||||
|
|
Loading…
Reference in New Issue