commit
2c5be4de19
|
|
@ -55,6 +55,9 @@ namespace gtsam {
|
||||||
template<class DERIVEDCONDITIONAL>
|
template<class DERIVEDCONDITIONAL>
|
||||||
DiscreteBayesNet(const FactorGraph<DERIVEDCONDITIONAL>& graph) : Base(graph) {}
|
DiscreteBayesNet(const FactorGraph<DERIVEDCONDITIONAL>& graph) : Base(graph) {}
|
||||||
|
|
||||||
|
/// Destructor
|
||||||
|
virtual ~DiscreteBayesNet() {}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// @name Testable
|
/// @name Testable
|
||||||
|
|
|
||||||
|
|
@ -74,13 +74,14 @@ public:
|
||||||
/// @name Testable
|
/// @name Testable
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
// equals
|
/// equals
|
||||||
virtual bool equals(const DiscreteFactor& lf, double tol = 1e-9) const = 0;
|
virtual bool equals(const DiscreteFactor& lf, double tol = 1e-9) const = 0;
|
||||||
|
|
||||||
// print
|
/// print
|
||||||
virtual void print(const std::string& s = "DiscreteFactor\n",
|
void print(
|
||||||
const KeyFormatter& formatter = DefaultKeyFormatter) const {
|
const std::string& s = "DiscreteFactor\n",
|
||||||
Factor::print(s, formatter);
|
const KeyFormatter& formatter = DefaultKeyFormatter) const override {
|
||||||
|
Base::print(s, formatter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Test whether the factor is empty */
|
/** Test whether the factor is empty */
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,9 @@ public:
|
||||||
template<class DERIVEDFACTOR>
|
template<class DERIVEDFACTOR>
|
||||||
DiscreteFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
DiscreteFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
||||||
|
|
||||||
|
/// Destructor
|
||||||
|
virtual ~DiscreteFactorGraph() {}
|
||||||
|
|
||||||
/// @name Testable
|
/// @name Testable
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
|
|
@ -129,8 +132,9 @@ public:
|
||||||
double operator()(const DiscreteFactor::Values & values) const;
|
double operator()(const DiscreteFactor::Values & values) const;
|
||||||
|
|
||||||
/// print
|
/// print
|
||||||
void print(const std::string& s = "DiscreteFactorGraph",
|
void print(
|
||||||
const KeyFormatter& formatter =DefaultKeyFormatter) const;
|
const std::string& s = "DiscreteFactorGraph",
|
||||||
|
const KeyFormatter& formatter = DefaultKeyFormatter) const override;
|
||||||
|
|
||||||
/** Solve the factor graph by performing variable elimination in COLAMD order using
|
/** Solve the factor graph by performing variable elimination in COLAMD order using
|
||||||
* the dense elimination function specified in \c function,
|
* the dense elimination function specified in \c function,
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ public:
|
||||||
bool equals(const PinholeBase &camera, double tol = 1e-9) const;
|
bool equals(const PinholeBase &camera, double tol = 1e-9) const;
|
||||||
|
|
||||||
/// print
|
/// print
|
||||||
void print(const std::string& s = "PinholeBase") const;
|
virtual void print(const std::string& s = "PinholeBase") const;
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
/// @name Standard Interface
|
/// @name Standard Interface
|
||||||
|
|
@ -324,6 +324,11 @@ public:
|
||||||
/// Return canonical coordinate
|
/// Return canonical coordinate
|
||||||
Vector localCoordinates(const CalibratedCamera& T2) const;
|
Vector localCoordinates(const CalibratedCamera& T2) const;
|
||||||
|
|
||||||
|
/// print
|
||||||
|
void print(const std::string& s = "CalibratedCamera") const override {
|
||||||
|
PinholeBase::print(s);
|
||||||
|
}
|
||||||
|
|
||||||
/// @deprecated
|
/// @deprecated
|
||||||
inline size_t dim() const {
|
inline size_t dim() const {
|
||||||
return dimension;
|
return dimension;
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/// print
|
/// print
|
||||||
void print(const std::string& s = "PinholeCamera") const {
|
void print(const std::string& s = "PinholeCamera") const override {
|
||||||
Base::print(s);
|
Base::print(s);
|
||||||
K_.print(s + ".calibration");
|
K_.print(s + ".calibration");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -340,7 +340,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/// print
|
/// print
|
||||||
void print(const std::string& s = "PinholePose") const {
|
void print(const std::string& s = "PinholePose") const override {
|
||||||
Base::print(s);
|
Base::print(s);
|
||||||
if (!K_)
|
if (!K_)
|
||||||
std::cout << "s No calibration given" << std::endl;
|
std::cout << "s No calibration given" << std::endl;
|
||||||
|
|
|
||||||
|
|
@ -986,7 +986,7 @@ class CalibratedCamera {
|
||||||
static gtsam::CalibratedCamera Level(const gtsam::Pose2& pose2, double height);
|
static gtsam::CalibratedCamera Level(const gtsam::Pose2& pose2, double height);
|
||||||
|
|
||||||
// Testable
|
// Testable
|
||||||
void print(string s = "") const;
|
void print(string s = "CalibratedCamera") const;
|
||||||
bool equals(const gtsam::CalibratedCamera& camera, double tol) const;
|
bool equals(const gtsam::CalibratedCamera& camera, double tol) const;
|
||||||
|
|
||||||
// Manifold
|
// Manifold
|
||||||
|
|
@ -1163,7 +1163,8 @@ virtual class SymbolicFactor {
|
||||||
|
|
||||||
// From Factor
|
// From Factor
|
||||||
size_t size() const;
|
size_t size() const;
|
||||||
void print(string s = "", const gtsam::KeyFormatter& keyFormatter =
|
void print(string s = "SymbolicFactor",
|
||||||
|
const gtsam::KeyFormatter& keyFormatter =
|
||||||
gtsam::DefaultKeyFormatter) const;
|
gtsam::DefaultKeyFormatter) const;
|
||||||
bool equals(const gtsam::SymbolicFactor& other, double tol) const;
|
bool equals(const gtsam::SymbolicFactor& other, double tol) const;
|
||||||
gtsam::KeyVector keys();
|
gtsam::KeyVector keys();
|
||||||
|
|
@ -1177,7 +1178,8 @@ virtual class SymbolicFactorGraph {
|
||||||
|
|
||||||
// From FactorGraph
|
// From FactorGraph
|
||||||
void push_back(gtsam::SymbolicFactor* factor);
|
void push_back(gtsam::SymbolicFactor* factor);
|
||||||
void print(string s = "", const gtsam::KeyFormatter& keyFormatter =
|
void print(string s = "SymbolicFactorGraph",
|
||||||
|
const gtsam::KeyFormatter& keyFormatter =
|
||||||
gtsam::DefaultKeyFormatter) const;
|
gtsam::DefaultKeyFormatter) const;
|
||||||
bool equals(const gtsam::SymbolicFactorGraph& rhs, double tol) const;
|
bool equals(const gtsam::SymbolicFactorGraph& rhs, double tol) const;
|
||||||
size_t size() const;
|
size_t size() const;
|
||||||
|
|
@ -1242,7 +1244,8 @@ class SymbolicBayesNet {
|
||||||
SymbolicBayesNet();
|
SymbolicBayesNet();
|
||||||
SymbolicBayesNet(const gtsam::SymbolicBayesNet& other);
|
SymbolicBayesNet(const gtsam::SymbolicBayesNet& other);
|
||||||
// Testable
|
// Testable
|
||||||
void print(string s = "", const gtsam::KeyFormatter& keyFormatter =
|
void print(string s = "SymbolicBayesNet",
|
||||||
|
const gtsam::KeyFormatter& keyFormatter =
|
||||||
gtsam::DefaultKeyFormatter) const;
|
gtsam::DefaultKeyFormatter) const;
|
||||||
bool equals(const gtsam::SymbolicBayesNet& other, double tol) const;
|
bool equals(const gtsam::SymbolicBayesNet& other, double tol) const;
|
||||||
|
|
||||||
|
|
@ -2097,7 +2100,8 @@ class NonlinearFactorGraph {
|
||||||
NonlinearFactorGraph(const gtsam::NonlinearFactorGraph& graph);
|
NonlinearFactorGraph(const gtsam::NonlinearFactorGraph& graph);
|
||||||
|
|
||||||
// FactorGraph
|
// FactorGraph
|
||||||
void print(string s = "", const gtsam::KeyFormatter& keyFormatter =
|
void print(string s = "NonlinearFactorGraph: ",
|
||||||
|
const gtsam::KeyFormatter& keyFormatter =
|
||||||
gtsam::DefaultKeyFormatter) const;
|
gtsam::DefaultKeyFormatter) const;
|
||||||
bool equals(const gtsam::NonlinearFactorGraph& fg, double tol) const;
|
bool equals(const gtsam::NonlinearFactorGraph& fg, double tol) const;
|
||||||
size_t size() const;
|
size_t size() const;
|
||||||
|
|
|
||||||
|
|
@ -28,15 +28,15 @@ namespace gtsam {
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
template <class CONDITIONAL>
|
template <class CONDITIONAL>
|
||||||
void BayesNet<CONDITIONAL>::print(const std::string& s, const KeyFormatter& formatter) const
|
void BayesNet<CONDITIONAL>::print(
|
||||||
{
|
const std::string& s, const KeyFormatter& formatter) const {
|
||||||
Base::print(s, formatter);
|
Base::print(s, formatter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
template <class CONDITIONAL>
|
template <class CONDITIONAL>
|
||||||
void BayesNet<CONDITIONAL>::saveGraph(const std::string &s, const KeyFormatter& keyFormatter) const
|
void BayesNet<CONDITIONAL>::saveGraph(const std::string& s,
|
||||||
{
|
const KeyFormatter& keyFormatter) const {
|
||||||
std::ofstream of(s.c_str());
|
std::ofstream of(s.c_str());
|
||||||
of << "digraph G{\n";
|
of << "digraph G{\n";
|
||||||
|
|
||||||
|
|
@ -52,4 +52,4 @@ namespace gtsam {
|
||||||
of.close();
|
of.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace gtsam
|
||||||
|
|
|
||||||
|
|
@ -58,15 +58,17 @@ namespace gtsam {
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/** print out graph */
|
/** print out graph */
|
||||||
void print(const std::string& s = "BayesNet",
|
void print(
|
||||||
const KeyFormatter& formatter = DefaultKeyFormatter) const;
|
const std::string& s = "BayesNet",
|
||||||
|
const KeyFormatter& formatter = DefaultKeyFormatter) const override;
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// @name Standard Interface
|
/// @name Standard Interface
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
void saveGraph(const std::string &s, const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
|
void saveGraph(const std::string& s,
|
||||||
|
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ namespace gtsam {
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
void Factor::printKeys(const std::string& s, const KeyFormatter& formatter) const {
|
void Factor::printKeys(const std::string& s, const KeyFormatter& formatter) const {
|
||||||
std::cout << s << " ";
|
std::cout << (s.empty() ? "" : s + " ");
|
||||||
for (Key key : keys_) std::cout << " " << formatter(key);
|
for (Key key : keys_) std::cout << " " << formatter(key);
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -135,10 +135,14 @@ typedef FastSet<FactorIndex> FactorIndexSet;
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/// print
|
/// print
|
||||||
void print(const std::string& s = "Factor", const KeyFormatter& formatter = DefaultKeyFormatter) const;
|
virtual void print(
|
||||||
|
const std::string& s = "Factor",
|
||||||
|
const KeyFormatter& formatter = DefaultKeyFormatter) const;
|
||||||
|
|
||||||
/// print only keys
|
/// print only keys
|
||||||
void printKeys(const std::string& s = "Factor", const KeyFormatter& formatter = DefaultKeyFormatter) const;
|
virtual void printKeys(
|
||||||
|
const std::string& s = "Factor",
|
||||||
|
const KeyFormatter& formatter = DefaultKeyFormatter) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// check equality
|
/// check equality
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ namespace gtsam {
|
||||||
template <class FACTOR>
|
template <class FACTOR>
|
||||||
void FactorGraph<FACTOR>::print(const std::string& s,
|
void FactorGraph<FACTOR>::print(const std::string& s,
|
||||||
const KeyFormatter& formatter) const {
|
const KeyFormatter& formatter) const {
|
||||||
std::cout << s << std::endl;
|
std::cout << (s.empty() ? "" : s + " ") << std::endl;
|
||||||
std::cout << "size: " << size() << std::endl;
|
std::cout << "size: " << size() << std::endl;
|
||||||
for (size_t i = 0; i < factors_.size(); i++) {
|
for (size_t i = 0; i < factors_.size(); i++) {
|
||||||
std::stringstream ss;
|
std::stringstream ss;
|
||||||
|
|
|
||||||
|
|
@ -285,8 +285,8 @@ class FactorGraph {
|
||||||
/// @name Testable
|
/// @name Testable
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/** print out graph */
|
/// print out graph
|
||||||
void print(const std::string& s = "FactorGraph",
|
virtual void print(const std::string& s = "FactorGraph",
|
||||||
const KeyFormatter& formatter = DefaultKeyFormatter) const;
|
const KeyFormatter& formatter = DefaultKeyFormatter) const;
|
||||||
|
|
||||||
/** Check equality */
|
/** Check equality */
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,9 @@ namespace gtsam {
|
||||||
template<class DERIVEDCONDITIONAL>
|
template<class DERIVEDCONDITIONAL>
|
||||||
GaussianBayesNet(const FactorGraph<DERIVEDCONDITIONAL>& graph) : Base(graph) {}
|
GaussianBayesNet(const FactorGraph<DERIVEDCONDITIONAL>& graph) : Base(graph) {}
|
||||||
|
|
||||||
|
/// Destructor
|
||||||
|
virtual ~GaussianBayesNet() {}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// @name Testable
|
/// @name Testable
|
||||||
|
|
@ -177,6 +180,13 @@ namespace gtsam {
|
||||||
*/
|
*/
|
||||||
VectorValues backSubstituteTranspose(const VectorValues& gx) const;
|
VectorValues backSubstituteTranspose(const VectorValues& gx) const;
|
||||||
|
|
||||||
|
/// print graph
|
||||||
|
void print(
|
||||||
|
const std::string& s = "",
|
||||||
|
const KeyFormatter& formatter = DefaultKeyFormatter) const override {
|
||||||
|
Base::print(s, formatter);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Save the GaussianBayesNet as an image. Requires `dot` to be
|
* @brief Save the GaussianBayesNet as an image. Requires `dot` to be
|
||||||
* installed.
|
* installed.
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,11 @@ namespace gtsam {
|
||||||
virtual ~GaussianFactor() {}
|
virtual ~GaussianFactor() {}
|
||||||
|
|
||||||
// Implementing Testable interface
|
// Implementing Testable interface
|
||||||
virtual void print(const std::string& s = "",
|
|
||||||
const KeyFormatter& formatter = DefaultKeyFormatter) const = 0;
|
/// print
|
||||||
|
void print(
|
||||||
|
const std::string& s = "",
|
||||||
|
const KeyFormatter& formatter = DefaultKeyFormatter) const override = 0;
|
||||||
|
|
||||||
/** Equals for testable */
|
/** Equals for testable */
|
||||||
virtual bool equals(const GaussianFactor& lf, double tol = 1e-9) const = 0;
|
virtual bool equals(const GaussianFactor& lf, double tol = 1e-9) const = 0;
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,8 @@ Vector AttitudeFactor::attitudeError(const Rot3& nRb,
|
||||||
//***************************************************************************
|
//***************************************************************************
|
||||||
void Rot3AttitudeFactor::print(const string& s,
|
void Rot3AttitudeFactor::print(const string& s,
|
||||||
const KeyFormatter& keyFormatter) const {
|
const KeyFormatter& keyFormatter) const {
|
||||||
cout << s << "Rot3AttitudeFactor on " << keyFormatter(this->key()) << "\n";
|
cout << (s.empty() ? "" : s + " ") << "Rot3AttitudeFactor on "
|
||||||
|
<< keyFormatter(this->key()) << "\n";
|
||||||
nZ_.print(" measured direction in nav frame: ");
|
nZ_.print(" measured direction in nav frame: ");
|
||||||
bRef_.print(" reference direction in body frame: ");
|
bRef_.print(" reference direction in body frame: ");
|
||||||
this->noiseModel_->print(" noise model: ");
|
this->noiseModel_->print(" noise model: ");
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/** print */
|
/** print */
|
||||||
void print(const std::string& s, const KeyFormatter& keyFormatter =
|
void print(const std::string& s = "", const KeyFormatter& keyFormatter =
|
||||||
DefaultKeyFormatter) const override;
|
DefaultKeyFormatter) const override;
|
||||||
|
|
||||||
/** equals */
|
/** equals */
|
||||||
|
|
@ -188,7 +188,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/** print */
|
/** print */
|
||||||
void print(const std::string& s, const KeyFormatter& keyFormatter =
|
void print(const std::string& s = "", const KeyFormatter& keyFormatter =
|
||||||
DefaultKeyFormatter) const override;
|
DefaultKeyFormatter) const override;
|
||||||
|
|
||||||
/** equals */
|
/** equals */
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,8 @@ namespace gtsam {
|
||||||
|
|
||||||
//***************************************************************************
|
//***************************************************************************
|
||||||
void GPSFactor::print(const string& s, const KeyFormatter& keyFormatter) const {
|
void GPSFactor::print(const string& s, const KeyFormatter& keyFormatter) const {
|
||||||
cout << s << "GPSFactor on " << keyFormatter(key()) << "\n";
|
cout << (s.empty() ? "" : s + " ") << "GPSFactor on " << keyFormatter(key())
|
||||||
|
<< "\n";
|
||||||
cout << " GPS measurement: " << nT_ << "\n";
|
cout << " GPS measurement: " << nT_ << "\n";
|
||||||
noiseModel_->print(" noise model: ");
|
noiseModel_->print(" noise model: ");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/// print
|
/// print
|
||||||
void print(const std::string& s, const KeyFormatter& keyFormatter =
|
void print(const std::string& s = "", const KeyFormatter& keyFormatter =
|
||||||
DefaultKeyFormatter) const override;
|
DefaultKeyFormatter) const override;
|
||||||
|
|
||||||
/// equals
|
/// equals
|
||||||
|
|
@ -143,7 +143,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
/// print
|
/// print
|
||||||
void print(const std::string& s, const KeyFormatter& keyFormatter =
|
void print(const std::string& s = "", const KeyFormatter& keyFormatter =
|
||||||
DefaultKeyFormatter) const override;
|
DefaultKeyFormatter) const override;
|
||||||
|
|
||||||
/// equals
|
/// equals
|
||||||
|
|
|
||||||
|
|
@ -70,8 +70,8 @@ public:
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
/** print */
|
/** print */
|
||||||
virtual void print(const std::string& s = "",
|
void print(const std::string& s = "", const KeyFormatter& keyFormatter =
|
||||||
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
|
DefaultKeyFormatter) const override;
|
||||||
|
|
||||||
/** Check if two factors are equal */
|
/** Check if two factors are equal */
|
||||||
virtual bool equals(const NonlinearFactor& f, double tol = 1e-9) const;
|
virtual bool equals(const NonlinearFactor& f, double tol = 1e-9) const;
|
||||||
|
|
|
||||||
|
|
@ -98,9 +98,13 @@ namespace gtsam {
|
||||||
template<class DERIVEDFACTOR>
|
template<class DERIVEDFACTOR>
|
||||||
NonlinearFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
NonlinearFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
||||||
|
|
||||||
|
/// Destructor
|
||||||
|
virtual ~NonlinearFactorGraph() {}
|
||||||
|
|
||||||
/** print */
|
/** print */
|
||||||
void print(const std::string& str = "NonlinearFactorGraph: ",
|
void print(
|
||||||
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
|
const std::string& str = "NonlinearFactorGraph: ",
|
||||||
|
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const override;
|
||||||
|
|
||||||
/** print errors along with factors*/
|
/** print errors along with factors*/
|
||||||
void printErrors(const Values& values, const std::string& str = "NonlinearFactorGraph: ",
|
void printErrors(const Values& values, const std::string& str = "NonlinearFactorGraph: ",
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,9 @@ private:
|
||||||
measured_(measured),
|
measured_(measured),
|
||||||
noiseModel_(model) {}
|
noiseModel_(model) {}
|
||||||
|
|
||||||
|
/// Destructor
|
||||||
|
virtual ~BinaryMeasurement() {}
|
||||||
|
|
||||||
/// @name Standard Interface
|
/// @name Standard Interface
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
|
|
@ -64,8 +67,8 @@ private:
|
||||||
/// @name Testable
|
/// @name Testable
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
void print(const std::string &s,
|
void print(const std::string &s, const KeyFormatter &keyFormatter =
|
||||||
const KeyFormatter &keyFormatter = DefaultKeyFormatter) const {
|
DefaultKeyFormatter) const override {
|
||||||
std::cout << s << "BinaryMeasurement(" << keyFormatter(this->key1()) << ","
|
std::cout << s << "BinaryMeasurement(" << keyFormatter(this->key1()) << ","
|
||||||
<< keyFormatter(this->key2()) << ")\n";
|
<< keyFormatter(this->key2()) << ")\n";
|
||||||
traits<T>::Print(measured_, " measured: ");
|
traits<T>::Print(measured_, " measured: ");
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,9 @@ namespace gtsam {
|
||||||
template<class DERIVEDCONDITIONAL>
|
template<class DERIVEDCONDITIONAL>
|
||||||
SymbolicBayesNet(const FactorGraph<DERIVEDCONDITIONAL>& graph) : Base(graph) {}
|
SymbolicBayesNet(const FactorGraph<DERIVEDCONDITIONAL>& graph) : Base(graph) {}
|
||||||
|
|
||||||
|
/// Destructor
|
||||||
|
virtual ~SymbolicBayesNet() {}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// @name Testable
|
/// @name Testable
|
||||||
|
|
@ -63,6 +66,13 @@ namespace gtsam {
|
||||||
/** Check equality */
|
/** Check equality */
|
||||||
GTSAM_EXPORT bool equals(const This& bn, double tol = 1e-9) const;
|
GTSAM_EXPORT bool equals(const This& bn, double tol = 1e-9) const;
|
||||||
|
|
||||||
|
/// print
|
||||||
|
GTSAM_EXPORT void print(
|
||||||
|
const std::string& s = "SymbolicBayesNet",
|
||||||
|
const KeyFormatter& formatter = DefaultKeyFormatter) const override {
|
||||||
|
Base::print(s, formatter);
|
||||||
|
}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// @name Standard Interface
|
/// @name Standard Interface
|
||||||
|
|
|
||||||
|
|
@ -23,15 +23,14 @@ namespace gtsam {
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
void SymbolicConditional::print(const std::string& str, const KeyFormatter& keyFormatter) const
|
void SymbolicConditional::print(const std::string& str,
|
||||||
{
|
const KeyFormatter& keyFormatter) const {
|
||||||
BaseConditional::print(str, keyFormatter);
|
BaseConditional::print(str, keyFormatter);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
bool SymbolicConditional::equals(const This& c, double tol) const
|
bool SymbolicConditional::equals(const This& c, double tol) const {
|
||||||
{
|
|
||||||
return BaseFactor::equals(c) && BaseConditional::equals(c);
|
return BaseFactor::equals(c) && BaseConditional::equals(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
} // namespace gtsam
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,9 @@ namespace gtsam {
|
||||||
/// @name Testable
|
/// @name Testable
|
||||||
|
|
||||||
/** Print with optional formatter */
|
/** Print with optional formatter */
|
||||||
virtual void print(const std::string& str = "", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
|
void print(
|
||||||
|
const std::string& str = "",
|
||||||
|
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const override;
|
||||||
|
|
||||||
/** Check equality */
|
/** Check equality */
|
||||||
bool equals(const This& c, double tol = 1e-9) const;
|
bool equals(const This& c, double tol = 1e-9) const;
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,20 @@ namespace gtsam {
|
||||||
|
|
||||||
bool equals(const This& other, double tol = 1e-9) const;
|
bool equals(const This& other, double tol = 1e-9) const;
|
||||||
|
|
||||||
|
/// print
|
||||||
|
void print(
|
||||||
|
const std::string& s = "SymbolicFactor",
|
||||||
|
const KeyFormatter& formatter = DefaultKeyFormatter) const override {
|
||||||
|
Base::print(s, formatter);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// print only keys
|
||||||
|
void printKeys(
|
||||||
|
const std::string& s = "SymbolicFactor",
|
||||||
|
const KeyFormatter& formatter = DefaultKeyFormatter) const override {
|
||||||
|
Base::printKeys(s, formatter);
|
||||||
|
}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// @name Advanced Constructors
|
/// @name Advanced Constructors
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,9 @@ namespace gtsam {
|
||||||
template<class DERIVEDFACTOR>
|
template<class DERIVEDFACTOR>
|
||||||
SymbolicFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
SymbolicFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
||||||
|
|
||||||
|
/// Destructor
|
||||||
|
virtual ~SymbolicFactorGraph() {}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// @name Testable
|
/// @name Testable
|
||||||
|
|
@ -88,6 +91,13 @@ namespace gtsam {
|
||||||
|
|
||||||
bool equals(const This& fg, double tol = 1e-9) const;
|
bool equals(const This& fg, double tol = 1e-9) const;
|
||||||
|
|
||||||
|
/// print
|
||||||
|
void print(
|
||||||
|
const std::string& s = "SymbolicFactorGraph",
|
||||||
|
const KeyFormatter& formatter = DefaultKeyFormatter) const override {
|
||||||
|
Base::print(s, formatter);
|
||||||
|
}
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// @name Standard Interface
|
/// @name Standard Interface
|
||||||
|
|
|
||||||
|
|
@ -178,8 +178,7 @@ namespace gtsam {
|
||||||
} // buildGraph
|
} // buildGraph
|
||||||
|
|
||||||
/** print */
|
/** print */
|
||||||
void Scheduler::print(const string& s) const {
|
void Scheduler::print(const string& s, const KeyFormatter& formatter) const {
|
||||||
|
|
||||||
cout << s << " Faculty:" << endl;
|
cout << s << " Faculty:" << endl;
|
||||||
for(const string& name: facultyName_)
|
for(const string& name: facultyName_)
|
||||||
cout << name << '\n';
|
cout << name << '\n';
|
||||||
|
|
|
||||||
|
|
@ -66,11 +66,13 @@ namespace gtsam {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* WE need to know the number of students in advance for ordering keys.
|
* We need to know the number of students in advance for ordering keys.
|
||||||
* then add faculty, slots, areas, availability, students, in that order
|
* then add faculty, slots, areas, availability, students, in that order
|
||||||
*/
|
*/
|
||||||
Scheduler(size_t maxNrStudents):maxNrStudents_(maxNrStudents) {
|
Scheduler(size_t maxNrStudents) : maxNrStudents_(maxNrStudents) {}
|
||||||
}
|
|
||||||
|
/// Destructor
|
||||||
|
virtual ~Scheduler() {}
|
||||||
|
|
||||||
void addFaculty(const std::string& facultyName) {
|
void addFaculty(const std::string& facultyName) {
|
||||||
facultyIndex_[facultyName] = nrFaculty();
|
facultyIndex_[facultyName] = nrFaculty();
|
||||||
|
|
@ -140,7 +142,9 @@ namespace gtsam {
|
||||||
void buildGraph(size_t mutexBound = 7);
|
void buildGraph(size_t mutexBound = 7);
|
||||||
|
|
||||||
/** print */
|
/** print */
|
||||||
void print(const std::string& s = "Scheduler") const;
|
void print(
|
||||||
|
const std::string& s = "Scheduler",
|
||||||
|
const KeyFormatter& formatter = DefaultKeyFormatter) const override;
|
||||||
|
|
||||||
/** Print readable form of assignment */
|
/** Print readable form of assignment */
|
||||||
void printAssignment(sharedValues assignment) const;
|
void printAssignment(sharedValues assignment) const;
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,9 @@ public:
|
||||||
typedef boost::shared_ptr<InequalityFactorGraph> shared_ptr;
|
typedef boost::shared_ptr<InequalityFactorGraph> shared_ptr;
|
||||||
|
|
||||||
/** print */
|
/** print */
|
||||||
void print(const std::string& str, const KeyFormatter& keyFormatter =
|
void print(
|
||||||
DefaultKeyFormatter) const {
|
const std::string& str = "",
|
||||||
|
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const override {
|
||||||
Base::print(str, keyFormatter);
|
Base::print(str, keyFormatter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,9 @@ public:
|
||||||
virtual ~ConcurrentFilter() {};
|
virtual ~ConcurrentFilter() {};
|
||||||
|
|
||||||
/** Implement a standard 'print' function */
|
/** Implement a standard 'print' function */
|
||||||
virtual void print(const std::string& s = "Concurrent Filter:\n", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const = 0;
|
virtual void print(
|
||||||
|
const std::string& s = "Concurrent Filter:\n",
|
||||||
|
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const = 0;
|
||||||
|
|
||||||
/** Check if two Concurrent Smoothers are equal */
|
/** Check if two Concurrent Smoothers are equal */
|
||||||
virtual bool equals(const ConcurrentFilter& rhs, double tol = 1e-9) const = 0;
|
virtual bool equals(const ConcurrentFilter& rhs, double tol = 1e-9) const = 0;
|
||||||
|
|
@ -107,7 +109,9 @@ public:
|
||||||
virtual ~ConcurrentSmoother() {};
|
virtual ~ConcurrentSmoother() {};
|
||||||
|
|
||||||
/** Implement a standard 'print' function */
|
/** Implement a standard 'print' function */
|
||||||
virtual void print(const std::string& s = "Concurrent Smoother:\n", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const = 0;
|
virtual void print(
|
||||||
|
const std::string& s = "Concurrent Smoother:\n",
|
||||||
|
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const = 0;
|
||||||
|
|
||||||
/** Check if two Concurrent Smoothers are equal */
|
/** Check if two Concurrent Smoothers are equal */
|
||||||
virtual bool equals(const ConcurrentSmoother& rhs, double tol = 1e-9) const = 0;
|
virtual bool equals(const ConcurrentSmoother& rhs, double tol = 1e-9) const = 0;
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,9 @@ public:
|
||||||
virtual ~FixedLagSmoother() { }
|
virtual ~FixedLagSmoother() { }
|
||||||
|
|
||||||
/** Print the factor for debugging and testing (implementing Testable) */
|
/** Print the factor for debugging and testing (implementing Testable) */
|
||||||
virtual void print(const std::string& s = "FixedLagSmoother:\n", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
|
virtual void print(
|
||||||
|
const std::string& s = "FixedLagSmoother:\n",
|
||||||
|
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
|
||||||
|
|
||||||
/** Check if two IncrementalFixedLagSmoother Objects are equal */
|
/** Check if two IncrementalFixedLagSmoother Objects are equal */
|
||||||
virtual bool equals(const FixedLagSmoother& rhs, double tol = 1e-9) const;
|
virtual bool equals(const FixedLagSmoother& rhs, double tol = 1e-9) const;
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,9 @@ public:
|
||||||
/** implement functions needed for Testable */
|
/** implement functions needed for Testable */
|
||||||
|
|
||||||
/** print */
|
/** print */
|
||||||
virtual void print(const std::string& s = "EquivInertialNavFactor_GlobalVel_NoBias", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const {
|
virtual void print(
|
||||||
|
const std::string& s = "EquivInertialNavFactor_GlobalVel_NoBias",
|
||||||
|
const KeyFormatter& keyFormatter = DefaultKeyFormatter) const {
|
||||||
std::cout << s << "("
|
std::cout << s << "("
|
||||||
<< keyFormatter(this->key1()) << ","
|
<< keyFormatter(this->key1()) << ","
|
||||||
<< keyFormatter(this->key2()) << ","
|
<< keyFormatter(this->key2()) << ","
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue