Cleanups in BayesTree and SymbolicBayesTree

release/4.3a0
Richard Roberts 2013-07-02 14:54:20 +00:00
parent 4fa8332c77
commit 79ce96dceb
3 changed files with 21 additions and 43 deletions

View File

@ -93,8 +93,6 @@ namespace gtsam {
/** Root cliques */
std::vector<sharedClique> roots_;
public:
/// @name Standard Constructors
/// @{
@ -104,32 +102,26 @@ namespace gtsam {
/** Copy constructor */
BayesTreeUnordered(const This& other);
protected:
/** Assignment operator */
This& operator=(const This& other);
public:
/// @}
/// @name Advanced Constructors
/// @{
/** Destructor */
virtual ~BayesTreeUnordered() {}
/// @}
/** Assignment operator */
This& operator=(const This& other);
/// @name Testable
/// @{
protected:
/** check equality */
bool equals(const This& other, double tol = 1e-9) const;
public:
/** print */
void print(const std::string& s = "",
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
public:
/// @}
/// @name Standard Interface
/// @{

View File

@ -19,13 +19,16 @@
#include <boost/foreach.hpp>
#include <gtsam/symbolic/SymbolicBayesTreeUnordered.h>
#include <gtsam/symbolic/SymbolicFactorGraphUnordered.h>
#include <gtsam/symbolic/SymbolicBayesNetUnordered.h>
#include <gtsam/inference/BayesTreeUnordered-inst.h>
#include <gtsam/inference/BayesTreeCliqueBaseUnordered-inst.h>
namespace gtsam {
void SymbolicBayesTreeUnordered::noop() const {
bool SymbolicBayesTreeUnordered::equals(const This& other, double tol /* = 1e-9 */) const
{
return Base::equals(other, tol);
}
// /* ************************************************************************* */

View File

@ -20,12 +20,16 @@
#include <gtsam/inference/BayesTreeUnordered.h>
#include <gtsam/inference/BayesTreeCliqueBaseUnordered.h>
#include <gtsam/symbolic/SymbolicFactorGraphUnordered.h>
#include <gtsam/symbolic/SymbolicBayesNetUnordered.h>
namespace gtsam {
// Forward declarations
class SymbolicFactorGraphUnordered;
class SymbolicBayesNetUnordered;
class SymbolicConditionalUnordered;
/* ************************************************************************* */
/// A clique in a SymbolicBayesTree
class GTSAM_EXPORT SymbolicBayesTreeCliqueUnordered :
public BayesTreeCliqueBaseUnordered<SymbolicBayesTreeCliqueUnordered, SymbolicFactorGraphUnordered, SymbolicBayesNetUnordered>
{
@ -35,10 +39,12 @@ namespace gtsam {
typedef boost::shared_ptr<This> shared_ptr;
typedef boost::weak_ptr<This> weak_ptr;
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 :
public BayesTreeUnordered<SymbolicBayesTreeCliqueUnordered>
{
@ -49,31 +55,8 @@ namespace gtsam {
typedef SymbolicBayesTreeUnordered This;
typedef boost::shared_ptr<This> shared_ptr;
/** Insert a new conditional */
//void insert(const sharedConditional& conditional);
/** check equality */
bool equals(const This& other, double tol = 1e-9) const { return Base::equals(other, tol); }
/** 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;
bool equals(const This& other, double tol = 1e-9) const;
};
}