|
gtsam
|
Imperative multifrontal clique structure used by MultifrontalSolver.
Public Member Functions | |
| MultifrontalClique (std::vector< size_t > factorIndices, const std::weak_ptr< MultifrontalClique > &parent, const KeyVector &frontals, const KeySet &separatorKeys, const KeyDimMap &dims, size_t vbmRows, VectorValues *solution, const std::unordered_set< Key > *fixedKeys, size_t numEliminatedFrontals) | |
| Construct a clique from factor indices and cache static structure. | |
Setup (non-const) | |
| void | finalize (std::vector< ChildInfo > children, const MultifrontalParameters ¶ms) |
| Cache the children list, compute parent indices, and lock in QR usage. | |
| void | fillAb (const GaussianFactorGraph &graph) |
| Load factor values into a lazily allocated, reusable Ab matrix. | |
| void | prepareForElimination () |
| Zero out the info matrix, re-add Hessians, accumulate Jacobians and children. | |
| void | factorize () |
| Perform Cholesky factorization on the frontal block. | |
| void | addIdentityDamping (double lambda) |
| Add identity damping to the frontal block. | |
| void | addDiagonalDamping (double lambda, double minDiagonal, double maxDiagonal) |
| Add diagonal damping to the frontal block. | |
| void | addExactDiagonalDamping (double lambda, const VectorValues &hessianDiagonal, double minDiagonal, double maxDiagonal) |
| Add diagonal damping to the frontal block using an externally provided Hessian diagonal diag(J^T J) keyed by variable. | |
Read-only methods | |
| int | problemSize () const |
| Return the clique dimension used for traversal scheduling. | |
| size_t | numFrontals () const |
| Return the number of frontal keys in this clique. | |
| bool | fullyEliminated () const |
| Return whether every symbolic frontal in this clique is eliminated. | |
| const KeyVector & | orderedKeys () const |
| Return keys ordered by block index (frontals followed by separators). | |
| std::shared_ptr< GaussianConditional > | conditional () const |
| Build a GaussianConditional from the in-place factorization. | |
| std::shared_ptr< HessianFactor > | remainingFactor () const |
| Build the assembled factor on variables retained after partial elimination. | |
| const VerticalBlockMatrix & | Ab () const |
| Get the vertical block matrix Ab. | |
| const SymmetricBlockMatrix & | info () const |
| Get the information matrix (const). | |
| bool | useQR () const |
| Check if this clique is using QR elimination. | |
| bool | useCompactCholesky () const |
| Check if this leaf avoids materializing its separator Hessian. | |
| void | print (const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const |
| Print this clique. | |
Solve (non-const) | |
| void | eliminateInPlace () |
| Eliminate in-place, invalidating Ab_, and updating RSd_ and info_. | |
| void | eliminateInPlace (double lambda, const LMDampingParams &dampingParams, const VectorValues &exactHessianDiagonal) |
| Version of eliminate that applies damping before eliminate. | |
| void | updateSolution () |
| Solve for this clique's frontal variables and write them back to the cached solution vectors. | |
| double | lastOldError () const |
| Access the last old error computed during updateSolution(). | |
| double | lastNewError () const |
| Access the last new error computed during updateSolution(). | |
| double | constantTermError () const |
| Return the constant error term for this clique (nonzero for roots). | |
Public Attributes | |
| std::weak_ptr< MultifrontalClique > | parent |
| Parent clique. | |
| Children | children |
| Child cliques used for traversal. | |
| size_t | frontalDim = 0 |
| Frontal dimension. | |
| size_t | separatorDim = 0 |
| Separator dimension. | |
Public Types | |
| using | shared_ptr = std::shared_ptr<MultifrontalClique> |
| using | Children = std::vector<shared_ptr> |
Classes | |
| struct | ChildInfo |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const MultifrontalClique &clique) |
|
explicit |
Construct a clique from factor indices and cache static structure.
| factorIndices | Indices of factors associated with this clique. |
| parent | Weak pointer to the parent clique. |
| frontals | Frontal keys for this clique. |
| separatorKeys | Separator keys for this clique. |
| dims | Key->dimension map. |
| vbmRows | Number of rows needed for the vertical block matrix. |
| solution | Solution storage for cached pointers. |
| fixedKeys | Keys fixed to zero by constraints (may be null). |
| void gtsam::MultifrontalClique::addDiagonalDamping | ( | double | lambda, |
| double | minDiagonal, | ||
| double | maxDiagonal ) |
Add diagonal damping to the frontal block.
| lambda | Damping factor |
| minDiagonal | Minimum diagonal value |
| maxDiagonal | Maximum diagonal value |
| void gtsam::MultifrontalClique::addExactDiagonalDamping | ( | double | lambda, |
| const VectorValues & | hessianDiagonal, | ||
| double | minDiagonal, | ||
| double | maxDiagonal ) |
Add diagonal damping to the frontal block using an externally provided Hessian diagonal diag(J^T J) keyed by variable.
This matches the legacy LM diagonal damping definition based on the diagonal of the original linearized system rather than the post-Schur clique information matrix.
| lambda | Damping factor |
| hessianDiagonal | Map from key to diagonal vector (dimension-matched). |
| minDiagonal | Minimum diagonal value |
| maxDiagonal | Maximum diagonal value |
| void gtsam::MultifrontalClique::addIdentityDamping | ( | double | lambda | ) |
Add identity damping to the frontal block.
| lambda | Damping factor |
| void gtsam::MultifrontalClique::eliminateInPlace | ( | ) |
Eliminate in-place, invalidating Ab_, and updating RSd_ and info_.
Computes the local information matrix from the stacked Jacobian (Ab), incorporates child separator contributions, and performs partial QR or Cholesky on the frontal blocks.
| void gtsam::MultifrontalClique::eliminateInPlace | ( | double | lambda, |
| const LMDampingParams & | dampingParams, | ||
| const VectorValues & | exactHessianDiagonal ) |
Version of eliminate that applies damping before eliminate.
| lambda | Optional damping value; non-positive disables damping. |
| dampingParams | Parameters controlling LM-style damping. |
| exactHessianDiagonal | diag(J^T J) values for diagonal damping. |
| void gtsam::MultifrontalClique::fillAb | ( | const GaussianFactorGraph & | graph | ) |
Load factor values into a lazily allocated, reusable Ab matrix.
| graph | The factor graph with updated values (structure must match the graph used to build this clique, apart from updated numerical values). Only JacobianFactor and BatchJacobianFactor inputs are supported. |
| void gtsam::MultifrontalClique::finalize | ( | std::vector< ChildInfo > | children, |
| const MultifrontalParameters & | params ) |
Cache the children list, compute parent indices, and lock in QR usage.
| children | Child cliques plus separator metadata. |
| params | Parameters controlling QR mode and thresholds. |
| void gtsam::MultifrontalClique::print | ( | const std::string & | s = "", |
| const KeyFormatter & | keyFormatter = DefaultKeyFormatter ) const |
Print this clique.
| s | Optional string prefix. |
| keyFormatter | Ignored; retained for API compatibility. |
| std::shared_ptr< HessianFactor > gtsam::MultifrontalClique::remainingFactor | ( | ) | const |
Build the assembled factor on variables retained after partial elimination.
The returned factor owns its information because it may outlive this clique. Consequently, exporting requires one copy of the active upper-triangular block. The clique must have been prepared, and any leading eliminated frontals must have been factorized.
| void gtsam::MultifrontalClique::updateSolution | ( | ) |
Solve for this clique's frontal variables and write them back to the cached solution vectors.
Uses block back-substitution using the upper triangular-part of the Cholesky-stored information matrix, solving the triangular system for the frontal blocks.