fix compile error
parent
ea3e137060
commit
70aa2f7f5d
|
@ -33,10 +33,7 @@ namespace gtsam {
|
||||||
|
|
||||||
typedef boost::shared_ptr<const ConjugateGradientSolver> shared_ptr ;
|
typedef boost::shared_ptr<const ConjugateGradientSolver> shared_ptr ;
|
||||||
|
|
||||||
// ConjugateGradientSolver(const GRAPH &graph, const VALUES &initial, const Ordering &ordering, const sharedParameters parameters):
|
ConjugateGradientSolver(const GRAPH &graph, const VALUES &initial, const Ordering &ordering, const Parameters ¶meters = Parameters()):
|
||||||
// IterativeSolver(parameters), ptr_(0), zeros_(boost::make_shared<VectorValues>(initial.zero(ordering))) {}
|
|
||||||
|
|
||||||
ConjugateGradientSolver(const GRAPH &graph, const VALUES &initial, const Ordering &ordering, const Parameters ¶meters = Parameters()):
|
|
||||||
IterativeSolver(parameters), ptr_(0), zeros_(boost::make_shared<VectorValues>(initial.zero(ordering))) {}
|
IterativeSolver(parameters), ptr_(0), zeros_(boost::make_shared<VectorValues>(initial.zero(ordering))) {}
|
||||||
|
|
||||||
ConjugateGradientSolver(const LINEAR &GFG) {
|
ConjugateGradientSolver(const LINEAR &GFG) {
|
||||||
|
@ -53,7 +50,6 @@ namespace gtsam {
|
||||||
}
|
}
|
||||||
|
|
||||||
VectorValues::shared_ptr optimize() const {
|
VectorValues::shared_ptr optimize() const {
|
||||||
//boost::shared_ptr<VectorValues> zeros (ptr_->allocateVectorVavlues());
|
|
||||||
VectorValues x = conjugateGradientDescent(*ptr_, *zeros_, parameters_);
|
VectorValues x = conjugateGradientDescent(*ptr_, *zeros_, parameters_);
|
||||||
return boost::make_shared<VectorValues>(x) ;
|
return boost::make_shared<VectorValues>(x) ;
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,12 +37,12 @@ SubgraphSolver<GRAPH,LINEAR,VALUES>::update(const LINEAR &graph) const {
|
||||||
graph.split(pairs_, *Ab1, *Ab2) ;
|
graph.split(pairs_, *Ab1, *Ab2) ;
|
||||||
if (parameters_->verbosity()) cout << ",with " << Ab1->size() << " and " << Ab2->size() << " factors" << endl;
|
if (parameters_->verbosity()) cout << ",with " << Ab1->size() << " and " << Ab2->size() << " factors" << endl;
|
||||||
|
|
||||||
// // Add a HardConstra int to the root, otherwise the root will be singular
|
// // Add a HardConstraint to the root, otherwise the root will be singular
|
||||||
// Key root = keys.back();
|
// Key root = keys.back();
|
||||||
// T_.addHardConstraint(root, theta0[root]);
|
// T_.addHardConstraint(root, theta0[root]);
|
||||||
//
|
//
|
||||||
// // compose the approximate solution
|
// // compose the approximate solution
|
||||||
// theta_bar_ = composePoses<GRAPH, Constraint, Pose, Values> (T_, tree, theta0[root]);
|
// theta_bar_ = composePoses<GRAPH, Constraint, Pose, Values> (T_, tree, theta0[root]);
|
||||||
|
|
||||||
LINEAR sacrificialAb1 = *Ab1; // duplicate !!!!!
|
LINEAR sacrificialAb1 = *Ab1; // duplicate !!!!!
|
||||||
SubgraphPreconditioner::sharedBayesNet Rc1 = EliminationTree<GaussianFactor>::Create(sacrificialAb1)->eliminate();
|
SubgraphPreconditioner::sharedBayesNet Rc1 = EliminationTree<GaussianFactor>::Create(sacrificialAb1)->eliminate();
|
||||||
|
|
|
@ -75,13 +75,10 @@ namespace gtsam {
|
||||||
VectorValues::shared_ptr optimize() const ;
|
VectorValues::shared_ptr optimize() const ;
|
||||||
shared_ordering ordering() const { return ordering_; }
|
shared_ordering ordering() const { return ordering_; }
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
void initialize(const GRAPH& G, const VALUES& theta0);
|
void initialize(const GRAPH& G, const VALUES& theta0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
SubgraphSolver():IterativeSolver(){}
|
SubgraphSolver():IterativeSolver(){}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ namespace gtsam {
|
||||||
typedef NonlinearOptimizer<G, T, GaussianFactorGraph, Solver> Optimizer;
|
typedef NonlinearOptimizer<G, T, GaussianFactorGraph, Solver> Optimizer;
|
||||||
|
|
||||||
Ordering::shared_ptr ordering = initialEstimate.orderingArbitrary() ;
|
Ordering::shared_ptr ordering = initialEstimate.orderingArbitrary() ;
|
||||||
sharedSolver solver = boost::make_shared<Solver>(graph, initialEstimate, *ordering, boost::make_shared<IterativeOptimizationParameters>());
|
sharedSolver solver = boost::make_shared<Solver>(graph, initialEstimate, *ordering, IterativeOptimizationParameters());
|
||||||
Optimizer optimizer(
|
Optimizer optimizer(
|
||||||
boost::make_shared<const G>(graph),
|
boost::make_shared<const G>(graph),
|
||||||
boost::make_shared<const T>(initialEstimate),
|
boost::make_shared<const T>(initialEstimate),
|
||||||
|
@ -105,7 +105,7 @@ namespace gtsam {
|
||||||
typedef SubgraphSolver<G,GaussianFactorGraph,T> Solver;
|
typedef SubgraphSolver<G,GaussianFactorGraph,T> Solver;
|
||||||
typedef boost::shared_ptr<Solver> shared_Solver;
|
typedef boost::shared_ptr<Solver> shared_Solver;
|
||||||
typedef NonlinearOptimizer<G, T, GaussianFactorGraph, Solver> SPCGOptimizer;
|
typedef NonlinearOptimizer<G, T, GaussianFactorGraph, Solver> SPCGOptimizer;
|
||||||
shared_Solver solver = boost::make_shared<Solver>(graph, initialEstimate);
|
shared_Solver solver = boost::make_shared<Solver>(graph, initialEstimate, IterativeOptimizationParameters());
|
||||||
SPCGOptimizer optimizer(
|
SPCGOptimizer optimizer(
|
||||||
boost::make_shared<const G>(graph),
|
boost::make_shared<const G>(graph),
|
||||||
boost::make_shared<const T>(initialEstimate),
|
boost::make_shared<const T>(initialEstimate),
|
||||||
|
|
Loading…
Reference in New Issue