g2o
Loading...
Searching...
No Matches
g2o::JacobianWorkspace Class Reference

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

Detailed Description

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.

Member Typedef Documentation

◆ WorkspaceVector

Definition at line 55 of file jacobian_workspace.h.

Constructor & Destructor Documentation

◆ JacobianWorkspace()

g2o::JacobianWorkspace::JacobianWorkspace ( )

Definition at line 38 of file jacobian_workspace.cpp.

References _maxDimension, and _maxNumVertices.

◆ ~JacobianWorkspace()

g2o::JacobianWorkspace::~JacobianWorkspace ( )

Definition at line 41 of file jacobian_workspace.cpp.

Member Function Documentation

◆ allocate()

bool g2o::JacobianWorkspace::allocate ( )

allocate the workspace

Definition at line 43 of file jacobian_workspace.cpp.

References _maxDimension, _maxNumVertices, and _workspace.

Referenced by g2o::StructureOnlySolver< PointDoF >::calc().

◆ setZero()

void g2o::JacobianWorkspace::setZero ( )

set the full workspace to zero

Definition at line 54 of file jacobian_workspace.cpp.

References _workspace.

◆ updateSize() [1/4]

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::Edge::dimension(), g2o::OptimizableGraph::Vertex::dimension(), and g2o::HyperGraph::Edge::vertices().

◆ updateSize() [2/4]

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::StructureOnlySolver< PointDoF >::calc(), g2o::BaseDynamicVertex< T >::setDimension(), updateSize(), and updateSize().

◆ updateSize() [3/4]

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().

◆ updateSize() [4/4]

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.

◆ workspaceForVertex()

double * g2o::JacobianWorkspace::workspaceForVertex ( int vertexIndex)
inline

Member Data Documentation

◆ _maxDimension

int g2o::JacobianWorkspace::_maxDimension
protected

the maximum dimension (number of elements) for a Jacobian

Definition at line 106 of file jacobian_workspace.h.

Referenced by allocate(), JacobianWorkspace(), updateSize(), updateSize(), updateSize(), and updateSize().

◆ _maxNumVertices

int g2o::JacobianWorkspace::_maxNumVertices
protected

the maximum number of vertices connected by a hyper-edge

Definition at line 104 of file jacobian_workspace.h.

Referenced by allocate(), JacobianWorkspace(), updateSize(), updateSize(), updateSize(), and updateSize().

◆ _workspace

WorkspaceVector g2o::JacobianWorkspace::_workspace
protected

the memory pre-allocated for computing the Jacobians

Definition at line 103 of file jacobian_workspace.h.

Referenced by allocate(), setZero(), and workspaceForVertex().


The documentation for this class was generated from the following files: