cleaner assignment in augment()
parent
f9031f53b4
commit
ef2ffd4115
|
|
@ -42,9 +42,11 @@ HybridGaussianFactor::Factors augment(
|
||||||
const HybridGaussianFactor::FactorValuePairs &factors) {
|
const HybridGaussianFactor::FactorValuePairs &factors) {
|
||||||
// Find the minimum value so we can "proselytize" to positive values.
|
// Find the minimum value so we can "proselytize" to positive values.
|
||||||
// Done because we can't have sqrt of negative numbers.
|
// Done because we can't have sqrt of negative numbers.
|
||||||
auto unzipped_pair = unzip(factors);
|
HybridGaussianFactor::Factors gaussianFactors;
|
||||||
const HybridGaussianFactor::Factors gaussianFactors = unzipped_pair.first;
|
AlgebraicDecisionTree<Key> valueTree;
|
||||||
const AlgebraicDecisionTree<Key> valueTree = unzipped_pair.second;
|
std::tie(gaussianFactors, valueTree) = unzip(factors);
|
||||||
|
|
||||||
|
// Normalize
|
||||||
double min_value = valueTree.min();
|
double min_value = valueTree.min();
|
||||||
AlgebraicDecisionTree<Key> values =
|
AlgebraicDecisionTree<Key> values =
|
||||||
valueTree.apply([&min_value](double n) { return n - min_value; });
|
valueTree.apply([&min_value](double n) { return n - min_value; });
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue