![]() |
NDEVR
API Documentation
|
Implementation of a solver operating on the blocks of the Hessian. More...
Public Member Functions | |
| BlockSolver () | |
| Default constructor. | |
| bool | buildStructure (bool zeroBlocks, IndexScratch &scratch) |
| Builds the sparse block matrix structure from the graph. | |
| bool | buildSystem () |
| Builds the linear system (Hessian blocks and gradient) from the current graph. | |
| void | clear () |
| Clears all solver state, resetting sizes to zero. | |
| bool | init (bool online=false) |
| Initializes the block solver. | |
| void | multiplyHessian (g_type *dest, const g_type *src) const |
| Multiplies the pose Hessian by a vector: dest = Hpp * src. | |
| SparseOptimizer & | optimizer () |
| Returns a mutable reference to the underlying optimizer. | |
| const SparseOptimizer & | optimizer () const |
| Returns a const reference to the underlying optimizer. | |
| void | restoreDiagonal () |
| Restores the Hessian diagonal from the backup. | |
| bool | schur () |
| Returns whether the Schur complement is currently enabled. | |
| bool | setLambda (g_type lambda, bool backup=false) |
| Adds a damping factor to the diagonal of the Hessian. | |
| void | setSchur (bool s) |
| Enables or disables the Schur complement. | |
| bool | solve () |
| Solves the linear system, optionally using the Schur complement. | |
| bool | supportsSchur () |
| Returns true; this solver supports the Schur complement. | |
| bool | updateStructure (const Buffer< HyperGraph::HGVertex * > &vset, const Set< HyperGraph::HGVertex * > &edges) |
| Updates the structure after vertices or edges have changed. | |
| Public Member Functions inherited from Solver | |
| Solver () | |
| Default constructor. | |
| ~Solver () | |
| Destructor. | |
| g_type * | b () |
| return b, the right hand side of the system | |
| uint04 | vectorSize () const |
| return the size of the solution vector (x) and b | |
| g_type * | x () |
| return x, the solution vector | |
Public Attributes | |
| LinearSolverType | solver |
| The underlying linear solver. | |
Protected Member Functions | |
| void | resize (IndexScratch &scratch, int totalDim) |
| Resizes all internal matrices and vectors for the given problem size. | |
| Protected Member Functions inherited from Solver | |
| void | resizeVector (uint04 sx) |
| Resizes the solution and right-hand side vectors. | |
Protected Attributes | |
| Buffer< g_type > | _bschur |
| Right-hand side for the Schur complement system. | |
| Buffer< g_type > | _coefficients |
| Coefficient buffer for Schur elimination. | |
| Buffer< LandmarkVectorType > | _diagonalBackupLandmark |
| Backup of landmark Hessian diagonal. | |
| Buffer< PoseVectorType > | _diagonalBackupPose |
| Backup of pose Hessian diagonal. | |
| SparseBlockMatrixDiagonal< LandmarkMatrixType > | _DInvSchur |
| Inverse diagonal of the landmark Hessian. | |
| bool | _doSchur |
| Whether to use the Schur complement. | |
| SparseBlockMatrix< LandmarkMatrixType > | _Hll |
| Landmark-landmark Hessian block. | |
| SparseBlockMatrix< PoseLandmarkMatrixType > | _Hpl |
| Pose-landmark Hessian block. | |
| SparseBlockMatrixCCS< PoseLandmarkMatrixType > | _HplCCS |
| CCS view of the pose-landmark Hessian. | |
| SparseBlockMatrix< PoseMatrixType > | _Hpp |
| Pose-pose Hessian block. | |
| SparseBlockMatrix< PoseMatrixType > | _Hschur |
| Schur complement of the Hessian. | |
| SparseBlockMatrixCCS< PoseMatrixType > | _HschurTransposedCCS |
| Transposed CCS view of the Schur complement. | |
| uint04 | _numLandmarks |
| Number of pose and landmark blocks. | |
| uint04 | _sizeLandmarks |
| Total scalar dimensions of poses and landmarks. | |
| Protected Attributes inherited from Solver | |
| Buffer< g_type > | _b |
| The right-hand side vector. | |
| Buffer< g_type > | _x |
| The solution vector. | |
Implementation of a solver operating on the blocks of the Hessian.
Definition at line 66 of file block_solver.h.
| bool BlockSolver< Traits >::buildStructure | ( | bool | zeroBlocks, |
| IndexScratch & | scratch ) |
Builds the sparse block matrix structure from the graph.
| [in] | zeroBlocks | Whether to zero the blocks after allocation. |
| [in] | scratch | Scratch buffers for index assignments. |
Definition at line 76 of file block_solver.hpp.
References _DInvSchur, _doSchur, _Hll, _Hpl, _HplCCS, _Hpp, _Hschur, _HschurTransposedCCS, _numLandmarks, _sizeLandmarks, Buffer< t_type, t_memory_manager >::add(), SparseBlockMatrixHashMap< MatrixType >::addBlock(), IndexScratch::block_landmark_indices, IndexScratch::block_pose_indices, SparseBlockMatrixHashMap< MatrixType >::columns(), OptimizableGraph::OGVertex::dimension(), HyperGraph::HGVertex::edges(), OptimizableGraph::OGVertex::hessianIndex(), OptimizableGraph::OGEdge::mapHessianMemory(), OptimizableGraph::OGVertex::mapHessianMemory(), OptimizableGraph::OGVertex::marginalized(), resize(), OptimizableGraph::OGVertex::setColInHessian(), solver, HyperGraph::HGEdge::vertex(), and HyperGraph::HGEdge::vertexCount().
|
inline |
Builds the linear system (Hessian blocks and gradient) from the current graph.
Definition at line 124 of file block_solver.h.
| bool BlockSolver< Traits >::init | ( | bool | online = false | ) |
|
inline |
Multiplies the pose Hessian by a vector: dest = Hpp * src.
| [out] | dest | The destination vector. |
| [in] | src | The source vector. |
Definition at line 292 of file block_solver.h.
|
protected |
Resizes all internal matrices and vectors for the given problem size.
| [in] | scratch | Scratch buffers for index assignments. |
| [in] | totalDim | The total dimension of the problem. |
Definition at line 49 of file block_solver.hpp.
References _bschur, _coefficients, _DInvSchur, _doSchur, _Hll, _Hpl, _HplCCS, _Hpp, _Hschur, _HschurTransposedCCS, IndexScratch::block_landmark_indices, IndexScratch::block_pose_indices, and Solver::resizeVector().
Referenced by buildStructure().
| bool BlockSolver< Traits >::setLambda | ( | g_type | lambda, |
| bool | backup = false ) |
Adds a damping factor to the diagonal of the Hessian.
| [in] | lambda | The damping factor. |
| [in] | backup | Whether to backup the diagonal before modification. |
Definition at line 319 of file block_solver.hpp.
References _diagonalBackupLandmark, _diagonalBackupPose, _Hll, _Hpp, _numLandmarks, and Solver::b().
|
inline |
Enables or disables the Schur complement.
| [in] | s | True to enable, false to disable. |
Definition at line 288 of file block_solver.h.
|
inline |
Solves the linear system, optionally using the Schur complement.
Definition at line 162 of file block_solver.h.
| bool BlockSolver< Traits >::updateStructure | ( | const Buffer< HyperGraph::HGVertex * > & | vset, |
| const Set< HyperGraph::HGVertex * > & | edges ) |
Updates the structure after vertices or edges have changed.
| [in] | vset | The updated vertices. |
| [in] | edges | The updated edges. |
Definition at line 245 of file block_solver.hpp.
References _Hpp, _sizeLandmarks, OptimizableGraph::OGVertex::dimension(), OptimizableGraph::OGVertex::hessianIndex(), OptimizableGraph::OGEdge::mapHessianMemory(), OptimizableGraph::OGVertex::mapHessianMemory(), OptimizableGraph::OGVertex::marginalized(), Solver::resizeVector(), OptimizableGraph::OGVertex::setColInHessian(), HyperGraph::HGEdge::vertex(), and HyperGraph::HGEdge::vertexCount().