formatting fixes
parent
9f7ccbb33c
commit
8e85b68863
|
@ -24,9 +24,9 @@
|
||||||
#include <gtsam/discrete/DecisionTree.h>
|
#include <gtsam/discrete/DecisionTree.h>
|
||||||
#include <gtsam/discrete/DecisionTreeFactor.h>
|
#include <gtsam/discrete/DecisionTreeFactor.h>
|
||||||
#include <gtsam/discrete/DiscreteKey.h>
|
#include <gtsam/discrete/DiscreteKey.h>
|
||||||
#include <gtsam/hybrid/HybridGaussianProductFactor.h>
|
|
||||||
#include <gtsam/hybrid/HybridFactor.h>
|
#include <gtsam/hybrid/HybridFactor.h>
|
||||||
#include <gtsam/hybrid/HybridGaussianFactor.h>
|
#include <gtsam/hybrid/HybridGaussianFactor.h>
|
||||||
|
#include <gtsam/hybrid/HybridGaussianProductFactor.h>
|
||||||
#include <gtsam/inference/Conditional.h>
|
#include <gtsam/inference/Conditional.h>
|
||||||
#include <gtsam/linear/GaussianConditional.h>
|
#include <gtsam/linear/GaussianConditional.h>
|
||||||
|
|
||||||
|
|
|
@ -139,8 +139,7 @@ void HybridGaussianFactor::print(const std::string &s,
|
||||||
std::cout << " empty" << std::endl;
|
std::cout << " empty" << std::endl;
|
||||||
} else {
|
} else {
|
||||||
factors_.print(
|
factors_.print(
|
||||||
"",
|
"", [&](Key k) { return formatter(k); },
|
||||||
[&](Key k) { return formatter(k); },
|
|
||||||
[&](const auto& pair) -> std::string {
|
[&](const auto& pair) -> std::string {
|
||||||
RedirectCout rd;
|
RedirectCout rd;
|
||||||
std::cout << ":\n";
|
std::cout << ":\n";
|
||||||
|
|
|
@ -120,9 +120,8 @@ public:
|
||||||
|
|
||||||
bool equals(const HybridFactor &lf, double tol = 1e-9) const override;
|
bool equals(const HybridFactor &lf, double tol = 1e-9) const override;
|
||||||
|
|
||||||
void
|
void print(const std::string &s = "", const KeyFormatter &formatter =
|
||||||
print(const std::string &s = "",
|
DefaultKeyFormatter) const override;
|
||||||
const KeyFormatter &formatter = DefaultKeyFormatter) const override;
|
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
/// @name Standard API
|
/// @name Standard API
|
||||||
|
@ -138,8 +137,8 @@ public:
|
||||||
* @return AlgebraicDecisionTree<Key> A decision tree with the same keys
|
* @return AlgebraicDecisionTree<Key> A decision tree with the same keys
|
||||||
* as the factors involved, and leaf values as the error.
|
* as the factors involved, and leaf values as the error.
|
||||||
*/
|
*/
|
||||||
AlgebraicDecisionTree<Key>
|
AlgebraicDecisionTree<Key> errorTree(
|
||||||
errorTree(const VectorValues &continuousValues) const override;
|
const VectorValues &continuousValues) const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Compute the log-likelihood, including the log-normalizing constant.
|
* @brief Compute the log-likelihood, including the log-normalizing constant.
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include <gtsam/discrete/DiscreteFactorGraph.h>
|
#include <gtsam/discrete/DiscreteFactorGraph.h>
|
||||||
#include <gtsam/discrete/DiscreteJunctionTree.h>
|
#include <gtsam/discrete/DiscreteJunctionTree.h>
|
||||||
#include <gtsam/discrete/DiscreteKey.h>
|
#include <gtsam/discrete/DiscreteKey.h>
|
||||||
|
#include <gtsam/discrete/DiscreteValues.h>
|
||||||
#include <gtsam/hybrid/HybridConditional.h>
|
#include <gtsam/hybrid/HybridConditional.h>
|
||||||
#include <gtsam/hybrid/HybridEliminationTree.h>
|
#include <gtsam/hybrid/HybridEliminationTree.h>
|
||||||
#include <gtsam/hybrid/HybridFactor.h>
|
#include <gtsam/hybrid/HybridFactor.h>
|
||||||
|
@ -39,7 +40,6 @@
|
||||||
#include <gtsam/linear/GaussianJunctionTree.h>
|
#include <gtsam/linear/GaussianJunctionTree.h>
|
||||||
#include <gtsam/linear/HessianFactor.h>
|
#include <gtsam/linear/HessianFactor.h>
|
||||||
#include <gtsam/linear/JacobianFactor.h>
|
#include <gtsam/linear/JacobianFactor.h>
|
||||||
#include "gtsam/discrete/DiscreteValues.h"
|
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -83,11 +83,12 @@ static void printFactor(const std::shared_ptr<Factor> &factor,
|
||||||
const DiscreteValues &assignment,
|
const DiscreteValues &assignment,
|
||||||
const KeyFormatter &keyFormatter) {
|
const KeyFormatter &keyFormatter) {
|
||||||
if (auto hgf = dynamic_pointer_cast<HybridGaussianFactor>(factor)) {
|
if (auto hgf = dynamic_pointer_cast<HybridGaussianFactor>(factor)) {
|
||||||
if (assignment.empty())
|
if (assignment.empty()) {
|
||||||
hgf->print("HybridGaussianFactor:", keyFormatter);
|
hgf->print("HybridGaussianFactor:", keyFormatter);
|
||||||
else
|
} else {
|
||||||
hgf->operator()(assignment)
|
hgf->operator()(assignment)
|
||||||
.first->print("HybridGaussianFactor, component:", keyFormatter);
|
.first->print("HybridGaussianFactor, component:", keyFormatter);
|
||||||
|
}
|
||||||
} else if (auto gf = dynamic_pointer_cast<GaussianFactor>(factor)) {
|
} else if (auto gf = dynamic_pointer_cast<GaussianFactor>(factor)) {
|
||||||
factor->print("GaussianFactor:\n", keyFormatter);
|
factor->print("GaussianFactor:\n", keyFormatter);
|
||||||
|
|
||||||
|
@ -99,13 +100,14 @@ static void printFactor(const std::shared_ptr<Factor> &factor,
|
||||||
} else if (hc->isDiscrete()) {
|
} else if (hc->isDiscrete()) {
|
||||||
factor->print("DiscreteConditional:\n", keyFormatter);
|
factor->print("DiscreteConditional:\n", keyFormatter);
|
||||||
} else {
|
} else {
|
||||||
if (assignment.empty())
|
if (assignment.empty()) {
|
||||||
hc->print("HybridConditional:", keyFormatter);
|
hc->print("HybridConditional:", keyFormatter);
|
||||||
else
|
} else {
|
||||||
hc->asHybrid()
|
hc->asHybrid()
|
||||||
->choose(assignment)
|
->choose(assignment)
|
||||||
->print("HybridConditional, component:\n", keyFormatter);
|
->print("HybridConditional, component:\n", keyFormatter);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
factor->print("Unknown factor type\n", keyFormatter);
|
factor->print("Unknown factor type\n", keyFormatter);
|
||||||
}
|
}
|
||||||
|
|
|
@ -145,8 +145,8 @@ class GTSAM_EXPORT HybridGaussianFactorGraph
|
||||||
/// @name Testable
|
/// @name Testable
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
void
|
void print(
|
||||||
print(const std::string &s = "HybridGaussianFactorGraph",
|
const std::string& s = "HybridGaussianFactorGraph",
|
||||||
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const override;
|
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue