Removed cached factors from BayesTree - these were a hack from making iSAM2 work and were causing a lot of memory to be accumulated for big problems
							parent
							
								
									c9b57ccd74
								
							
						
					
					
						commit
						2b9193e12a
					
				| 
						 | 
					@ -133,7 +133,6 @@ namespace gtsam {
 | 
				
			||||||
  void BayesTree<CONDITIONAL>::Clique::permuteWithInverse(const Permutation& inversePermutation) {
 | 
					  void BayesTree<CONDITIONAL>::Clique::permuteWithInverse(const Permutation& inversePermutation) {
 | 
				
			||||||
    BayesNet<CONDITIONAL>::permuteWithInverse(inversePermutation);
 | 
					    BayesNet<CONDITIONAL>::permuteWithInverse(inversePermutation);
 | 
				
			||||||
    BOOST_FOREACH(Index& separatorKey, separator_) { separatorKey = inversePermutation[separatorKey]; }
 | 
					    BOOST_FOREACH(Index& separatorKey, separator_) { separatorKey = inversePermutation[separatorKey]; }
 | 
				
			||||||
    if(cachedFactor_) cachedFactor_->permuteWithInverse(inversePermutation);
 | 
					 | 
				
			||||||
    BOOST_FOREACH(const shared_ptr& child, children_) {
 | 
					    BOOST_FOREACH(const shared_ptr& child, children_) {
 | 
				
			||||||
      child->permuteWithInverse(inversePermutation);
 | 
					      child->permuteWithInverse(inversePermutation);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					@ -153,7 +152,6 @@ namespace gtsam {
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    if(changed) {
 | 
					    if(changed) {
 | 
				
			||||||
      BOOST_FOREACH(Index& separatorKey, separator_) { separatorKey = inversePermutation[separatorKey]; }
 | 
					      BOOST_FOREACH(Index& separatorKey, separator_) { separatorKey = inversePermutation[separatorKey]; }
 | 
				
			||||||
      if(cachedFactor_) cachedFactor_->permuteWithInverse(inversePermutation);
 | 
					 | 
				
			||||||
      BOOST_FOREACH(const shared_ptr& child, children_) {
 | 
					      BOOST_FOREACH(const shared_ptr& child, children_) {
 | 
				
			||||||
        (void)child->permuteSeparatorWithInverse(inversePermutation);
 | 
					        (void)child->permuteSeparatorWithInverse(inversePermutation);
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -58,7 +58,6 @@ namespace gtsam {
 | 
				
			||||||
			weak_ptr parent_;
 | 
								weak_ptr parent_;
 | 
				
			||||||
			std::list<shared_ptr> children_;
 | 
								std::list<shared_ptr> children_;
 | 
				
			||||||
			std::list<Index> separator_; /** separator keys */
 | 
								std::list<Index> separator_; /** separator keys */
 | 
				
			||||||
			typename CONDITIONAL::Factor::shared_ptr cachedFactor_;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
			friend class BayesTree<CONDITIONAL>;
 | 
								friend class BayesTree<CONDITIONAL>;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -87,9 +86,6 @@ namespace gtsam {
 | 
				
			||||||
			std::list<shared_ptr>& children() { return children_; }
 | 
								std::list<shared_ptr>& children() { return children_; }
 | 
				
			||||||
			const std::list<shared_ptr>& children() const { return children_; }
 | 
								const std::list<shared_ptr>& children() const { return children_; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			/** Reference the cached factor */
 | 
					 | 
				
			||||||
			typename CONDITIONAL::Factor::shared_ptr& cachedFactor() { return cachedFactor_; }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			/** The size of subtree rooted at this clique, i.e., nr of Cliques */
 | 
								/** The size of subtree rooted at this clique, i.e., nr of Cliques */
 | 
				
			||||||
			size_t treeSize() const;
 | 
								size_t treeSize() const;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -188,7 +188,6 @@ namespace gtsam {
 | 
				
			||||||
		BOOST_FOREACH(typename BayesTree::sharedClique& childRoot, children)
 | 
							BOOST_FOREACH(typename BayesTree::sharedClique& childRoot, children)
 | 
				
			||||||
			childRoot->parent_ = new_clique;
 | 
								childRoot->parent_ = new_clique;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		new_clique->cachedFactor() = jointFactor;
 | 
					 | 
				
			||||||
    toc("JT 2.4 Update tree");
 | 
					    toc("JT 2.4 Update tree");
 | 
				
			||||||
		return make_pair(new_clique, jointFactor);
 | 
							return make_pair(new_clique, jointFactor);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue