g2o
Toggle main menu visibility
Loading...
Searching...
No Matches
g2o
core
base_variable_sized_edge.h
Go to the documentation of this file.
1
// g2o - General Graph Optimization
2
// Copyright (C) 2011 R. Kuemmerle, G. Grisetti, H. Strasdat, W. Burgard
3
// All rights reserved.
4
//
5
// Redistribution and use in source and binary forms, with or without
6
// modification, are permitted provided that the following conditions are
7
// met:
8
//
9
// * Redistributions of source code must retain the above copyright notice,
10
// this list of conditions and the following disclaimer.
11
// * Redistributions in binary form must reproduce the above copyright
12
// notice, this list of conditions and the following disclaimer in the
13
// documentation and/or other materials provided with the distribution.
14
//
15
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
16
// IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17
// TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
18
// PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19
// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
21
// TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
22
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
23
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27
#ifndef G2O_BASE_VARIABLE_SIZED_EDGE_H
28
#define G2O_BASE_VARIABLE_SIZED_EDGE_H
29
30
#include <iomanip>
31
#include <iostream>
32
#include <limits>
33
34
#include "
base_edge.h
"
35
#include "
g2o/autodiff/fixed_array.h
"
36
#include "g2o/config.h"
37
#include "
g2o/stuff/misc.h
"
38
#include "
robust_kernel.h
"
39
40
namespace
g2o
{
41
49
template
<
int
D,
typename
E>
50
class
BaseVariableSizedEdge
:
public
BaseEdge
<D, E> {
51
public
:
53
* \brief helper for mapping the Hessian memory of the upper triangular block
54
*/
55
struct
HessianHelper
{
56
Eigen::Map<MatrixX>
matrix
;
57
bool
transposed
;
58
HessianHelper
() :
matrix
(0, 0, 0),
transposed
(false) {}
59
};
60
61
public
:
62
static
constexpr
int
Dimension
=
BaseEdge<D, E>::Dimension
;
63
typedef
typename
BaseEdge<D, E>::Measurement
Measurement
;
64
typedef
MatrixX::MapType
JacobianType
;
65
typedef
typename
BaseEdge<D, E>::ErrorVector
ErrorVector
;
66
typedef
typename
BaseEdge<D, E>::InformationType
InformationType
;
67
typedef
Eigen::Map<
MatrixX
, MatrixX::Flags & Eigen::PacketAccessBit
68
? Eigen::Aligned
69
: Eigen::Unaligned>
70
HessianBlockType
;
71
72
BaseVariableSizedEdge
() :
BaseEdge
<D, E>() {}
73
74
virtual
void
linearizeOplus
(
JacobianWorkspace
& jacobianWorkspace);
75
80
virtual
void
linearizeOplus
();
81
82
virtual
void
resize
(
size_t
size);
83
84
virtual
bool
allVerticesFixed
()
const
;
85
86
virtual
void
constructQuadraticForm
();
87
88
virtual
void
mapHessianMemory
(
double
* d,
int
i,
int
j,
bool
rowMajor);
89
90
using
BaseEdge
<D, E>
::computeError
;
91
92
protected
:
93
using
BaseEdge
<D, E>
::_measurement
;
94
using
BaseEdge
<D, E>
::_information
;
95
using
BaseEdge
<D, E>
::_error
;
96
using
BaseEdge
<D, E>
::_vertices
;
97
using
BaseEdge
<D, E>
::_dimension
;
98
99
std::vector<HessianHelper>
_hessian
;
100
std::vector<JacobianType>
101
_jacobianOplus
;
102
103
void
computeQuadraticForm
(
const
InformationType
& omega,
104
const
ErrorVector
& weightedError);
105
106
public
:
107
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
108
};
109
110
#include "
base_variable_sized_edge.hpp
"
111
112
}
// end namespace g2o
113
114
#endif
base_edge.h
base_variable_sized_edge.hpp
g2o::BaseEdge::Measurement
E Measurement
Definition
base_edge.h:89
g2o::BaseEdge< D, VectorX >::_information
InformationType _information
Definition
base_edge.h:147
g2o::BaseEdge::BaseEdge
BaseEdge()
Definition
base_edge.h:93
g2o::BaseEdge::ErrorVector
internal::BaseEdgeTraits< D >::ErrorVector ErrorVector
Definition
base_edge.h:90
g2o::BaseEdge::InformationType
internal::BaseEdgeTraits< D >::InformationType InformationType
Definition
base_edge.h:91
g2o::BaseEdge::Dimension
static constexpr int Dimension
Definition
base_edge.h:88
g2o::BaseEdge< D, VectorX >::_measurement
Measurement _measurement
Definition
base_edge.h:146
g2o::BaseEdge< D, VectorX >::_error
ErrorVector _error
Definition
base_edge.h:149
g2o::BaseVariableSizedEdge::HessianBlockType
Eigen::Map< MatrixX, MatrixX::Flags &Eigen::PacketAccessBit ? Eigen::Aligned :Eigen::Unaligned > HessianBlockType
Definition
base_variable_sized_edge.h:70
g2o::BaseVariableSizedEdge::mapHessianMemory
virtual void mapHessianMemory(double *d, int i, int j, bool rowMajor)
Definition
base_variable_sized_edge.h:116
g2o::BaseVariableSizedEdge::linearizeOplus
virtual void linearizeOplus()
Definition
base_variable_sized_edge.h:67
g2o::BaseVariableSizedEdge::constructQuadraticForm
virtual void constructQuadraticForm()
Definition
base_variable_sized_edge.h:38
g2o::BaseVariableSizedEdge::JacobianType
MatrixX::MapType JacobianType
Definition
base_variable_sized_edge.h:64
g2o::BaseVariableSizedEdge::BaseVariableSizedEdge
BaseVariableSizedEdge()
Definition
base_variable_sized_edge.h:72
g2o::BaseVariableSizedEdge::resize
virtual void resize(size_t size)
Definition
base_variable_sized_edge.h:138
g2o::BaseVariableSizedEdge::allVerticesFixed
virtual bool allVerticesFixed() const
Definition
base_variable_sized_edge.h:148
g2o::BaseVariableSizedEdge::ErrorVector
BaseEdge< D, E >::ErrorVector ErrorVector
Definition
base_variable_sized_edge.h:65
g2o::BaseVariableSizedEdge::Measurement
BaseEdge< D, E >::Measurement Measurement
Definition
base_variable_sized_edge.h:63
g2o::BaseVariableSizedEdge::_jacobianOplus
std::vector< JacobianType > _jacobianOplus
jacobians of the edge (w.r.t. oplus)
Definition
base_variable_sized_edge.h:101
g2o::BaseVariableSizedEdge::_hessian
std::vector< HessianHelper > _hessian
Definition
base_variable_sized_edge.h:99
g2o::BaseVariableSizedEdge::linearizeOplus
virtual void linearizeOplus(JacobianWorkspace &jacobianWorkspace)
Definition
base_variable_sized_edge.h:53
g2o::BaseVariableSizedEdge::InformationType
BaseEdge< D, E >::InformationType InformationType
Definition
base_variable_sized_edge.h:66
g2o::BaseVariableSizedEdge::Dimension
static constexpr int Dimension
Definition
base_variable_sized_edge.h:62
g2o::BaseVariableSizedEdge::computeQuadraticForm
void computeQuadraticForm(const InformationType &omega, const ErrorVector &weightedError)
Definition
base_variable_sized_edge.h:158
g2o::HyperGraph::Edge::_vertices
VertexContainer _vertices
Definition
hyper_graph.h:221
g2o::JacobianWorkspace
provide memory workspace for computing the Jacobians
Definition
jacobian_workspace.h:53
g2o::OptimizableGraph::Edge::computeError
virtual void computeError()=0
g2o::OptimizableGraph::Edge::_dimension
int _dimension
Definition
optimizable_graph.h:547
fixed_array.h
misc.h
some general case utility functions
g2o
Definition
dl_wrapper.cpp:55
g2o::MatrixX
MatrixN< Eigen::Dynamic > MatrixX
Definition
eigen_types.h:74
robust_kernel.h
g2o::BaseVariableSizedEdge::HessianHelper::transposed
bool transposed
the block has to be transposed
Definition
base_variable_sized_edge.h:57
g2o::BaseVariableSizedEdge::HessianHelper::HessianHelper
HessianHelper()
Definition
base_variable_sized_edge.h:58
g2o::BaseVariableSizedEdge::HessianHelper::matrix
Eigen::Map< MatrixX > matrix
the mapped memory
Definition
base_variable_sized_edge.h:56
Generated on
for g2o by
1.17.0