27#ifndef G2O_BASE_VERTEX_H
28#define G2O_BASE_VERTEX_H
30#include <Eigen/Cholesky>
41#define G2O_VERTEX_DIM ((D == Eigen::Dynamic) ? _dimension : D)
50template <
int D,
typename T>
60 Eigen::Map<Eigen::Matrix<double, D, D, Eigen::ColMajor>,
61 Eigen::Matrix<double, D, D, Eigen::ColMajor>::Flags &
62 Eigen::PacketAccessBit
71 virtual const double&
hessian(
int i,
int j)
const {
84 virtual int copyB(
double* b_)
const {
86 memcpy(b_,
_b.data(), vertexDim *
sizeof(
double));
90 virtual const double&
b(
int i)
const {
94 virtual double&
b(
int i) {
98 virtual double*
bData() {
return _b.data(); }
104 inline virtual double solveDirect(
double lambda = 0);
107 Eigen::Matrix<double, D, 1, Eigen::ColMajor>&
b() {
return _b; }
108 const Eigen::Matrix<double, D, 1, Eigen::ColMajor>&
b()
const {
return _b; }
136 Eigen::Matrix<double, D, 1, Eigen::ColMajor>
_b;
141 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
virtual double solveDirect(double lambda=0)
virtual double hessianDeterminant() const
BaseVertex & operator=(const BaseVertex &)=delete
virtual void clearQuadraticForm()
virtual double & b(int i)
Eigen::Matrix< double, D, 1, Eigen::ColMajor > _b
BaseVertex(const BaseVertex &)=delete
Eigen::Matrix< double, D, 1, Eigen::ColMajor > & b()
return right hand side b of the constructed linear system
virtual int copyB(double *b_) const
const HessianBlockType & A() const
virtual void mapHessianMemory(double *d)
virtual double * bData()
return a pointer to the b vector associated with this vertex
virtual double * hessianData()
virtual void discardTop()
virtual int stackSize() const
return the stack size
const EstimateType & estimate() const
return the current estimate of the vertex
std::stack< EstimateType, std::vector< EstimateType > > BackupStackType
static const int Dimension
dimension of the estimate (minimal) in the manifold space
Eigen::Map< Eigen::Matrix< double, D, D, Eigen::ColMajor >, Eigen::Matrix< double, D, D, Eigen::ColMajor >::Flags &Eigen::PacketAccessBit ? Eigen::Aligned :Eigen::Unaligned > HessianBlockType
virtual double & hessian(int i, int j)
void setEstimate(const EstimateType &et)
set the estimate for the vertex also calls updateCache()
virtual const double & hessian(int i, int j) const
get the element from the hessian matrix
HessianBlockType & A()
return the hessian block associated with the vertex
virtual void push()
backup the position of the vertex to a stack
virtual const double & b(int i) const
get the b vector element
const Eigen::Matrix< double, D, 1, Eigen::ColMajor > & b() const
HessianBlockType _hessian
A general case Vertex for optimization.
virtual void updateCache()