Cleanups in BayesTree and SymbolicBayesTree
parent
4fa8332c77
commit
79ce96dceb
|
|
@ -93,8 +93,6 @@ namespace gtsam {
|
||||||
/** Root cliques */
|
/** Root cliques */
|
||||||
std::vector<sharedClique> roots_;
|
std::vector<sharedClique> roots_;
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/// @name Standard Constructors
|
/// @name Standard Constructors
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
|
|
@ -104,32 +102,26 @@ namespace gtsam {
|
||||||
/** Copy constructor */
|
/** Copy constructor */
|
||||||
BayesTreeUnordered(const This& other);
|
BayesTreeUnordered(const This& other);
|
||||||
|
|
||||||
protected:
|
|
||||||
/** Assignment operator */
|
|
||||||
This& operator=(const This& other);
|
|
||||||
|
|
||||||
public:
|
|
||||||
/// @}
|
|
||||||
/// @name Advanced Constructors
|
|
||||||
/// @{
|
|
||||||
|
|
||||||
/** Destructor */
|
/** Destructor */
|
||||||
virtual ~BayesTreeUnordered() {}
|
virtual ~BayesTreeUnordered() {}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
|
/** Assignment operator */
|
||||||
|
This& operator=(const This& other);
|
||||||
|
|
||||||
/// @name Testable
|
/// @name Testable
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
protected:
|
|
||||||
/** check equality */
|
/** check equality */
|
||||||
bool equals(const This& other, double tol = 1e-9) const;
|
bool equals(const This& other, double tol = 1e-9) const;
|
||||||
|
|
||||||
|
public:
|
||||||
/** print */
|
/** print */
|
||||||
void print(const std::string& s = "",
|
void print(const std::string& s = "",
|
||||||
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
|
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
|
||||||
|
|
||||||
public:
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// @name Standard Interface
|
/// @name Standard Interface
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,13 +19,16 @@
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
|
|
||||||
#include <gtsam/symbolic/SymbolicBayesTreeUnordered.h>
|
#include <gtsam/symbolic/SymbolicBayesTreeUnordered.h>
|
||||||
|
#include <gtsam/symbolic/SymbolicFactorGraphUnordered.h>
|
||||||
|
#include <gtsam/symbolic/SymbolicBayesNetUnordered.h>
|
||||||
#include <gtsam/inference/BayesTreeUnordered-inst.h>
|
#include <gtsam/inference/BayesTreeUnordered-inst.h>
|
||||||
#include <gtsam/inference/BayesTreeCliqueBaseUnordered-inst.h>
|
#include <gtsam/inference/BayesTreeCliqueBaseUnordered-inst.h>
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
void SymbolicBayesTreeUnordered::noop() const {
|
bool SymbolicBayesTreeUnordered::equals(const This& other, double tol /* = 1e-9 */) const
|
||||||
|
{
|
||||||
|
return Base::equals(other, tol);
|
||||||
}
|
}
|
||||||
|
|
||||||
// /* ************************************************************************* */
|
// /* ************************************************************************* */
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,16 @@
|
||||||
|
|
||||||
#include <gtsam/inference/BayesTreeUnordered.h>
|
#include <gtsam/inference/BayesTreeUnordered.h>
|
||||||
#include <gtsam/inference/BayesTreeCliqueBaseUnordered.h>
|
#include <gtsam/inference/BayesTreeCliqueBaseUnordered.h>
|
||||||
#include <gtsam/symbolic/SymbolicFactorGraphUnordered.h>
|
|
||||||
#include <gtsam/symbolic/SymbolicBayesNetUnordered.h>
|
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
|
// Forward declarations
|
||||||
|
class SymbolicFactorGraphUnordered;
|
||||||
|
class SymbolicBayesNetUnordered;
|
||||||
|
class SymbolicConditionalUnordered;
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
/// A clique in a SymbolicBayesTree
|
||||||
class GTSAM_EXPORT SymbolicBayesTreeCliqueUnordered :
|
class GTSAM_EXPORT SymbolicBayesTreeCliqueUnordered :
|
||||||
public BayesTreeCliqueBaseUnordered<SymbolicBayesTreeCliqueUnordered, SymbolicFactorGraphUnordered, SymbolicBayesNetUnordered>
|
public BayesTreeCliqueBaseUnordered<SymbolicBayesTreeCliqueUnordered, SymbolicFactorGraphUnordered, SymbolicBayesNetUnordered>
|
||||||
{
|
{
|
||||||
|
|
@ -35,10 +39,12 @@ namespace gtsam {
|
||||||
typedef boost::shared_ptr<This> shared_ptr;
|
typedef boost::shared_ptr<This> shared_ptr;
|
||||||
typedef boost::weak_ptr<This> weak_ptr;
|
typedef boost::weak_ptr<This> weak_ptr;
|
||||||
SymbolicBayesTreeCliqueUnordered() {}
|
SymbolicBayesTreeCliqueUnordered() {}
|
||||||
SymbolicBayesTreeCliqueUnordered(const SymbolicConditionalUnordered::shared_ptr& conditional) : Base(conditional) {}
|
SymbolicBayesTreeCliqueUnordered(const boost::shared_ptr<SymbolicConditionalUnordered>& conditional) : Base(conditional) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
/// A Bayes tree that represents the connectivity between variables but is not associated with any
|
||||||
|
/// probability functions.
|
||||||
class GTSAM_EXPORT SymbolicBayesTreeUnordered :
|
class GTSAM_EXPORT SymbolicBayesTreeUnordered :
|
||||||
public BayesTreeUnordered<SymbolicBayesTreeCliqueUnordered>
|
public BayesTreeUnordered<SymbolicBayesTreeCliqueUnordered>
|
||||||
{
|
{
|
||||||
|
|
@ -49,31 +55,8 @@ namespace gtsam {
|
||||||
typedef SymbolicBayesTreeUnordered This;
|
typedef SymbolicBayesTreeUnordered This;
|
||||||
typedef boost::shared_ptr<This> shared_ptr;
|
typedef boost::shared_ptr<This> shared_ptr;
|
||||||
|
|
||||||
/** Insert a new conditional */
|
|
||||||
//void insert(const sharedConditional& conditional);
|
|
||||||
|
|
||||||
/** check equality */
|
/** check equality */
|
||||||
bool equals(const This& other, double tol = 1e-9) const { return Base::equals(other, tol); }
|
bool equals(const This& other, double tol = 1e-9) const;
|
||||||
|
|
||||||
/** print */
|
|
||||||
void print(const std::string& s = "",
|
|
||||||
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const { Base::print(s, keyFormatter); }
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a conditional to the front of a clique, i.e. a conditional whose
|
|
||||||
* parents are already in the clique or its separators. This function does
|
|
||||||
* not check for this condition, it just updates the data structures.
|
|
||||||
*/
|
|
||||||
//void addToCliqueFront(const sharedConditional& conditional, const sharedClique& clique);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Dummy method to export class
|
|
||||||
void noop() const;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue