#include <GaussianBayesTree.h>
Public Member Functions | |
double | determinant () const |
bool | equals (const This &other, double tol=1e-9) const |
double | error (const VectorValues &x) const |
GaussianBayesTree () | |
VectorValues | gradient (const VectorValues &x0) const |
VectorValues | gradientAtZero () const |
double | logDeterminant () const |
Matrix | marginalCovariance (Key key) const |
VectorValues | optimize () const |
VectorValues | optimizeGradientSearch () const |
Public Member Functions inherited from gtsam::BayesTree< GaussianBayesTreeClique > | |
size_t | size () const |
bool | empty () const |
const Nodes & | nodes () const |
sharedClique | operator[] (Key j) const |
const Roots & | roots () const |
const sharedClique & | clique (Key j) const |
BayesTreeCliqueData | getCliqueData () const |
size_t | numCachedSeparatorMarginals () const |
sharedConditional | marginalFactor (Key j, const Eliminate &function=EliminationTraitsType::DefaultEliminate) const |
sharedFactorGraph | joint (Key j1, Key j2, const Eliminate &function=EliminationTraitsType::DefaultEliminate) const |
sharedBayesNet | jointBayesNet (Key j1, Key j2, const Eliminate &function=EliminationTraitsType::DefaultEliminate) const |
void | dot (std::ostream &os, const KeyFormatter &keyFormatter=DefaultKeyFormatter) const |
Output to graphviz format, stream version. More... | |
std::string | dot (const KeyFormatter &keyFormatter=DefaultKeyFormatter) const |
Output to graphviz format string. More... | |
void | saveGraph (const std::string &filename, const KeyFormatter &keyFormatter=DefaultKeyFormatter) const |
output to file with graphviz format. More... | |
Key | findParentClique (const CONTAINER &parents) const |
void | clear () |
void | deleteCachedShortcuts () |
void | removePath (sharedClique clique, BayesNetType *bn, Cliques *orphans) |
void | removeTop (const KeyVector &keys, BayesNetType *bn, Cliques *orphans) |
Cliques | removeSubtree (const sharedClique &subtree) |
void | insertRoot (const sharedClique &subtree) |
void | addClique (const sharedClique &clique, const sharedClique &parent_clique=sharedClique()) |
void | addFactorsToGraph (FactorGraph< FactorType > *graph) const |
void | print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const |
Private Types | |
typedef BayesTree< GaussianBayesTreeClique > | Base |
Additional Inherited Members | |
Protected Types inherited from gtsam::BayesTree< GaussianBayesTreeClique > | |
typedef std::shared_ptr< This > | shared_ptr |
typedef BayesTree< GaussianBayesTreeClique > | This |
Protected Member Functions inherited from gtsam::BayesTree< GaussianBayesTreeClique > | |
This & | operator= (const This &other) |
~BayesTree () | |
BayesTree () | |
BayesTree (const This &other) | |
void | getCliqueData (sharedClique clique, BayesTreeCliqueData *stats) const |
void | dot (std::ostream &s, sharedClique clique, const KeyFormatter &keyFormatter, int parentnum=0) const |
void | removeClique (sharedClique clique) |
void | fillNodesIndex (const sharedClique &subtree) |
bool | equals (const This &other, double tol=1e-9) const |
Protected Attributes inherited from gtsam::BayesTree< GaussianBayesTreeClique > | |
Nodes | nodes_ |
Roots | roots_ |
A Bayes tree representing a Gaussian density
Definition at line 49 of file GaussianBayesTree.h.
|
private |
Definition at line 53 of file GaussianBayesTree.h.
typedef std::shared_ptr<This> gtsam::GaussianBayesTree::shared_ptr |
Definition at line 57 of file GaussianBayesTree.h.
Definition at line 56 of file GaussianBayesTree.h.
|
inline |
Default constructor, creates an empty Bayes tree
Definition at line 60 of file GaussianBayesTree.h.
double gtsam::GaussianBayesTree::determinant | ( | ) | const |
Computes the determinant of a GassianBayesTree, as if the Bayes tree is reorganized into a matrix. A GassianBayesTree is equivalent to an upper triangular matrix, and for an upper triangular matrix determinant is the product of the diagonal elements. Instead of actually multiplying we add the logarithms of the diagonal elements and take the exponent at the end because this is more numerically stable.
Definition at line 114 of file GaussianBayesTree.cpp.
bool gtsam::GaussianBayesTree::equals | ( | const This & | other, |
double | tol = 1e-9 |
||
) | const |
Check equality
Definition at line 61 of file GaussianBayesTree.cpp.
double gtsam::GaussianBayesTree::error | ( | const VectorValues & | x | ) | const |
0.5 * sum of squared Mahalanobis distances.
Definition at line 90 of file GaussianBayesTree.cpp.
VectorValues gtsam::GaussianBayesTree::gradient | ( | const VectorValues & | x0 | ) | const |
Compute the gradient of the energy function, , centered around . The gradient is .
x0 | The center about which to compute the gradient |
Definition at line 80 of file GaussianBayesTree.cpp.
VectorValues gtsam::GaussianBayesTree::gradientAtZero | ( | ) | const |
Compute the gradient of the energy function, , centered around zero. The gradient about zero is . See also gradient(const GaussianBayesNet&, const VectorValues&).
Definition at line 85 of file GaussianBayesTree.cpp.
double gtsam::GaussianBayesTree::logDeterminant | ( | ) | const |
Computes the determinant of a GassianBayesTree, as if the Bayes tree is reorganized into a matrix. A GassianBayesTree is equivalent to an upper triangular matrix, and for an upper triangular matrix determinant is the product of the diagonal elements. Instead of actually multiplying we add the logarithms of the diagonal elements and take the exponent at the end because this is more numerically stable.
Definition at line 95 of file GaussianBayesTree.cpp.
Return the marginal on the requested variable as a covariance matrix. See also marginalFactor().
Definition at line 120 of file GaussianBayesTree.cpp.
VectorValues gtsam::GaussianBayesTree::optimize | ( | ) | const |
Recursively optimize the BayesTree to produce a vector solution.
Definition at line 67 of file GaussianBayesTree.cpp.
VectorValues gtsam::GaussianBayesTree::optimizeGradientSearch | ( | ) | const |
Optimize along the gradient direction, with a closed-form computation to perform the line search. The gradient is computed about .
This function returns that minimizes a reparametrized problem. The error function of a GaussianBayesNet is
with gradient and Hessian
This function performs the line search in the direction of the gradient evaluated at with step size that minimizes :
Optimizing by setting the derivative to zero yields . For efficiency, this function evaluates the denominator without computing the Hessian , returning
Definition at line 73 of file GaussianBayesTree.cpp.