gtsam
Loading...
Searching...
No Matches
gtsam::GaussianFactorGraphSystem Class Reference

Detailed Description

Compiled flat-vector system used by preconditioned conjugate gradients.

Construction caches graph metadata and the right-hand side, compiles supported factors into flat execution plans, and retains a compatibility graph for other GaussianFactor implementations.

Note
Multiplication reuses mutable workspace and block-diagonal assembly is lazy. Concurrent calls on one instance, or on copies sharing the same implementation, require external synchronization.

Public Member Functions

 GaussianFactorGraphSystem (const GaussianFactorGraph &gfg, const Preconditioner &preconditioner, const KeyInfo &info, const std::map< Key, Vector > &lambda, bool parallel=true, size_t numThreads=0)
 Compile a Gaussian factor graph into a flat-vector PCG system.
void residual (const Vector &x, Vector &r) const
 Overwrite r with the residual b - H*x in flat KeyInfo ordering.
void multiply (const Vector &x, Vector &y) const
 Overwrite y with the Hessian-vector product H*x.
void leftPrecondition (const Vector &x, Vector &y) const
 Overwrite y with the left split-preconditioner solve L^{-1}*x.
void rightPrecondition (const Vector &x, Vector &y) const
 Overwrite y with the right split-preconditioner solve L^{-T}*x.
void scal (const double alpha, Vector &x) const
 Scale x in place by alpha.
double dot (const Vector &x, const Vector &y) const
 Return the Euclidean dot product of two flat vectors.
void axpy (const double alpha, const Vector &x, Vector &y) const
 Accumulate alpha*x into y.
void getb (Vector &b) const
 Overwrite b with the cached normal-equation right-hand side.
size_t numThreads () const
 Return the effective worker count, or one for serial execution.

Friends

class PCGSolver

Constructor & Destructor Documentation

◆ GaussianFactorGraphSystem()

gtsam::GaussianFactorGraphSystem::GaussianFactorGraphSystem ( const GaussianFactorGraph & gfg,
const Preconditioner & preconditioner,
const KeyInfo & info,
const std::map< Key, Vector > & lambda,
bool parallel = true,
size_t numThreads = 0 )

Compile a Gaussian factor graph into a flat-vector PCG system.

Parallel execution is enabled by default for sufficiently large systems. Set parallel to false or numThreads to one for serial execution. A zero numThreads selects an automatically capped worker count.

Parameters
gfgGaussian factor graph to compile and retain as needed.
preconditionerBuilt preconditioner used by split solves.
infoOrdering, dimensions, and scalar offsets for graph keys.
lambdaPer-key damping retained for API compatibility.
parallelWhether large kernels may use the task scheduler.
numThreadsRequested worker count; zero selects automatically.

The documentation for this class was generated from the following files:
  • /tmp/gtsam-4.3.0-doxygen.rsXPUS/source/gtsam/linear/PCGSolver.h
  • /tmp/gtsam-4.3.0-doxygen.rsXPUS/source/gtsam/linear/PCGSolver.cpp