small improvements

release/4.3a0
Varun Agrawal 2024-10-09 15:10:13 -04:00
parent ac52be9cf0
commit b79c69b408
1 changed files with 2 additions and 2 deletions

View File

@ -234,13 +234,13 @@ continuousElimination(const HybridGaussianFactorGraph &factors,
* and then exponentiate to create a DecisionTreeFactor (not normalized yet!).
*
* @param errors DecisionTree of (unnormalized) errors.
* @return AlgebraicDecisionTree<Key>
* @return DecisionTreeFactor::shared_ptr
*/
static DecisionTreeFactor::shared_ptr DiscreteFactorFromErrors(
const DiscreteKeys &discreteKeys,
const AlgebraicDecisionTree<Key> &errors) {
double min_log = errors.min();
AlgebraicDecisionTree<Key> potentials = DecisionTree<Key, double>(
AlgebraicDecisionTree<Key> potentials(
errors, [&min_log](const double x) { return exp(-(x - min_log)); });
return std::make_shared<DecisionTreeFactor>(discreteKeys, potentials);
}