g2o
|
provide memory workspace for computing the Jacobians More...
#include <jacobian_workspace.h>
Public Types | |
typedef std::vector< VectorXD, Eigen::aligned_allocator< VectorXD > > | WorkspaceVector |
Public Member Functions | |
JacobianWorkspace () | |
~JacobianWorkspace () | |
bool | allocate () |
void | updateSize (const HyperGraph::Edge *e) |
void | updateSize (const OptimizableGraph &graph) |
void | updateSize (int numVertices, int dimension) |
double * | workspaceForVertex (int vertexIndex) |
Protected Attributes | |
WorkspaceVector | _workspace |
the memory pre-allocated for computing the Jacobians More... | |
int | _maxNumVertices |
the maximum number of vertices connected by a hyper-edge More... | |
int | _maxDimension |
the maximum dimension (number of elements) for a Jacobian More... | |
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().
Definition at line 52 of file jacobian_workspace.h.
typedef std::vector<VectorXD, Eigen::aligned_allocator<VectorXD> > g2o::JacobianWorkspace::WorkspaceVector |
Definition at line 55 of file jacobian_workspace.h.
g2o::JacobianWorkspace::JacobianWorkspace | ( | ) |
Definition at line 37 of file jacobian_workspace.cpp.
g2o::JacobianWorkspace::~JacobianWorkspace | ( | ) |
Definition at line 42 of file jacobian_workspace.cpp.
bool g2o::JacobianWorkspace::allocate | ( | ) |
allocate the workspace
Definition at line 46 of file jacobian_workspace.cpp.
References _maxDimension, _maxNumVertices, and _workspace.
Referenced by g2o::G2oSlamInterface::addEdge(), g2o::StructureOnlySolver< PointDoF >::calc(), g2o::SparseOptimizer::initializeOptimization(), and main().
void g2o::JacobianWorkspace::updateSize | ( | const HyperGraph::Edge * | e | ) |
update the maximum required workspace needed by taking into account this edge
Definition at line 59 of file jacobian_workspace.cpp.
References _maxDimension, _maxNumVertices, g2o::OptimizableGraph::Vertex::dimension(), g2o::OptimizableGraph::Edge::dimension(), g2o::HyperGraph::Edge::vertex(), and g2o::HyperGraph::Edge::vertices().
Referenced by g2o::OptimizableGraph::addEdge(), g2o::StructureOnlySolver< PointDoF >::calc(), main(), g2o::OptimizableGraph::setEdgeVertex(), and updateSize().
void g2o::JacobianWorkspace::updateSize | ( | const OptimizableGraph & | graph | ) |
update the required workspace by looking at a full graph
Definition at line 75 of file jacobian_workspace.cpp.
References g2o::HyperGraph::edges(), and updateSize().
void g2o::JacobianWorkspace::updateSize | ( | int | numVertices, |
int | dimension | ||
) |
manually update with the given parameters
Definition at line 83 of file jacobian_workspace.cpp.
References _maxDimension, and _maxNumVertices.
|
inline |
return the workspace for a vertex in an edge
Definition at line 84 of file jacobian_workspace.h.
Referenced by g2o::BlockSolver< Traits >::buildSystem(), and main().
|
protected |
the maximum dimension (number of elements) for a Jacobian
Definition at line 93 of file jacobian_workspace.h.
Referenced by allocate(), and updateSize().
|
protected |
the maximum number of vertices connected by a hyper-edge
Definition at line 92 of file jacobian_workspace.h.
Referenced by allocate(), and updateSize().
|
protected |
the memory pre-allocated for computing the Jacobians
Definition at line 91 of file jacobian_workspace.h.
Referenced by allocate().