Go to the documentation of this file.
74 const std::vector<Matrix>& Gs,
const std::vector<Vector>& gs,
double f) :
96 HessianFactor(
j1, j2, j3, G11, G12, G13,
g1, G22, G23,
g2, G33, g3,
f) {
107 template<
typename KEYS>
160 throw std::invalid_argument(
161 "RegularHessianFactor constructor was given non-regular factors or "
162 "incorrect template dimension D");
172 mutable std::vector<VectorD, Eigen::aligned_allocator<VectorD>>
y_;
203 double* yvalues)
const {
205 const size_t n =
size();
206 if (
y_.size() !=
n) {
215 for (
DenseIndex j = 0; j < static_cast<DenseIndex>(
n); ++
j) {
227 for (
i =
j + 1; i < static_cast<DenseIndex>(
n); ++
i) {
233 for (
DenseIndex i = 0; i < static_cast<DenseIndex>(
n); ++
i) {
235 DMap map_yi(yvalues + key_i *
D);
253 const std::vector<size_t>&
offsets)
const {
255 const size_t n =
size();
256 if (
y_.size() !=
n) {
263 for (
DenseIndex j = 0; j < static_cast<DenseIndex>(
n); ++
j) {
265 size_t offset_j =
offsets[key_j];
267 size_t dim_j =
offsets[key_j + 1] - offset_j;
268 if (dim_j !=
D)
throw std::runtime_error(
"RegularHessianFactor::multiplyHessianAdd: Mismatched dimension in offset map.");
279 for (
i =
j + 1; i < static_cast<DenseIndex>(
n); ++
i) {
285 for (
DenseIndex i = 0; i < static_cast<DenseIndex>(
n); ++
i) {
287 size_t offset_i =
offsets[key_i];
288 size_t dim_i =
offsets[key_i + 1] - offset_i;
289 if (dim_i !=
D)
throw std::runtime_error(
"RegularHessianFactor::multiplyHessianAdd: Mismatched dimension in offset map.");
290 DMap map_yi(yvalues + offset_i);
304 const size_t n =
size();
323 const size_t n =
size();
337 RegularHessianFactor<D> > {
Eigen::Map< VectorD > DMap
RegularHessianFactor(Key j1, Key j2, const MatrixD &G11, const MatrixD &G12, const VectorD &g1, const MatrixD &G22, const VectorD &g2, double f)
Matrix augmentedInformation() const override
A Gaussian factor using the canonical parameters (information form)
static const double d[K][N]
Pose3 g1(Rot3(), Point3(100.0, 0.0, 300.0))
A HessianFactor where all variables have the same dimension D.
const GaussianFactorGraph factors
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Contains the HessianFactor class, a general quadratic factor.
void multiplyHessianAdd(double alpha, const VectorValues &x, VectorValues &y) const override
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
void checkInvariants() const
Check if the factor has regular block structure.
SymmetricBlockMatrix info_
The full augmented information matrix, s.t. the quadratic error is 0.5*[x -1]'H[x -1].
RegularHessianFactor(const RegularJacobianFactor< D > &jf)
Construct a RegularHessianFactor from a RegularJacobianFactor.
void hessianDiagonal(double *d) const override
Return the diagonal of the Hessian for this factor (Raw memory version).
Pose3 g2(g1.expmap(h *V1_g1))
RegularHessianFactor(Key j1, Key j2, Key j3, const MatrixD &G11, const MatrixD &G12, const MatrixD &G13, const VectorD &g1, const MatrixD &G22, const MatrixD &G23, const VectorD &g2, const MatrixD &G33, const VectorD &g3, double f)
JacobianFactor class with fixed sized blcoks.
DenseIndex nBlocks() const
Block count.
A matrix or vector expression mapping an existing array of data.
Eigen::Map< const VectorD > ConstDMap
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Eigen::Matrix< double, D, 1 > VectorD
std::vector< VectorD, Eigen::aligned_allocator< VectorD > > y_
DenseIndex cols() const
Column size.
void multiplyHessianAdd(double alpha, const double *x, double *yvalues) const
Multiply the Hessian part of the factor times a raw vector x and add the result to y....
KeyVector keys_
The keys involved in this factor.
const KeyVector & keys() const
Access the factor's involved variable keys.
ptrdiff_t DenseIndex
The index type for Eigen objects.
void gradientAtZero(double *d) const override
Add the gradient vector (gradient at zero) to a raw memory block d.
RegularHessianFactor(const KeyVector &js, const std::vector< Matrix > &Gs, const std::vector< Vector > &gs, double f)
Construct an n-way factor from supplied components.
Vector diagonal(DenseIndex J) const
Get the diagonal of the J'th diagonal block.
Eigen::SelfAdjointView< Block, Eigen::Upper > diagonalBlock(DenseIndex J)
Return the J'th diagonal block as a self adjoint view.
RegularHessianFactor(const KEYS &keys, const SymmetricBlockMatrix &augmentedInformation)
Constructor with an arbitrary number of keys and the augmented information matrix specified as a bloc...
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy y set format x g set format y g set format x2 g set format y2 g set format z g set angles radians set nogrid set key title set key left top Right noreverse box linetype linewidth samplen spacing width set nolabel set noarrow set nologscale set logscale x set offsets
RegularHessianFactor(const GaussianFactorGraph &factors, const Scatter &scatter)
Construct from a GaussianFactorGraph combined using a Scatter.
void multiplyHessianAdd(double alpha, const VectorValues &x, VectorValues &y) const override
Multiply the Hessian part of the factor times a VectorValues x and add the result to y.
The matrix class, also used for vectors and row-vectors.
void multiplyHessianAdd(double alpha, const double *x, double *yvalues, const std::vector< size_t > &offsets) const
Multiply the Hessian part of the factor times a raw vector x and add the result to y.
Eigen::Matrix< double, D, D > MatrixD
constBlock aboveDiagonalBlock(DenseIndex I, DenseIndex J) const
Get block above the diagonal (I, J).
std::uint64_t Key
Integer nonlinear key type.
RegularHessianFactor(const GaussianFactorGraph &factors)
Construct from a GaussianFactorGraph.
gtsam
Author(s):
autogenerated on Wed May 28 2025 03:02:57