gtsam 4.1.1
gtsam
gtsam::SubgraphPreconditioner Class Reference

Detailed Description

Subgraph conditioner class, as explained in the RSS 2010 submission.

Starting with a graph A*x=b, we split it in two systems A1*x=b1 and A2*x=b2 We solve R1*x=c1, and make the substitution y=R1*x-c1. To use the class, give the Bayes Net R1*x=c1 and Graph A2*x=b2. Then solve for yhat using CG, and solve for xhat = system.x(yhat).

+ Inheritance diagram for gtsam::SubgraphPreconditioner:

Public Member Functions

 SubgraphPreconditioner (const SubgraphPreconditionerParameters &p=SubgraphPreconditionerParameters())
 
 SubgraphPreconditioner (const sharedFG &Ab2, const sharedBayesNet &Rc1, const sharedValues &xbar, const SubgraphPreconditionerParameters &p=SubgraphPreconditionerParameters())
 Constructor. More...
 
void print (const std::string &s="SubgraphPreconditioner") const
 print the object
 
const sharedFG & Ab2 () const
 Access Ab2.
 
const sharedBayesNet & Rc1 () const
 Access Rc1.
 
const sharedErrors b2bar () const
 Access b2bar.
 
VectorValues x (const VectorValues &y) const
 Add zero-mean i.i.d. More...
 
VectorValues zero () const
 
void transposeMultiplyAdd2 (double alpha, Errors::const_iterator begin, Errors::const_iterator end, VectorValues &y) const
 Add constraint part of the error only y += alpha*inv(R1')*A2'*e2 Takes a range indicating e2 !!!!
 
double error (const VectorValues &y) const
 
VectorValues gradient (const VectorValues &y) const
 gradient = y + inv(R1')*A2'*(A2*inv(R1)*y-b2bar)
 
Errors operator* (const VectorValues &y) const
 Apply operator A.
 
void multiplyInPlace (const VectorValues &y, Errors &e) const
 Apply operator A in place: needs e allocated already.
 
VectorValues operator^ (const Errors &e) const
 Apply operator A'.
 
void transposeMultiplyAdd (double alpha, const Errors &e, VectorValues &y) const
 Add A'e to y y += alpha*A'[e1;e2] = [alpha*e1; alpha*inv(R1')*A2'*e2].
 
void solve (const Vector &y, Vector &x) const override
 implement x = R^{-1} y More...
 
void transposeSolve (const Vector &y, Vector &x) const override
 implement x = R^{-T} y More...
 
void build (const GaussianFactorGraph &gfg, const KeyInfo &info, const std::map< Key, Vector > &lambda) override
 build/factorize the preconditioner More...
 
virtual void solve (const Vector &y, Vector &x) const =0
 implement x = L^{-1} y More...
 
virtual void transposeSolve (const Vector &y, Vector &x) const =0
 implement x = L^{-T} y More...
 
virtual void build (const GaussianFactorGraph &gfg, const KeyInfo &info, const std::map< Key, Vector > &lambda)=0
 build/factorize the preconditioner More...
 

Public Types

typedef boost::shared_ptr< SubgraphPreconditionershared_ptr
 
typedef boost::shared_ptr< const GaussianBayesNetsharedBayesNet
 
typedef boost::shared_ptr< const GaussianFactorGraphsharedFG
 
typedef boost::shared_ptr< const VectorValuessharedValues
 
typedef boost::shared_ptr< const ErrorssharedErrors
 
- Public Types inherited from gtsam::Preconditioner
typedef boost::shared_ptr< Preconditionershared_ptr
 
typedef std::vector< size_t > Dimensions
 

Constructor & Destructor Documentation

◆ SubgraphPreconditioner()

gtsam::SubgraphPreconditioner::SubgraphPreconditioner ( const sharedFG &  Ab2,
const sharedBayesNet &  Rc1,
const sharedValues &  xbar,
const SubgraphPreconditionerParameters p = SubgraphPreconditionerParameters() 
)

Constructor.

Parameters
Ab2the Graph A2*x=b2
Rc1the Bayes Net R1*x=c1
xbarthe solution to R1*x=c1

Member Function Documentation

◆ build()

void gtsam::SubgraphPreconditioner::build ( const GaussianFactorGraph gfg,
const KeyInfo info,
const std::map< Key, Vector > &  lambda 
)
overridevirtual

build/factorize the preconditioner

Implements gtsam::Preconditioner.

◆ solve()

void gtsam::SubgraphPreconditioner::solve ( const Vector &  y,
Vector &  x 
) const
overridevirtual

implement x = R^{-1} y

Implements gtsam::Preconditioner.

◆ transposeSolve()

void gtsam::SubgraphPreconditioner::transposeSolve ( const Vector &  y,
Vector &  x 
) const
overridevirtual

implement x = R^{-T} y

Implements gtsam::Preconditioner.

◆ x()

VectorValues gtsam::SubgraphPreconditioner::x ( const VectorValues y) const

Add zero-mean i.i.d.

Gaussian prior terms to each variable

Parameters
sigmaStandard deviation of Gaussian

The documentation for this class was generated from the following files: