some cleanup
parent
c204524a3b
commit
8ba5da44a6
|
@ -190,8 +190,7 @@ discreteElimination(const HybridGaussianFactorGraph &factors,
|
||||||
/* ************************************************************************ */
|
/* ************************************************************************ */
|
||||||
// If any GaussianFactorGraph in the decision tree contains a nullptr, convert
|
// If any GaussianFactorGraph in the decision tree contains a nullptr, convert
|
||||||
// that leaf to an empty GaussianFactorGraph. Needed since the DecisionTree will
|
// that leaf to an empty GaussianFactorGraph. Needed since the DecisionTree will
|
||||||
// otherwise create a GFG with a single (null) factor.
|
// otherwise create a GFG with a single (null) factor, which doesn't register as null.
|
||||||
// TODO(dellaert): still a mystery to me why this is needed.
|
|
||||||
GaussianFactorGraphTree removeEmpty(const GaussianFactorGraphTree &sum) {
|
GaussianFactorGraphTree removeEmpty(const GaussianFactorGraphTree &sum) {
|
||||||
auto emptyGaussian = [](const GaussianFactorGraph &graph) {
|
auto emptyGaussian = [](const GaussianFactorGraph &graph) {
|
||||||
bool hasNull =
|
bool hasNull =
|
||||||
|
@ -275,9 +274,9 @@ hybridElimination(const HybridGaussianFactorGraph &factors,
|
||||||
};
|
};
|
||||||
|
|
||||||
DecisionTree<Key, double> probabilities(eliminationResults, probability);
|
DecisionTree<Key, double> probabilities(eliminationResults, probability);
|
||||||
return {std::make_shared<HybridConditional>(gaussianMixture),
|
return {
|
||||||
std::make_shared<DecisionTreeFactor>(discreteSeparator,
|
std::make_shared<HybridConditional>(gaussianMixture),
|
||||||
probabilities)};
|
std::make_shared<DecisionTreeFactor>(discreteSeparator, probabilities)};
|
||||||
} else {
|
} else {
|
||||||
// Otherwise, we create a resulting GaussianMixtureFactor on the separator,
|
// Otherwise, we create a resulting GaussianMixtureFactor on the separator,
|
||||||
// taking care to correct for conditional constant.
|
// taking care to correct for conditional constant.
|
||||||
|
|
|
@ -131,7 +131,7 @@ namespace gtsam {
|
||||||
* term, and f the constant term.
|
* term, and f the constant term.
|
||||||
* JacobianFactor error is \f[ 0.5* (Ax-b)' M (Ax-b) = 0.5*x'A'MAx - x'A'Mb + 0.5*b'Mb \f]
|
* JacobianFactor error is \f[ 0.5* (Ax-b)' M (Ax-b) = 0.5*x'A'MAx - x'A'Mb + 0.5*b'Mb \f]
|
||||||
* HessianFactor error is \f[ 0.5*(x'Gx - 2x'g + f) = 0.5*x'Gx - x'*g + 0.5*f \f]
|
* HessianFactor error is \f[ 0.5*(x'Gx - 2x'g + f) = 0.5*x'Gx - x'*g + 0.5*f \f]
|
||||||
* So, with \f$ A = [A1 A2] \f$ and \f$ G=A*'M*A = [A1';A2']*M*[A1 A2] \f$ we have
|
* So, with \f$ A = [A1 A2] \f$ and \f$ G=A'*M*A = [A1';A2']*M*[A1 A2] \f$ we have
|
||||||
\code
|
\code
|
||||||
n1*n1 G11 = A1'*M*A1
|
n1*n1 G11 = A1'*M*A1
|
||||||
n1*n2 G12 = A1'*M*A2
|
n1*n2 G12 = A1'*M*A2
|
||||||
|
|
Loading…
Reference in New Issue