From 62afde62f384753fdadfda77ace2d113003058c4 Mon Sep 17 00:00:00 2001 From: Frank Dellaert Date: Fri, 20 Jan 2012 20:46:25 +0000 Subject: [PATCH] Better comments --- gtsam/inference/JunctionTree.h | 26 +++++++++++++++----------- gtsam/linear/GaussianJunctionTree.h | 12 +++++++++--- 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/gtsam/inference/JunctionTree.h b/gtsam/inference/JunctionTree.h index 2f74357fe..c4d8aaa2c 100644 --- a/gtsam/inference/JunctionTree.h +++ b/gtsam/inference/JunctionTree.h @@ -30,18 +30,22 @@ namespace gtsam { /** - * In gtsam a junction tree is an intermediate data structure in multifrontal - * variable elimination. Each node is a cluster of factors, along with a - * clique of variables that are eliminated all at once. The tree structure and - * elimination method are exactly analagous to the EliminationTree, except that - * in the JunctionTree, at each node multiple variables are eliminated at the same - * time. + * A ClusterTree, i.e., a set of variable clusters with factors, arranged in a tree, with + * the additional property that it represents the clique tree associated with a Bayes net. + * + * In GTSAM a junction tree is an intermediate data structure in multifrontal + * variable elimination. Each node is a cluster of factors, along with a + * clique of variables that are eliminated all at once. In detail, every node k represents + * a clique (maximal fully connected subset) of an associated chordal graph, such as a + * chordal Bayes net resulting from elimination. + * + * The difference with the BayesTree is that a JunctionTree stores factors, whereas a + * BayesTree stores conditionals, that are the product of eliminating the factors in the + * corresponding JunctionTree cliques. + * + * The tree structure and elimination method are exactly analagous to the EliminationTree, + * except that in the JunctionTree, at each node multiple variables are eliminated at a time. * - * A junction tree (or clique-tree) is a cluster-tree where each node k represents a - * clique (maximal fully connected subset) of an associated chordal graph, such as a - * chordal Bayes net resulting from elimination. In GTSAM the BayesTree is used to - * represent the clique tree associated with a Bayes net, and the JunctionTree is - * used to collect the factors associated with each clique during the elimination process. * * \ingroup Multifrontal */ diff --git a/gtsam/linear/GaussianJunctionTree.h b/gtsam/linear/GaussianJunctionTree.h index 678c7c616..be98669f1 100644 --- a/gtsam/linear/GaussianJunctionTree.h +++ b/gtsam/linear/GaussianJunctionTree.h @@ -27,9 +27,13 @@ namespace gtsam { - /* ************************************************************************* */ /** - * GaussianJunctionTree that does the optimization + * A JunctionTree where all the factors are of type GaussianFactor. + * + * In GTSAM, typically, a GaussianJunctionTree is created directly from a GaussianFactorGraph, + * after which you call optimize() to solve for the mean, or JunctionTree::eliminate() to + * create a BayesTree. In both cases, you need to provide a basic + * GaussianFactorGraph::Eliminate function that will be used to * * \ingroup Multifrontal */ @@ -60,7 +64,9 @@ namespace gtsam { GaussianJunctionTree(const GaussianFactorGraph& fg, const VariableIndex& variableIndex) : Base(fg, variableIndex) {} - // optimize the linear graph + /** + * optimize the linear graph + */ VectorValues optimize(Eliminate function) const; // convenient function to return dimensions of all variables in the BayesTree