Public Types | Public Member Functions | Private Attributes | List of all members
gtsam::SubgraphPreconditioner Class Reference

#include <SubgraphPreconditioner.h>

Inheritance diagram for gtsam::SubgraphPreconditioner:
Inheritance graph
[legend]

Public Types

typedef std::shared_ptr< SubgraphPreconditionershared_ptr
 
- Public Types inherited from gtsam::Preconditioner
typedef std::vector< size_tDimensions
 
typedef std::shared_ptr< Preconditionershared_ptr
 

Public Member Functions

const GaussianFactorGraphAb2 () const
 
const Errors b2bar () const
 
void build (const GaussianFactorGraph &gfg, const KeyInfo &info, const std::map< Key, Vector > &lambda) override
 build/factorize the preconditioner More...
 
double error (const VectorValues &y) const
 
VectorValues gradient (const VectorValues &y) const
 
void multiplyInPlace (const VectorValues &y, Errors &e) const
 
Errors operator* (const VectorValues &y) const
 
VectorValues operator^ (const Errors &e) const
 
void print (const std::string &s="SubgraphPreconditioner") const
 
const GaussianBayesNetRc1 () const
 
void solve (const Vector &y, Vector &x) const override
 implement x = R^{-1} y More...
 
 SubgraphPreconditioner (const SubgraphPreconditionerParameters &p=SubgraphPreconditionerParameters())
 
 SubgraphPreconditioner (const GaussianFactorGraph &Ab2, const GaussianBayesNet &Rc1, const VectorValues &xbar, const SubgraphPreconditionerParameters &p=SubgraphPreconditionerParameters())
 
void transposeMultiplyAdd (double alpha, const Errors &e, VectorValues &y) const
 
void transposeMultiplyAdd2 (double alpha, Errors::const_iterator begin, Errors::const_iterator end, VectorValues &y) const
 
void transposeSolve (const Vector &y, Vector &x) const override
 implement x = R^{-T} y More...
 
VectorValues x (const VectorValues &y) const
 
VectorValues zero () const
 
 ~SubgraphPreconditioner () override
 
- Public Member Functions inherited from gtsam::Preconditioner
 Preconditioner ()
 
virtual ~Preconditioner ()
 

Private Attributes

GaussianFactorGraph Ab2_
 
Errors b2bar_
 A2*xbar - b2. More...
 
KeyInfo keyInfo_
 
SubgraphPreconditionerParameters parameters_
 
GaussianBayesNet Rc1_
 
VectorValues xbar_
 A1 \ b1. More...
 

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).

Definition at line 54 of file SubgraphPreconditioner.h.

Member Typedef Documentation

◆ shared_ptr

Definition at line 57 of file SubgraphPreconditioner.h.

Constructor & Destructor Documentation

◆ SubgraphPreconditioner() [1/2]

gtsam::SubgraphPreconditioner::SubgraphPreconditioner ( const SubgraphPreconditionerParameters p = SubgraphPreconditionerParameters())

Definition at line 92 of file SubgraphPreconditioner.cpp.

◆ SubgraphPreconditioner() [2/2]

gtsam::SubgraphPreconditioner::SubgraphPreconditioner ( const GaussianFactorGraph Ab2,
const GaussianBayesNet Rc1,
const VectorValues xbar,
const SubgraphPreconditionerParameters p = SubgraphPreconditionerParameters() 
)

Constructor

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

Definition at line 96 of file SubgraphPreconditioner.cpp.

◆ ~SubgraphPreconditioner()

gtsam::SubgraphPreconditioner::~SubgraphPreconditioner ( )
inlineoverride

Definition at line 81 of file SubgraphPreconditioner.h.

Member Function Documentation

◆ Ab2()

const GaussianFactorGraph& gtsam::SubgraphPreconditioner::Ab2 ( ) const
inline

Access Ab2

Definition at line 87 of file SubgraphPreconditioner.h.

◆ b2bar()

const Errors gtsam::SubgraphPreconditioner::b2bar ( ) const
inline

Access b2bar

Definition at line 93 of file SubgraphPreconditioner.h.

◆ 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.

Definition at line 253 of file SubgraphPreconditioner.cpp.

◆ error()

double gtsam::SubgraphPreconditioner::error ( const VectorValues y) const

Definition at line 109 of file SubgraphPreconditioner.cpp.

◆ gradient()

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

gradient = y + inv(R1')*A2'*(A2*inv(R1)*y-b2bar)

Definition at line 118 of file SubgraphPreconditioner.cpp.

◆ multiplyInPlace()

void gtsam::SubgraphPreconditioner::multiplyInPlace ( const VectorValues y,
Errors e 
) const

Apply operator A in place: needs e allocated already

Definition at line 138 of file SubgraphPreconditioner.cpp.

◆ operator*()

Errors gtsam::SubgraphPreconditioner::operator* ( const VectorValues y) const

Apply operator A

Definition at line 128 of file SubgraphPreconditioner.cpp.

◆ operator^()

VectorValues gtsam::SubgraphPreconditioner::operator^ ( const Errors e) const

Apply operator A'

Definition at line 153 of file SubgraphPreconditioner.cpp.

◆ print()

void gtsam::SubgraphPreconditioner::print ( const std::string &  s = "SubgraphPreconditioner") const

print the object

Definition at line 195 of file SubgraphPreconditioner.cpp.

◆ Rc1()

const GaussianBayesNet& gtsam::SubgraphPreconditioner::Rc1 ( ) const
inline

Access Rc1

Definition at line 90 of file SubgraphPreconditioner.h.

◆ solve()

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

implement x = R^{-1} y

Implements gtsam::Preconditioner.

Definition at line 201 of file SubgraphPreconditioner.cpp.

◆ transposeMultiplyAdd()

void gtsam::SubgraphPreconditioner::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]

Definition at line 168 of file SubgraphPreconditioner.cpp.

◆ transposeMultiplyAdd2()

void gtsam::SubgraphPreconditioner::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 !!!!

Definition at line 181 of file SubgraphPreconditioner.cpp.

◆ transposeSolve()

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

implement x = R^{-T} y

Implements gtsam::Preconditioner.

Definition at line 223 of file SubgraphPreconditioner.cpp.

◆ 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

Definition at line 104 of file SubgraphPreconditioner.cpp.

◆ zero()

VectorValues gtsam::SubgraphPreconditioner::zero ( ) const
inline

Definition at line 104 of file SubgraphPreconditioner.h.

Member Data Documentation

◆ Ab2_

GaussianFactorGraph gtsam::SubgraphPreconditioner::Ab2_
private

Definition at line 60 of file SubgraphPreconditioner.h.

◆ b2bar_

Errors gtsam::SubgraphPreconditioner::b2bar_
private

A2*xbar - b2.

Definition at line 63 of file SubgraphPreconditioner.h.

◆ keyInfo_

KeyInfo gtsam::SubgraphPreconditioner::keyInfo_
private

Definition at line 65 of file SubgraphPreconditioner.h.

◆ parameters_

SubgraphPreconditionerParameters gtsam::SubgraphPreconditioner::parameters_
private

Definition at line 66 of file SubgraphPreconditioner.h.

◆ Rc1_

GaussianBayesNet gtsam::SubgraphPreconditioner::Rc1_
private

Definition at line 61 of file SubgraphPreconditioner.h.

◆ xbar_

VectorValues gtsam::SubgraphPreconditioner::xbar_
private

A1 \ b1.

Definition at line 62 of file SubgraphPreconditioner.h.


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


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:47:12