update test
parent
d3780158b1
commit
14f32544d2
|
|
@ -451,8 +451,7 @@ TEST(HybridBayesNet, UpdateDiscreteConditionals) {
|
||||||
DiscreteConditional joint;
|
DiscreteConditional joint;
|
||||||
for (auto&& conditional : posterior->discreteMarginal()) {
|
for (auto&& conditional : posterior->discreteMarginal()) {
|
||||||
// The last discrete conditional may be a TableDistribution
|
// The last discrete conditional may be a TableDistribution
|
||||||
if (auto dtc =
|
if (auto dtc = std::dynamic_pointer_cast<TableDistribution>(conditional)) {
|
||||||
std::dynamic_pointer_cast<TableDistribution>(conditional)) {
|
|
||||||
DiscreteConditional dc(dtc->nrFrontals(), dtc->toDecisionTreeFactor());
|
DiscreteConditional dc(dtc->nrFrontals(), dtc->toDecisionTreeFactor());
|
||||||
joint = joint * dc;
|
joint = joint * dc;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -461,7 +460,8 @@ TEST(HybridBayesNet, UpdateDiscreteConditionals) {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t maxNrLeaves = 3;
|
size_t maxNrLeaves = 3;
|
||||||
auto prunedDecisionTree = *joint.prune(maxNrLeaves);
|
DiscreteConditional prunedDecisionTree(joint);
|
||||||
|
prunedDecisionTree.prune(maxNrLeaves);
|
||||||
|
|
||||||
#ifdef GTSAM_DT_MERGING
|
#ifdef GTSAM_DT_MERGING
|
||||||
EXPECT_LONGS_EQUAL(maxNrLeaves + 2 /*2 zero leaves*/,
|
EXPECT_LONGS_EQUAL(maxNrLeaves + 2 /*2 zero leaves*/,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue