diff --git a/gtsam/linear/ConjugateGradientSolver.h b/gtsam/linear/ConjugateGradientSolver.h index 2db9f6501..cbbe7d938 100644 --- a/gtsam/linear/ConjugateGradientSolver.h +++ b/gtsam/linear/ConjugateGradientSolver.h @@ -33,10 +33,7 @@ namespace gtsam { typedef boost::shared_ptr shared_ptr ; -// ConjugateGradientSolver(const GRAPH &graph, const VALUES &initial, const Ordering &ordering, const sharedParameters parameters): -// IterativeSolver(parameters), ptr_(0), zeros_(boost::make_shared(initial.zero(ordering))) {} - - ConjugateGradientSolver(const GRAPH &graph, const VALUES &initial, const Ordering &ordering, const Parameters ¶meters = Parameters()): + ConjugateGradientSolver(const GRAPH &graph, const VALUES &initial, const Ordering &ordering, const Parameters ¶meters = Parameters()): IterativeSolver(parameters), ptr_(0), zeros_(boost::make_shared(initial.zero(ordering))) {} ConjugateGradientSolver(const LINEAR &GFG) { @@ -53,7 +50,6 @@ namespace gtsam { } VectorValues::shared_ptr optimize() const { - //boost::shared_ptr zeros (ptr_->allocateVectorVavlues()); VectorValues x = conjugateGradientDescent(*ptr_, *zeros_, parameters_); return boost::make_shared(x) ; } diff --git a/gtsam/linear/SubgraphSolver-inl.h b/gtsam/linear/SubgraphSolver-inl.h index 8242854ad..08c23beee 100644 --- a/gtsam/linear/SubgraphSolver-inl.h +++ b/gtsam/linear/SubgraphSolver-inl.h @@ -37,12 +37,12 @@ SubgraphSolver::update(const LINEAR &graph) const { graph.split(pairs_, *Ab1, *Ab2) ; 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 - // Key root = keys.back(); - // T_.addHardConstraint(root, theta0[root]); + // // Add a HardConstraint to the root, otherwise the root will be singular + // Key root = keys.back(); + // T_.addHardConstraint(root, theta0[root]); // - // // compose the approximate solution - // theta_bar_ = composePoses (T_, tree, theta0[root]); + // // compose the approximate solution + // theta_bar_ = composePoses (T_, tree, theta0[root]); LINEAR sacrificialAb1 = *Ab1; // duplicate !!!!! SubgraphPreconditioner::sharedBayesNet Rc1 = EliminationTree::Create(sacrificialAb1)->eliminate(); diff --git a/gtsam/linear/SubgraphSolver.h b/gtsam/linear/SubgraphSolver.h index 059c0fc28..1e2423fe9 100644 --- a/gtsam/linear/SubgraphSolver.h +++ b/gtsam/linear/SubgraphSolver.h @@ -75,13 +75,10 @@ namespace gtsam { VectorValues::shared_ptr optimize() const ; shared_ordering ordering() const { return ordering_; } - protected: - void initialize(const GRAPH& G, const VALUES& theta0); private: - SubgraphSolver():IterativeSolver(){} }; diff --git a/gtsam/nonlinear/NonlinearOptimization-inl.h b/gtsam/nonlinear/NonlinearOptimization-inl.h index 91924a6f3..6d1ed228c 100644 --- a/gtsam/nonlinear/NonlinearOptimization-inl.h +++ b/gtsam/nonlinear/NonlinearOptimization-inl.h @@ -81,7 +81,7 @@ namespace gtsam { typedef NonlinearOptimizer Optimizer; Ordering::shared_ptr ordering = initialEstimate.orderingArbitrary() ; - sharedSolver solver = boost::make_shared(graph, initialEstimate, *ordering, boost::make_shared()); + sharedSolver solver = boost::make_shared(graph, initialEstimate, *ordering, IterativeOptimizationParameters()); Optimizer optimizer( boost::make_shared(graph), boost::make_shared(initialEstimate), @@ -105,7 +105,7 @@ namespace gtsam { typedef SubgraphSolver Solver; typedef boost::shared_ptr shared_Solver; typedef NonlinearOptimizer SPCGOptimizer; - shared_Solver solver = boost::make_shared(graph, initialEstimate); + shared_Solver solver = boost::make_shared(graph, initialEstimate, IterativeOptimizationParameters()); SPCGOptimizer optimizer( boost::make_shared(graph), boost::make_shared(initialEstimate),