fixed print/headers

release/4.3a0
Frank Dellaert 2012-05-22 17:58:03 +00:00
parent 69e91e32b6
commit 67892e59e0
3 changed files with 17 additions and 13 deletions

View File

@ -37,7 +37,7 @@ namespace gtsam {
/* ************************************************************************* */ /* ************************************************************************* */
template<class CONDITIONAL> template<class CONDITIONAL>
void BayesNet<CONDITIONAL>::print(const string& s) const { void BayesNet<CONDITIONAL>::print(const string& s) const {
cout << s << ":\n"; cout << s;
BOOST_REVERSE_FOREACH(sharedConditional conditional,conditionals_) BOOST_REVERSE_FOREACH(sharedConditional conditional,conditionals_)
conditional->print(); conditional->print();
} }

View File

@ -18,8 +18,8 @@
#pragma once #pragma once
#include <list> #include <gtsam/nonlinear/Key.h>
#include <iostream>
#include <boost/mpl/char.hpp> #include <boost/mpl/char.hpp>
#include <boost/format.hpp> #include <boost/format.hpp>
#include <boost/serialization/nvp.hpp> #include <boost/serialization/nvp.hpp>
@ -28,7 +28,8 @@
#include <boost/lambda/construct.hpp> #include <boost/lambda/construct.hpp>
#include <boost/lambda/lambda.hpp> #include <boost/lambda/lambda.hpp>
#include <gtsam/nonlinear/Key.h> #include <list>
#include <iostream>
namespace gtsam { namespace gtsam {
@ -70,8 +71,8 @@ public:
j_ = key & indexMask; j_ = key & indexMask;
} }
/** Cast to integer */ /** return Key (integer) representation */
operator Key() const { Key key() const {
const size_t keyBits = sizeof(Key) * 8; const size_t keyBits = sizeof(Key) * 8;
const size_t chrBits = sizeof(unsigned char) * 8; const size_t chrBits = sizeof(unsigned char) * 8;
const size_t indexBits = keyBits - chrBits; const size_t indexBits = keyBits - chrBits;
@ -83,9 +84,12 @@ public:
return key; return key;
} }
/** Cast to integer */
operator Key() const { return key(); }
// Testable Requirements // Testable Requirements
void print(const std::string& s = "") const { void print(const std::string& s = "") const {
std::cout << s << ": " << (std::string) (*this) << std::endl; std::cout << s << (std::string) (*this) << std::endl;
} }
bool equals(const Symbol& expected, double tol = 0.0) const { bool equals(const Symbol& expected, double tol = 0.0) const {
return (*this) == expected; return (*this) == expected;

View File

@ -24,8 +24,10 @@
#pragma once #pragma once
#include <string> #include <gtsam/base/Value.h>
#include <utility> #include <gtsam/base/FastMap.h>
#include <gtsam/linear/VectorValues.h>
#include <gtsam/nonlinear/Ordering.h>
#include <boost/pool/pool_alloc.hpp> #include <boost/pool/pool_alloc.hpp>
#include <boost/ptr_container/ptr_map.hpp> #include <boost/ptr_container/ptr_map.hpp>
@ -37,10 +39,8 @@
#include <boost/iterator_adaptors.hpp> #include <boost/iterator_adaptors.hpp>
#include <boost/lambda/lambda.hpp> #include <boost/lambda/lambda.hpp>
#include <gtsam/base/Value.h> #include <string>
#include <gtsam/base/FastMap.h> #include <utility>
#include <gtsam/linear/VectorValues.h>
#include <gtsam/nonlinear/Ordering.h>
namespace gtsam { namespace gtsam {