rename normalization to normalizer
parent
a2f917aa09
commit
748db19795
|
@ -126,10 +126,10 @@ namespace gtsam {
|
|||
gttoc(product);
|
||||
|
||||
// Max over all the potentials by pretending all keys are frontal:
|
||||
auto normalization = product.max(product.size());
|
||||
auto normalizer = product.max(product.size());
|
||||
|
||||
// Normalize the product factor to prevent underflow.
|
||||
product = product / (*normalization);
|
||||
product = product / (*normalizer);
|
||||
|
||||
return product;
|
||||
}
|
||||
|
@ -207,8 +207,7 @@ namespace gtsam {
|
|||
return dag.argmax();
|
||||
}
|
||||
|
||||
DiscreteValues DiscreteFactorGraph::optimize(
|
||||
const Ordering& ordering) const {
|
||||
DiscreteValues DiscreteFactorGraph::optimize(const Ordering& ordering) const {
|
||||
gttic(DiscreteFactorGraph_optimize);
|
||||
DiscreteLookupDAG dag = maxProduct(ordering);
|
||||
return dag.argmax();
|
||||
|
|
|
@ -117,9 +117,9 @@ TEST(DiscreteFactorGraph, test) {
|
|||
*std::dynamic_pointer_cast<DecisionTreeFactor>(newFactorPtr);
|
||||
|
||||
// Normalize newFactor by max for comparison with expected
|
||||
auto normalization = newFactor.max(newFactor.size());
|
||||
auto normalizer = newFactor.max(newFactor.size());
|
||||
|
||||
newFactor = newFactor / *normalization;
|
||||
newFactor = newFactor / *normalizer;
|
||||
|
||||
// Check Conditional
|
||||
CHECK(conditional);
|
||||
|
@ -131,9 +131,9 @@ TEST(DiscreteFactorGraph, test) {
|
|||
CHECK(&newFactor);
|
||||
DecisionTreeFactor expectedFactor(B & A, "10 6 6 10");
|
||||
// Normalize by max.
|
||||
normalization = expectedFactor.max(expectedFactor.size());
|
||||
// Ensure normalization is correct.
|
||||
expectedFactor = expectedFactor / *normalization;
|
||||
normalizer = expectedFactor.max(expectedFactor.size());
|
||||
// Ensure normalizer is correct.
|
||||
expectedFactor = expectedFactor / *normalizer;
|
||||
EXPECT(assert_equal(expectedFactor, newFactor));
|
||||
|
||||
// Test using elimination tree
|
||||
|
|
Loading…
Reference in New Issue