Fixed compile issue in tests

release/4.3a0
Frank Dellaert 2010-01-23 01:03:47 +00:00
parent 807cffbd61
commit ada844300d
2 changed files with 19 additions and 15 deletions

View File

@ -160,11 +160,12 @@ TEST( Iterative, subgraphPCG )
graph.split<Key, Pose2Factor>(tree, T, C); graph.split<Key, Pose2Factor>(tree, T, C);
// build the subgraph PCG system // build the subgraph PCG system
GaussianFactorGraph Ab1 = T.linearize(theta_bar); GaussianFactorGraph Ab1_ = T.linearize(theta_bar);
SubgraphPreconditioner::sharedFG Ab1 = T.linearize_(theta_bar);
SubgraphPreconditioner::sharedFG Ab2 = C.linearize_(theta_bar); SubgraphPreconditioner::sharedFG Ab2 = C.linearize_(theta_bar);
SubgraphPreconditioner::sharedBayesNet Rc1 = Ab1.eliminate_(ordering); SubgraphPreconditioner::sharedBayesNet Rc1 = Ab1_.eliminate_(ordering);
SubgraphPreconditioner::sharedConfig xbar = optimize_(*Rc1); SubgraphPreconditioner::sharedConfig xbar = optimize_(*Rc1);
SubgraphPreconditioner system(Rc1, Ab2, xbar); SubgraphPreconditioner system(Ab1, Ab2, Rc1, xbar);
// Solve the subgraph PCG // Solve the subgraph PCG
VectorConfig ybar = conjugateGradients<SubgraphPreconditioner, VectorConfig, VectorConfig ybar = conjugateGradients<SubgraphPreconditioner, VectorConfig,

View File

@ -75,16 +75,17 @@ double error(const VectorConfig& x) {
boost::tie(Ab, xtrue) = planarGraph(N); // A*x-b boost::tie(Ab, xtrue) = planarGraph(N); // A*x-b
// Get the spanning tree and corresponding ordering // Get the spanning tree and corresponding ordering
GaussianFactorGraph Ab1, Ab2_; // A1*x-b1 and A2*x-b2 GaussianFactorGraph Ab1_, Ab2_; // A1*x-b1 and A2*x-b2
boost::tie(Ab1, Ab2_) = splitOffPlanarTree(N, Ab); boost::tie(Ab1_, Ab2_) = splitOffPlanarTree(N, Ab);
SubgraphPreconditioner::sharedFG Ab1(new GaussianFactorGraph(Ab1_));
SubgraphPreconditioner::sharedFG Ab2(new GaussianFactorGraph(Ab2_)); SubgraphPreconditioner::sharedFG Ab2(new GaussianFactorGraph(Ab2_));
// Eliminate the spanning tree to build a prior // Eliminate the spanning tree to build a prior
Ordering ordering = planarOrdering(N); Ordering ordering = planarOrdering(N);
SubgraphPreconditioner::sharedBayesNet Rc1 = Ab1.eliminate_(ordering); // R1*x-c1 SubgraphPreconditioner::sharedBayesNet Rc1 = Ab1_.eliminate_(ordering); // R1*x-c1
SubgraphPreconditioner::sharedConfig xbar = optimize_(*Rc1); // xbar = inv(R1)*c1 SubgraphPreconditioner::sharedConfig xbar = optimize_(*Rc1); // xbar = inv(R1)*c1
SubgraphPreconditioner system(Rc1, Ab2, xbar); SubgraphPreconditioner system(Ab1, Ab2, Rc1, xbar);
return system.error(x); return system.error(x);
} }
@ -98,17 +99,18 @@ TEST( SubgraphPreconditioner, system )
boost::tie(Ab, xtrue) = planarGraph(N); // A*x-b boost::tie(Ab, xtrue) = planarGraph(N); // A*x-b
// Get the spanning tree and corresponding ordering // Get the spanning tree and corresponding ordering
GaussianFactorGraph Ab1, Ab2_; // A1*x-b1 and A2*x-b2 GaussianFactorGraph Ab1_, Ab2_; // A1*x-b1 and A2*x-b2
boost::tie(Ab1, Ab2_) = splitOffPlanarTree(N, Ab); boost::tie(Ab1_, Ab2_) = splitOffPlanarTree(N, Ab);
SubgraphPreconditioner::sharedFG Ab1(new GaussianFactorGraph(Ab1_));
SubgraphPreconditioner::sharedFG Ab2(new GaussianFactorGraph(Ab2_)); SubgraphPreconditioner::sharedFG Ab2(new GaussianFactorGraph(Ab2_));
// Eliminate the spanning tree to build a prior // Eliminate the spanning tree to build a prior
Ordering ordering = planarOrdering(N); Ordering ordering = planarOrdering(N);
SubgraphPreconditioner::sharedBayesNet Rc1 = Ab1.eliminate_(ordering); // R1*x-c1 SubgraphPreconditioner::sharedBayesNet Rc1 = Ab1_.eliminate_(ordering); // R1*x-c1
SubgraphPreconditioner::sharedConfig xbar = optimize_(*Rc1); // xbar = inv(R1)*c1 SubgraphPreconditioner::sharedConfig xbar = optimize_(*Rc1); // xbar = inv(R1)*c1
// Create Subgraph-preconditioned system // Create Subgraph-preconditioned system
SubgraphPreconditioner system(Rc1, Ab2, xbar); SubgraphPreconditioner system(Ab1, Ab2, Rc1, xbar);
// Create zero config // Create zero config
VectorConfig zeros; VectorConfig zeros;
@ -175,17 +177,18 @@ TEST( SubgraphPreconditioner, conjugateGradients )
boost::tie(Ab, xtrue) = planarGraph(N); // A*x-b boost::tie(Ab, xtrue) = planarGraph(N); // A*x-b
// Get the spanning tree and corresponding ordering // Get the spanning tree and corresponding ordering
GaussianFactorGraph Ab1, Ab2_; // A1*x-b1 and A2*x-b2 GaussianFactorGraph Ab1_, Ab2_; // A1*x-b1 and A2*x-b2
boost::tie(Ab1, Ab2_) = splitOffPlanarTree(N, Ab); boost::tie(Ab1_, Ab2_) = splitOffPlanarTree(N, Ab);
SubgraphPreconditioner::sharedFG Ab1(new GaussianFactorGraph(Ab1_));
SubgraphPreconditioner::sharedFG Ab2(new GaussianFactorGraph(Ab2_)); SubgraphPreconditioner::sharedFG Ab2(new GaussianFactorGraph(Ab2_));
// Eliminate the spanning tree to build a prior // Eliminate the spanning tree to build a prior
Ordering ordering = planarOrdering(N); Ordering ordering = planarOrdering(N);
SubgraphPreconditioner::sharedBayesNet Rc1 = Ab1.eliminate_(ordering); // R1*x-c1 SubgraphPreconditioner::sharedBayesNet Rc1 = Ab1_.eliminate_(ordering); // R1*x-c1
SubgraphPreconditioner::sharedConfig xbar = optimize_(*Rc1); // xbar = inv(R1)*c1 SubgraphPreconditioner::sharedConfig xbar = optimize_(*Rc1); // xbar = inv(R1)*c1
// Create Subgraph-preconditioned system // Create Subgraph-preconditioned system
SubgraphPreconditioner system(Rc1, Ab2, xbar); SubgraphPreconditioner system(Ab1, Ab2, Rc1, xbar);
// Create zero config y0 and perturbed config y1 // Create zero config y0 and perturbed config y1
VectorConfig y0; VectorConfig y0;