Renamed variable
parent
692ddd8f36
commit
15d5542809
|
|
@ -99,7 +99,7 @@ namespace gtsam
|
|||
|
||||
// Do dense elimination step
|
||||
std::pair<boost::shared_ptr<ConditionalType>, boost::shared_ptr<FactorType> > eliminationResult =
|
||||
eliminationFunction(gatheredFactors, Ordering(node->keys));
|
||||
eliminationFunction(gatheredFactors, Ordering(node->orderedFrontalKeys));
|
||||
|
||||
// Store conditional in BayesTree clique, and in the case of ISAM2Clique also store the remaining factor
|
||||
myData.bayesTreeNode->setEliminationResult(eliminationResult);
|
||||
|
|
@ -123,7 +123,7 @@ namespace gtsam
|
|||
const std::string& s, const KeyFormatter& keyFormatter) const
|
||||
{
|
||||
std::cout << s;
|
||||
BOOST_FOREACH(Key j, keys)
|
||||
BOOST_FOREACH(Key j, orderedFrontalKeys)
|
||||
std::cout << j << " ";
|
||||
std::cout << "problemSize = " << problemSize_ << std::endl;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace gtsam
|
|||
typedef FastVector<sharedFactor> Factors;
|
||||
typedef FastVector<boost::shared_ptr<Cluster> > Children;
|
||||
|
||||
Keys keys; ///< Frontal keys of this node
|
||||
Keys orderedFrontalKeys; ///< Frontal keys of this node
|
||||
Factors factors; ///< Factors associated with this node
|
||||
Children children; ///< sub-trees
|
||||
int problemSize_;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ namespace gtsam {
|
|||
// structure with its own JT node, and create a child pointer in its parent.
|
||||
ConstructorTraversalData<BAYESTREE,GRAPH> myData = ConstructorTraversalData<BAYESTREE,GRAPH>(&parentData);
|
||||
myData.myJTNode = boost::make_shared<typename JunctionTree<BAYESTREE,GRAPH>::Node>();
|
||||
myData.myJTNode->keys.push_back(node->key);
|
||||
myData.myJTNode->orderedFrontalKeys.push_back(node->key);
|
||||
myData.myJTNode->factors.insert(myData.myJTNode->factors.begin(), node->factors.begin(), node->factors.end());
|
||||
parentData.myJTNode->children.push_back(myData.myJTNode);
|
||||
return myData;
|
||||
|
|
@ -101,13 +101,20 @@ namespace gtsam {
|
|||
const typename JunctionTree<BAYESTREE, GRAPH>::Node& childToMerge =
|
||||
*myData.myJTNode->children[child - nrMergedChildren];
|
||||
// Merge keys, factors, and children.
|
||||
myData.myJTNode->keys.insert(myData.myJTNode->keys.begin(), childToMerge.keys.begin(), childToMerge.keys.end());
|
||||
myData.myJTNode->factors.insert(myData.myJTNode->factors.end(), childToMerge.factors.begin(), childToMerge.factors.end());
|
||||
myData.myJTNode->children.insert(myData.myJTNode->children.end(), childToMerge.children.begin(), childToMerge.children.end());
|
||||
myData.myJTNode->orderedFrontalKeys.insert(
|
||||
myData.myJTNode->orderedFrontalKeys.begin(),
|
||||
childToMerge.orderedFrontalKeys.begin(),
|
||||
childToMerge.orderedFrontalKeys.end());
|
||||
myData.myJTNode->factors.insert(myData.myJTNode->factors.end(),
|
||||
childToMerge.factors.begin(),
|
||||
childToMerge.factors.end());
|
||||
myData.myJTNode->children.insert(myData.myJTNode->children.end(),
|
||||
childToMerge.children.begin(),
|
||||
childToMerge.children.end());
|
||||
// Increment problem size
|
||||
combinedProblemSize = std::max(combinedProblemSize, childToMerge.problemSize_);
|
||||
// Increment number of frontal variables
|
||||
myNrFrontals += childToMerge.keys.size();
|
||||
myNrFrontals += childToMerge.orderedFrontalKeys.size();
|
||||
// Remove child from list.
|
||||
myData.myJTNode->children.erase(myData.myJTNode->children.begin() + (child - nrMergedChildren));
|
||||
// Increment number of merged children
|
||||
|
|
|
|||
|
|
@ -46,10 +46,10 @@ TEST( JunctionTree, constructor )
|
|||
frontal1 = list_of(2)(3),
|
||||
frontal2 = list_of(0)(1),
|
||||
sep1, sep2 = list_of(2);
|
||||
EXPECT(assert_container_equality(frontal1, actual.roots().front()->keys));
|
||||
EXPECT(assert_container_equality(frontal1, actual.roots().front()->orderedFrontalKeys));
|
||||
//EXPECT(assert_equal(sep1, actual.roots().front()->separator));
|
||||
LONGS_EQUAL(1, (long)actual.roots().front()->factors.size());
|
||||
EXPECT(assert_container_equality(frontal2, actual.roots().front()->children.front()->keys));
|
||||
EXPECT(assert_container_equality(frontal2, actual.roots().front()->children.front()->orderedFrontalKeys));
|
||||
//EXPECT(assert_equal(sep2, actual.roots().front()->children.front()->separator));
|
||||
LONGS_EQUAL(2, (long)actual.roots().front()->children.front()->factors.size());
|
||||
EXPECT(assert_equal(*simpleChain[2], *actual.roots().front()->factors[0]));
|
||||
|
|
|
|||
Loading…
Reference in New Issue