Fixed tests
							parent
							
								
									9cf3e5c26a
								
							
						
					
					
						commit
						beda6878aa
					
				|  | @ -206,9 +206,8 @@ hybridElimination(const HybridGaussianFactorGraph &factors, | |||
|   }; | ||||
|   sum = GaussianMixtureFactor::Sum(sum, emptyGaussian); | ||||
| 
 | ||||
|   using EliminationPair = | ||||
|       std::pair<boost::shared_ptr<GaussianConditional>, | ||||
|                 std::pair<boost::shared_ptr<GaussianFactor>, double>>; | ||||
|   using EliminationPair = std::pair<boost::shared_ptr<GaussianConditional>, | ||||
|                                     GaussianMixtureFactor::FactorAndConstant>; | ||||
| 
 | ||||
|   KeyVector keysOfEliminated;  // Not the ordering
 | ||||
|   KeyVector keysOfSeparator;   // TODO(frank): Is this just (keys - ordering)?
 | ||||
|  | @ -216,7 +215,7 @@ hybridElimination(const HybridGaussianFactorGraph &factors, | |||
|   // This is the elimination method on the leaf nodes
 | ||||
|   auto eliminate = [&](const GaussianFactorGraph &graph) -> EliminationPair { | ||||
|     if (graph.empty()) { | ||||
|       return {nullptr, std::make_pair(nullptr, 0.0)}; | ||||
|       return {nullptr, {nullptr, 0.0}}; | ||||
|     } | ||||
| 
 | ||||
| #ifdef HYBRID_TIMING | ||||
|  | @ -236,11 +235,7 @@ hybridElimination(const HybridGaussianFactorGraph &factors, | |||
|     gttoc_(hybrid_eliminate); | ||||
| #endif | ||||
| 
 | ||||
|     std::pair<boost::shared_ptr<GaussianConditional>, | ||||
|               std::pair<boost::shared_ptr<GaussianFactor>, double>> | ||||
|         result = std::make_pair(conditional_factor.first, | ||||
|                                 std::make_pair(conditional_factor.second, 0.0)); | ||||
|     return result; | ||||
|     return {conditional_factor.first, {conditional_factor.second, 0.0}}; | ||||
|   }; | ||||
| 
 | ||||
|   // Perform elimination!
 | ||||
|  |  | |||
|  | @ -12,7 +12,7 @@ | |||
| /**
 | ||||
|  * @file   HybridGaussianFactorGraph.h | ||||
|  * @brief  Linearized Hybrid factor graph that uses type erasure | ||||
|  * @author Fan Jiang, Varun Agrawal | ||||
|  * @author Fan Jiang, Varun Agrawal, Frank Dellaert | ||||
|  * @date   Mar 11, 2022 | ||||
|  */ | ||||
| 
 | ||||
|  | @ -38,6 +38,7 @@ class HybridBayesTree; | |||
| class HybridJunctionTree; | ||||
| class DecisionTreeFactor; | ||||
| class JacobianFactor; | ||||
| class HybridValues; | ||||
| 
 | ||||
| /**
 | ||||
|  * @brief Main elimination function for HybridGaussianFactorGraph. | ||||
|  |  | |||
|  | @ -128,9 +128,9 @@ TEST(GaussianMixture, Error) { | |||
|   // Regression for non-tree version.
 | ||||
|   DiscreteValues assignment; | ||||
|   assignment[M(1)] = 0; | ||||
|   EXPECT_DOUBLES_EQUAL(0.5, mixture.error(values, assignment), 1e-8); | ||||
|   EXPECT_DOUBLES_EQUAL(0.5, mixture.error({values, assignment}), 1e-8); | ||||
|   assignment[M(1)] = 1; | ||||
|   EXPECT_DOUBLES_EQUAL(4.3252595155709335, mixture.error(values, assignment), | ||||
|   EXPECT_DOUBLES_EQUAL(4.3252595155709335, mixture.error({values, assignment}), | ||||
|                        1e-8); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -188,7 +188,7 @@ TEST(GaussianMixtureFactor, Error) { | |||
|   DiscreteValues discreteValues; | ||||
|   discreteValues[m1.first] = 1; | ||||
|   EXPECT_DOUBLES_EQUAL( | ||||
|       4.0, mixtureFactor.error(continuousValues, discreteValues), 1e-9); | ||||
|       4.0, mixtureFactor.error({continuousValues, discreteValues}), 1e-9); | ||||
| } | ||||
| 
 | ||||
| /* ************************************************************************* */ | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue