Loading...
Searching...
No Matches
SubgraphSolver.h
Go to the documentation of this file.
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
#pragma once
#include <gtsam/linear/ConjugateGradientSolver.h>
#include <gtsam/linear/SubgraphBuilder.h>
#include <map>
#include <utility> // pair
namespace gtsam {
// Forward declarations
class GaussianFactorGraph;
class GaussianBayesNet;
class SubgraphPreconditioner;
struct GTSAM_EXPORT SubgraphSolverParameters
: public ConjugateGradientParameters {
SubgraphBuilderParameters builderParams;
explicit SubgraphSolverParameters(const SubgraphBuilderParameters &p = SubgraphBuilderParameters())
: builderParams(p) {}
void print() const { Base::print(); }
void print(std::ostream &os) const override {
Base::print(os);
}
};
class GTSAM_EXPORT SubgraphSolver : public IterativeSolver {
public:
typedef SubgraphSolverParameters Parameters;
protected:
Parameters parameters_;
boost::shared_ptr<SubgraphPreconditioner> pc_;
public:
SubgraphSolver(const GaussianFactorGraph &A, const Parameters &parameters,
const Ordering &ordering);
SubgraphSolver(const GaussianFactorGraph &Ab1, const GaussianFactorGraph &Ab2,
const Parameters &parameters, const Ordering &ordering);
SubgraphSolver(const GaussianBayesNet &Rc1, const GaussianFactorGraph &Ab2,
const Parameters &parameters);
~SubgraphSolver() override {}
VectorValues optimize() const;
VectorValues optimize(const GaussianFactorGraph &gfg,
const KeyInfo &keyInfo,
const std::map<Key, Vector> &lambda,
const VectorValues &initial) override;
std::pair<GaussianFactorGraph, GaussianFactorGraph> splitGraph(
const GaussianFactorGraph &gfg);
};
} // namespace gtsam
SubgraphBuilder.h
ConjugateGradientSolver.h
Implementation of Conjugate Gradient solver for a linear system.
gtsam
Global functions in a separate testing namespace.
Definition chartTesting.h:28
gtsam::optimize
Point3 optimize(const NonlinearFactorGraph &graph, const Values &values, Key landmarkKey)
Optimize for triangulation.
Definition triangulation.cpp:155
gtsam::Ordering
Definition Ordering.h:34
gtsam::GaussianBayesNet
GaussianBayesNet is a Bayes net made from linear-Gaussian conditionals.
Definition GaussianBayesNet.h:36
gtsam::GaussianFactorGraph
A Linear Factor Graph is a factor graph where all factors are Gaussian, i.e.
Definition GaussianFactorGraph.h:75
gtsam::KeyInfo
Handy data structure for iterative solvers.
Definition IterativeSolver.h:126
gtsam::SubgraphBuilderParameters
Definition SubgraphBuilder.h:96
gtsam::SubgraphPreconditioner
Subgraph conditioner class, as explained in the RSS 2010 submission.
Definition SubgraphPreconditioner.h:54
gtsam::SubgraphSolverParameters
Definition SubgraphSolver.h:36
gtsam::SubgraphSolver::~SubgraphSolver
~SubgraphSolver() override
Destructor.
Definition SubgraphSolver.h:112
gtsam::SubgraphSolver::SubgraphSolver
SubgraphSolver(const GaussianFactorGraph &A, const Parameters &parameters, const Ordering &ordering)
Given a gaussian factor graph, split it into a spanning tree (A1) + others (A2) for SPCG Will throw e...
Definition SubgraphSolver.cpp:34
gtsam::SubgraphSolver::pc_
boost::shared_ptr< SubgraphPreconditioner > pc_
preconditioner object
Definition SubgraphSolver.h:82
gtsam::VectorValues
VectorValues represents a collection of vector-valued variables associated each with a unique integer...
Definition VectorValues.h:74