release/4.3a0
Varun Agrawal 2022-11-07 18:42:51 -05:00
parent 083fd21d7a
commit 64cd7c938f
1 changed files with 12 additions and 0 deletions

View File

@ -182,6 +182,13 @@ std::vector<size_t> getDiscreteSequence(size_t x) {
return discrete_seq; return discrete_seq;
} }
/**
* @brief Helper method to get the probPrimeTree
* as per the new elimination scheme.
*
* @param graph The HybridGaussianFactorGraph to eliminate.
* @return AlgebraicDecisionTree<Key>
*/
AlgebraicDecisionTree<Key> probPrimeTree( AlgebraicDecisionTree<Key> probPrimeTree(
const HybridGaussianFactorGraph& graph) { const HybridGaussianFactorGraph& graph) {
HybridBayesNet::shared_ptr bayesNet; HybridBayesNet::shared_ptr bayesNet;
@ -226,6 +233,11 @@ AlgebraicDecisionTree<Key> probPrimeTree(
return probPrimeTree; return probPrimeTree;
} }
/****************************************************************************/
/**
* Test for correctness of different branches of the P'(Continuous | Discrete).
* The values should match those of P'(Continuous) for each discrete mode.
*/
TEST(HybridEstimation, Probability) { TEST(HybridEstimation, Probability) {
constexpr size_t K = 4; constexpr size_t K = 4;
std::vector<double> measurements = {0, 1, 2, 2}; std::vector<double> measurements = {0, 1, 2, 2};