Cleaned up constructors
parent
ce4212c403
commit
6a74656ca9
|
|
@ -47,14 +47,6 @@ using namespace std;
|
||||||
|
|
||||||
namespace gtsam {
|
namespace gtsam {
|
||||||
|
|
||||||
/* ************************************************************************* */
|
|
||||||
template<class FACTOR>
|
|
||||||
void FactorGraph<FACTOR>::push_back(const FactorGraph<FACTOR>& factors) {
|
|
||||||
const_iterator factor = factors.begin();
|
|
||||||
for (; factor != factors.end(); factor++)
|
|
||||||
push_back(*factor);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
template<class FACTOR>
|
template<class FACTOR>
|
||||||
void FactorGraph<FACTOR>::print(const string& s) const {
|
void FactorGraph<FACTOR>::print(const string& s) const {
|
||||||
|
|
|
||||||
|
|
@ -72,18 +72,18 @@ namespace gtsam {
|
||||||
|
|
||||||
/** convert from a derived type */
|
/** convert from a derived type */
|
||||||
template<class DERIVEDFACTOR>
|
template<class DERIVEDFACTOR>
|
||||||
FactorGraph(const FactorGraph<DERIVEDFACTOR>& factorGraph);
|
FactorGraph(const FactorGraph<DERIVEDFACTOR>& factors) { factors_.insert(end(), factors.begin(), factors.end()); }
|
||||||
|
|
||||||
/** Add a factor */
|
/** Add a factor */
|
||||||
template<class DERIVEDFACTOR>
|
template<class DERIVEDFACTOR>
|
||||||
void push_back(const boost::shared_ptr<DERIVEDFACTOR>& factor) { factors_.push_back(sharedFactor(factor)); }
|
void push_back(const boost::shared_ptr<DERIVEDFACTOR>& factor) { factors_.push_back(sharedFactor(factor)); }
|
||||||
|
|
||||||
/** push back many factors */
|
/** push back many factors */
|
||||||
void push_back(const FactorGraph<FACTOR>& factors);
|
void push_back(const FactorGraph<FACTOR>& factors) { factors_.insert(end(), factors.begin(), factors.end()); }
|
||||||
|
|
||||||
/** push back many factors with an iterator */
|
/** push back many factors with an iterator */
|
||||||
template<typename ITERATOR>
|
template<typename ITERATOR>
|
||||||
void push_back(ITERATOR firstFactor, ITERATOR lastFactor);
|
void push_back(ITERATOR firstFactor, ITERATOR lastFactor) { factors_.insert(end(), firstFactor, lastFactor); }
|
||||||
|
|
||||||
/** push back many factors stored in a vector*/
|
/** push back many factors stored in a vector*/
|
||||||
template<typename DERIVEDFACTOR>
|
template<typename DERIVEDFACTOR>
|
||||||
|
|
@ -208,16 +208,6 @@ namespace gtsam {
|
||||||
* type.
|
* type.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* ************************************************************************* */
|
|
||||||
template<class FACTOR>
|
|
||||||
template<class DERIVEDFACTOR>
|
|
||||||
FactorGraph<FACTOR>::FactorGraph(const FactorGraph<DERIVEDFACTOR>& factorGraph) {
|
|
||||||
factors_.reserve(factorGraph.size());
|
|
||||||
BOOST_FOREACH(const typename DERIVEDFACTOR::shared_ptr& factor, factorGraph) {
|
|
||||||
this->push_back(factor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
template<class FACTOR>
|
template<class FACTOR>
|
||||||
template<class CONDITIONAL>
|
template<class CONDITIONAL>
|
||||||
|
|
@ -228,15 +218,6 @@ namespace gtsam {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
|
||||||
template<class FACTOR>
|
|
||||||
template<typename ITERATOR>
|
|
||||||
void FactorGraph<FACTOR>::push_back(ITERATOR firstFactor, ITERATOR lastFactor) {
|
|
||||||
ITERATOR factor = firstFactor;
|
|
||||||
while(factor != lastFactor)
|
|
||||||
this->push_back(*(factor++));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
template<class FACTOR>
|
template<class FACTOR>
|
||||||
template<class DERIVEDFACTOR>
|
template<class DERIVEDFACTOR>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue