remove fixed values when keys are reintroduced in newFactors
parent
f401a9056e
commit
88fb8f7c65
|
@ -73,9 +73,10 @@ HybridBayesNet HybridBayesNet::prune(
|
||||||
if (conditional->isDiscrete()) continue;
|
if (conditional->isDiscrete()) continue;
|
||||||
|
|
||||||
// No-op if not a HybridGaussianConditional.
|
// No-op if not a HybridGaussianConditional.
|
||||||
if (marginalThreshold)
|
if (marginalThreshold) {
|
||||||
conditional = std::static_pointer_cast<HybridConditional>(
|
conditional = std::static_pointer_cast<HybridConditional>(
|
||||||
conditional->restrict(fixed));
|
conditional->restrict(fixed));
|
||||||
|
}
|
||||||
|
|
||||||
// Now decide on type what to do:
|
// Now decide on type what to do:
|
||||||
if (auto hgc = conditional->asHybrid()) {
|
if (auto hgc = conditional->asHybrid()) {
|
||||||
|
|
|
@ -118,6 +118,13 @@ void HybridSmoother::update(const HybridGaussianFactorGraph &newFactors,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Remove fixed values for discrete keys which are introduced in newFactors
|
||||||
|
for (Key key : newFactors.discreteKeySet()) {
|
||||||
|
if (fixedValues_.find(key) != fixedValues_.end()) {
|
||||||
|
fixedValues_.erase(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_SMOOTHER
|
#ifdef DEBUG_SMOOTHER
|
||||||
// Print discrete keys in the bayesNetFragment:
|
// Print discrete keys in the bayesNetFragment:
|
||||||
std::cout << "Discrete keys in bayesNetFragment: ";
|
std::cout << "Discrete keys in bayesNetFragment: ";
|
||||||
|
|
Loading…
Reference in New Issue