diff --git a/gtsam/base/types.h b/gtsam/base/types.h index 108c21ce0..0488c15c0 100644 --- a/gtsam/base/types.h +++ b/gtsam/base/types.h @@ -202,7 +202,7 @@ namespace gtsam { { public: /// Construct with a string describing the exception - RuntimeErrorThreadsafe(const std::string& description) : ThreadsafeException(description) {} + RuntimeErrorThreadsafe(const std::string& description) : ThreadsafeException(description) {} }; /* ************************************************************************* */ @@ -211,7 +211,7 @@ namespace gtsam { { public: /// Construct with a string describing the exception - OutOfRangeThreadsafe(const std::string& description) : ThreadsafeException(description) {} + OutOfRangeThreadsafe(const std::string& description) : ThreadsafeException(description) {} }; /* ************************************************************************* */ @@ -220,7 +220,7 @@ namespace gtsam { { public: /// Construct with a string describing the exception - InvalidArgumentThreadsafe(const std::string& description) : ThreadsafeException(description) {} + InvalidArgumentThreadsafe(const std::string& description) : ThreadsafeException(description) {} }; } diff --git a/gtsam/geometry/CalibratedCamera.h b/gtsam/geometry/CalibratedCamera.h index 495d928cf..91dfad1e8 100644 --- a/gtsam/geometry/CalibratedCamera.h +++ b/gtsam/geometry/CalibratedCamera.h @@ -26,7 +26,7 @@ namespace gtsam { class GTSAM_EXPORT CheiralityException: public ThreadsafeException { public: - CheiralityException() : ThreadsafeException("Cheirality Exception") {} + CheiralityException() : ThreadsafeException("Cheirality Exception") {} }; /** diff --git a/gtsam/inference/JunctionTree-inst.h b/gtsam/inference/JunctionTree-inst.h index 5f50763fb..99e11084a 100644 --- a/gtsam/inference/JunctionTree-inst.h +++ b/gtsam/inference/JunctionTree-inst.h @@ -239,8 +239,7 @@ namespace gtsam { /* ************************************************************************* */ template template - JunctionTree - JunctionTree::FromEliminationTree(const ETREE& eliminationTree) + JunctionTree::JunctionTree(const ETREE& eliminationTree) { gttic(JunctionTree_FromEliminationTree); // Here we rely on the BayesNet having been produced by this elimination tree, such that the @@ -258,13 +257,10 @@ namespace gtsam { ConstructorTraversalVisitorPre, ConstructorTraversalVisitorPost); // Assign roots from the dummy node - This result; - result.roots_ = rootData.myJTNode->children; + roots_ = rootData.myJTNode->children; // Transfer remaining factors from elimination tree - result.remainingFactors_ = eliminationTree.remainingFactors(); - - return result; + remainingFactors_ = eliminationTree.remainingFactors(); } /* ************************************************************************* */ diff --git a/gtsam/inference/JunctionTree.h b/gtsam/inference/JunctionTree.h index f07e52a31..987bfa205 100644 --- a/gtsam/inference/JunctionTree.h +++ b/gtsam/inference/JunctionTree.h @@ -94,7 +94,11 @@ namespace gtsam { /** Build the junction tree from an elimination tree. */ template - static This FromEliminationTree(const ETREE& eliminationTree); + static This FromEliminationTree(const ETREE& eliminationTree) { return This(eliminationTree); } + + /** Build the junction tree from an elimination tree. */ + template + JunctionTree(const ETREE& eliminationTree); /** Copy constructor - makes a deep copy of the tree structure, but only pointers to factors are * copied, factors are not cloned. */ diff --git a/gtsam/inference/VariableSlots.h b/gtsam/inference/VariableSlots.h index 4e23615bc..e986b6194 100644 --- a/gtsam/inference/VariableSlots.h +++ b/gtsam/inference/VariableSlots.h @@ -106,7 +106,7 @@ VariableSlots::VariableSlots(const FG& factorGraph) // the array entry for each factor that will indicate the factor // does not involve the variable. iterator thisVarSlots; bool inserted; - boost::tie(thisVarSlots, inserted) = this->insert(make_pair(involvedVariable, FastVector())); + boost::tie(thisVarSlots, inserted) = this->insert(std::make_pair(involvedVariable, FastVector())); if(inserted) thisVarSlots->second.resize(factorGraph.size(), std::numeric_limits::max()); thisVarSlots->second[jointFactorPos] = factorVarSlot; diff --git a/gtsam/linear/GaussianJunctionTree.cpp b/gtsam/linear/GaussianJunctionTree.cpp index 182375925..17549d381 100644 --- a/gtsam/linear/GaussianJunctionTree.cpp +++ b/gtsam/linear/GaussianJunctionTree.cpp @@ -28,6 +28,6 @@ namespace gtsam { /* ************************************************************************* */ GaussianJunctionTree::GaussianJunctionTree( const GaussianEliminationTree& eliminationTree) : - Base(Base::FromEliminationTree(eliminationTree)) {} + Base(eliminationTree) {} } diff --git a/gtsam/linear/linearExceptions.h b/gtsam/linear/linearExceptions.h index 0e53e3eba..812015042 100644 --- a/gtsam/linear/linearExceptions.h +++ b/gtsam/linear/linearExceptions.h @@ -153,7 +153,7 @@ on gtsam::IndeterminantLinearSystemException for more information.\n"; /* ************************************************************************* */ class InvalidDenseElimination : public ThreadsafeException { public: - InvalidDenseElimination(const char *message) : ThreadsafeException(message) {} + InvalidDenseElimination(const char *message) : ThreadsafeException(message) {} }; } diff --git a/gtsam/nonlinear/ISAM2.cpp b/gtsam/nonlinear/ISAM2.cpp index 0cfe4af01..0895963f1 100644 --- a/gtsam/nonlinear/ISAM2.cpp +++ b/gtsam/nonlinear/ISAM2.cpp @@ -73,7 +73,7 @@ public: typedef boost::shared_ptr shared_ptr; ISAM2JunctionTree(const GaussianEliminationTree& eliminationTree) : - Base(Base::FromEliminationTree(eliminationTree)) {} + Base(eliminationTree) {} }; /* ************************************************************************* */ diff --git a/gtsam/symbolic/SymbolicJunctionTree.cpp b/gtsam/symbolic/SymbolicJunctionTree.cpp index a8e9803fc..7d1af49f7 100644 --- a/gtsam/symbolic/SymbolicJunctionTree.cpp +++ b/gtsam/symbolic/SymbolicJunctionTree.cpp @@ -28,6 +28,6 @@ namespace gtsam { /* ************************************************************************* */ SymbolicJunctionTree::SymbolicJunctionTree( const SymbolicEliminationTree& eliminationTree) : - Base(Base::FromEliminationTree(eliminationTree)) {} + Base(eliminationTree) {} }