Fix errors

release/4.3a0
Richard Roberts 2012-06-04 18:46:05 +00:00
parent 9c8377f476
commit 6b1e862688
6 changed files with 18 additions and 12 deletions

View File

@ -87,13 +87,13 @@ int main(int argc, char *argv[]) {
tic_("shared plain alloc, dealloc"); tic_("shared plain alloc, dealloc");
for(size_t i=0; i<trials; ++i) { for(size_t i=0; i<trials; ++i) {
shared_ptr<Plain> obj(new Plain(i)); boost::shared_ptr<Plain> obj(new Plain(i));
} }
toc_("shared plain alloc, dealloc"); toc_("shared plain alloc, dealloc");
tic_("shared virtual alloc, dealloc"); tic_("shared virtual alloc, dealloc");
for(size_t i=0; i<trials; ++i) { for(size_t i=0; i<trials; ++i) {
shared_ptr<Virtual> obj(new Virtual(i)); boost::shared_ptr<Virtual> obj(new Virtual(i));
} }
toc_("shared virtual alloc, dealloc"); toc_("shared virtual alloc, dealloc");
@ -130,14 +130,14 @@ int main(int argc, char *argv[]) {
tic_("shared plain alloc, dealloc, call"); tic_("shared plain alloc, dealloc, call");
for(size_t i=0; i<trials; ++i) { for(size_t i=0; i<trials; ++i) {
shared_ptr<Plain> obj(new Plain(i)); boost::shared_ptr<Plain> obj(new Plain(i));
obj->setData(i+1); obj->setData(i+1);
} }
toc_("shared plain alloc, dealloc, call"); toc_("shared plain alloc, dealloc, call");
tic_("shared virtual alloc, dealloc, call"); tic_("shared virtual alloc, dealloc, call");
for(size_t i=0; i<trials; ++i) { for(size_t i=0; i<trials; ++i) {
shared_ptr<Virtual> obj(new Virtual(i)); boost::shared_ptr<Virtual> obj(new Virtual(i));
obj->setData(i+1); obj->setData(i+1);
} }
toc_("shared virtual alloc, dealloc, call"); toc_("shared virtual alloc, dealloc, call");

View File

@ -82,6 +82,12 @@ using boost::math::isinf;
#ifndef M_PI #ifndef M_PI
#define M_PI (boost::math::constants::pi<double>()) #define M_PI (boost::math::constants::pi<double>())
#endif #endif
#ifndef M_PI_2
#define M_PI_2 (boost::math::constants::pi<double>() / 2.0)
#endif
#ifndef M_PI_4
#define M_PI_4 (boost::math::constants::pi<double>() / 4.0)
#endif
#endif #endif

View File

@ -119,6 +119,11 @@ namespace gtsam {
return p.vector(); return p.vector();
} }
/** The difference between another point and this point */
inline StereoPoint2 between(const StereoPoint2& p2) const {
return gtsam::between_default(*this, p2);
}
/// @} /// @}
/// @name Standard Interface /// @name Standard Interface
/// @{ /// @{
@ -133,11 +138,6 @@ namespace gtsam {
return Point2(uL_, v_); return Point2(uL_, v_);
} }
///TODO comment
inline StereoPoint2 between(const StereoPoint2& p2) const {
return gtsam::between_default(*this, p2);
}
private: private:
/// @} /// @}

View File

@ -66,7 +66,7 @@ TEST( Graph, predecessorMap2Graph )
p_map.insert(1, 2); p_map.insert(1, 2);
p_map.insert(2, 2); p_map.insert(2, 2);
p_map.insert(3, 2); p_map.insert(3, 2);
tie(graph, root, key2vertex) = predecessorMap2Graph<SGraph<Key>, SVertex, Key>(p_map); boost::tie(graph, root, key2vertex) = predecessorMap2Graph<SGraph<Key>, SVertex, Key>(p_map);
LONGS_EQUAL(3, boost::num_vertices(graph)); LONGS_EQUAL(3, boost::num_vertices(graph));
CHECK(root == key2vertex[2]); CHECK(root == key2vertex[2]);

View File

@ -44,7 +44,7 @@ int main(int argc, char *argv[]) {
else if (argc == 4) else if (argc == 4)
nrTrials = strtoul(argv[3], NULL, 10); nrTrials = strtoul(argv[3], NULL, 10);
pair<shared_ptr<pose2SLAM::Graph>, shared_ptr<Values> > data = load2D(dataset(datasetname)); pair<boost::shared_ptr<pose2SLAM::Graph>, boost::shared_ptr<Values> > data = load2D(dataset(datasetname));
// Add a prior on the first pose // Add a prior on the first pose
if (soft_prior) if (soft_prior)

View File

@ -44,7 +44,7 @@ int main(int argc, char *argv[]) {
else if (argc == 4) else if (argc == 4)
nrTrials = strtoul(argv[3], NULL, 10); nrTrials = strtoul(argv[3], NULL, 10);
pair<shared_ptr<pose2SLAM::Graph>, shared_ptr<Values> > data = load2D(dataset(datasetname)); pair<boost::shared_ptr<pose2SLAM::Graph>, boost::shared_ptr<Values> > data = load2D(dataset(datasetname));
// Add a prior on the first pose // Add a prior on the first pose
if (soft_prior) if (soft_prior)