gtsam
nonlinear
internal
JacobianMap.h
Go to the documentation of this file.
1
/* ----------------------------------------------------------------------------
2
3
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
4
* Atlanta, Georgia 30332-0415
5
* All Rights Reserved
6
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7
8
* See LICENSE for the license information
9
10
* -------------------------------------------------------------------------- */
11
19
#pragma once
20
21
#include <
gtsam/inference/Key.h
>
22
#include <
gtsam/base/FastVector.h
>
23
#include <
gtsam/base/VerticalBlockMatrix.h
>
24
25
namespace
gtsam
{
26
namespace
internal
{
27
28
// A JacobianMap is the primary mechanism by which derivatives are returned.
29
// Expressions are designed to write their derivatives into an already allocated
30
// Jacobian of the correct size, of type VerticalBlockMatrix.
31
// The JacobianMap provides a mapping from keys to the underlying blocks.
32
class
JacobianMap
{
33
private
:
34
const
KeyVector
&
keys_
;
35
VerticalBlockMatrix
&
Ab_
;
36
37
public
:
39
JacobianMap
(
const
KeyVector
&
keys
,
VerticalBlockMatrix
&
Ab
) :
40
keys_(keys), Ab_(Ab) {
41
}
42
44
VerticalBlockMatrix::Block
operator()
(
Key
key
) {
45
KeyVector::const_iterator it = std::find(keys_.begin(), keys_.end(),
key
);
46
DenseIndex
block
= it - keys_.begin();
47
return
Ab_
(block);
48
}
49
};
50
51
}
// namespace internal
52
}
// namespace gtsam
53
key
const gtsam::Symbol key('X', 0)
block
m m block(1, 0, 2, 2)<< 4
gtsam::VerticalBlockMatrix
Definition:
VerticalBlockMatrix.h:42
VerticalBlockMatrix.h
A matrix with column blocks of pre-defined sizes. Used in JacobianFactor and GaussianConditional.
gtsam::internal::JacobianMap::JacobianMap
JacobianMap(const KeyVector &keys, VerticalBlockMatrix &Ab)
Construct a JacobianMap for writing into a VerticalBlockMatrix Ab.
Definition:
JacobianMap.h:39
Key.h
gtsam::DenseIndex
ptrdiff_t DenseIndex
The index type for Eigen objects.
Definition:
types.h:108
gtsam::internal::JacobianMap
Definition:
JacobianMap.h:32
exampleQR::Ab
Matrix Ab
Definition:
testNoiseModel.cpp:206
gtsam::internal::JacobianMap::operator()
VerticalBlockMatrix::Block operator()(Key key)
Access blocks of via key.
Definition:
JacobianMap.h:44
FastVector.h
A thin wrapper around std::vector that uses a custom allocator.
gtsam
traits
Definition:
chartTesting.h:28
gtsam::internal::JacobianMap::keys_
const KeyVector & keys_
Definition:
JacobianMap.h:34
internal
Definition:
BandTriangularSolver.h:13
Eigen::Block
Expression of a fixed-size or dynamic-size block.
Definition:
Block.h:103
keys
const KeyVector keys
Definition:
testRegularImplicitSchurFactor.cpp:40
gtsam::KeyVector
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition:
Key.h:86
gtsam::internal::JacobianMap::Ab_
VerticalBlockMatrix & Ab_
Definition:
JacobianMap.h:35
gtsam::Key
std::uint64_t Key
Integer nonlinear key type.
Definition:
types.h:102
gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:34:27