|
gtsam
|
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.
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 |
| 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.
| gfg | Gaussian factor graph to compile and retain as needed. |
| preconditioner | Built preconditioner used by split solves. |
| info | Ordering, dimensions, and scalar offsets for graph keys. |
| lambda | Per-key damping retained for API compatibility. |
| parallel | Whether large kernels may use the task scheduler. |
| numThreads | Requested worker count; zero selects automatically. |