|
g2o
|
provide memory workspace for computing the Jacobians More...
#include <jacobian_workspace.h>
Public Types | |
| using | WorkspaceVector = std::vector< VectorX > |
Public Member Functions | |
| JacobianWorkspace () | |
| ~JacobianWorkspace () | |
| bool | allocate () |
| void | updateSize (const HyperGraph::Edge *e, bool reset) |
| void | updateSize (const HyperGraph::Edge *e) |
| void | updateSize (const OptimizableGraph &graph, bool reset=false) |
| void | updateSize (int numVertices, int dimension, bool reset=false) |
| void | setZero () |
| double * | workspaceForVertex (int vertexIndex) |
Protected Attributes | |
| WorkspaceVector | _workspace |
| the memory pre-allocated for computing the Jacobians | |
| int | _maxNumVertices |
| int | _maxDimension |
provide memory workspace for computing the Jacobians
The workspace is used by an OptimizableGraph to provide temporary memory for computing the Jacobian of the error functions. Before calling linearizeOplus on an edge, the workspace needs to be allocated by calling allocate().
By default, the sizes are updated incrementally with each call. If the reset flag is set to true, the counts are set back to
Definition at line 53 of file jacobian_workspace.h.
| using g2o::JacobianWorkspace::WorkspaceVector = std::vector<VectorX> |
Definition at line 55 of file jacobian_workspace.h.
| g2o::JacobianWorkspace::JacobianWorkspace | ( | ) |
Definition at line 38 of file jacobian_workspace.cpp.
| g2o::JacobianWorkspace::~JacobianWorkspace | ( | ) |
Definition at line 41 of file jacobian_workspace.cpp.
| bool g2o::JacobianWorkspace::allocate | ( | ) |
allocate the workspace
Definition at line 43 of file jacobian_workspace.cpp.
References _maxDimension, _maxNumVertices, and _workspace.
Referenced by g2o::G2oSlamInterface::addEdge(), g2o::StructureOnlySolver< PointDoF >::calc(), g2o::SparseOptimizer::initializeOptimization(), and g2o::SparseOptimizer::initializeOptimization().
| void g2o::JacobianWorkspace::setZero | ( | ) |
set the full workspace to zero
Definition at line 54 of file jacobian_workspace.cpp.
References _workspace.
| void g2o::JacobianWorkspace::updateSize | ( | const HyperGraph::Edge * | e | ) |
update the maximum required workspace needed by taking into account this edge
Definition at line 66 of file jacobian_workspace.cpp.
References _maxDimension, _maxNumVertices, g2o::OptimizableGraph::Vertex::dimension(), g2o::OptimizableGraph::Edge::dimension(), and g2o::HyperGraph::Edge::vertices().
| void g2o::JacobianWorkspace::updateSize | ( | const HyperGraph::Edge * | e, |
| bool | reset | ||
| ) |
update the maximum required workspace needed by taking into account this edge
Definition at line 58 of file jacobian_workspace.cpp.
References _maxDimension, _maxNumVertices, and updateSize().
Referenced by g2o::OptimizableGraph::addEdge(), g2o::StructureOnlySolver< PointDoF >::calc(), g2o::BaseDynamicVertex< T >::setDimension(), g2o::OptimizableGraph::setEdgeVertex(), updateSize(), and updateSize().
| void g2o::JacobianWorkspace::updateSize | ( | const OptimizableGraph & | graph, |
| bool | reset = false |
||
| ) |
update the required workspace by looking at a full graph
Definition at line 84 of file jacobian_workspace.cpp.
References _maxDimension, _maxNumVertices, g2o::HyperGraph::edges(), and updateSize().
| void g2o::JacobianWorkspace::updateSize | ( | int | numVertices, |
| int | dimension, | ||
| bool | reset = false |
||
| ) |
manually update with the given parameters
Definition at line 98 of file jacobian_workspace.cpp.
References _maxDimension, and _maxNumVertices.
|
inline |
return the workspace for a vertex in an edge
Definition at line 95 of file jacobian_workspace.h.
Referenced by g2o::BlockSolver< Traits >::buildSystem(), g2o::BaseVariableSizedEdge< D, E >::linearizeOplus(), and g2o::BaseFixedSizedEdge< D, E, VertexTypes >::linearizeOplus_allocate().
|
protected |
the maximum dimension (number of elements) for a Jacobian
Definition at line 106 of file jacobian_workspace.h.
Referenced by allocate(), updateSize(), updateSize(), updateSize(), and updateSize().
|
protected |
the maximum number of vertices connected by a hyper-edge
Definition at line 104 of file jacobian_workspace.h.
Referenced by allocate(), updateSize(), updateSize(), updateSize(), and updateSize().
|
protected |
the memory pre-allocated for computing the Jacobians
Definition at line 103 of file jacobian_workspace.h.
Referenced by allocate(), and setZero().