32 typedef Eigen::Matrix<double, D, 1> VectorD;
33 typedef Eigen::Matrix<double, D, D> MatrixD;
40 const std::vector<Matrix>& Gs,
const std::vector<Vector>& gs,
double f) :
50 const VectorD& g1,
const MatrixD& G22,
const VectorD& g2,
double f) :
59 const MatrixD& G11,
const MatrixD& G12,
const MatrixD& G13,
const VectorD& g1,
60 const MatrixD& G22,
const MatrixD& G23,
const VectorD& g2,
61 const MatrixD& G33,
const VectorD& g3,
double f) :
62 HessianFactor(j1, j2, j3, G11, G12, G13, g1, G22, G23, g2, G33, g3, f) {
67 template<
typename KEYS>
94 void checkInvariants() {
96 throw std::invalid_argument(
97 "RegularHessianFactor constructor was given non-regular factors");
101 typedef Eigen::Map<VectorD> DMap;
102 typedef Eigen::Map<const VectorD> ConstDMap;
107 mutable std::vector<VectorD> y_;
119 double* yvalues)
const {
122 for(VectorD & yi: y_)
131 const double* xj = x + key * D;
145 DMap(yvalues + key * D) += alpha * y_[i];
151 std::vector<size_t> offsets)
const {
155 for(VectorD & yi: y_)
165 * ConstDMap(x + offsets[
keys_[j]],
169 * ConstDMap(x + offsets[
keys_[j]],
174 * ConstDMap(x + offsets[
keys_[j]],
180 DMap(yvalues + offsets[
keys_[i]],
181 offsets[
keys_[i] + 1] - offsets[
keys_[i]]) += alpha * y_[i];
213 RegularHessianFactor<D> > {
Contains the HessianFactor class, a general quadratic factor.
JacobianFactor class with fixed sized blcoks.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:86
ptrdiff_t DenseIndex
The index type for Eigen objects.
Definition: types.h:75
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:69
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
Definition: SymmetricBlockMatrix.h:52
Vector diagonal(DenseIndex J) const
Get the diagonal of the J'th diagonal block.
Definition: SymmetricBlockMatrix.h:150
DenseIndex cols() const
Column size.
Definition: SymmetricBlockMatrix.h:122
constBlock aboveDiagonalBlock(DenseIndex I, DenseIndex J) const
Get block above the diagonal (I, J).
Definition: SymmetricBlockMatrix.h:155
Eigen::SelfAdjointView< Block, Eigen::Upper > diagonalBlock(DenseIndex J)
Return the J'th diagonal block as a self adjoint view.
Definition: SymmetricBlockMatrix.h:140
DenseIndex nBlocks() const
Block count.
Definition: SymmetricBlockMatrix.h:125
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:151
const KeyVector & keys() const
Access the factor's involved variable keys.
Definition: Factor.h:125
KeyVector keys_
The keys involved in this factor.
Definition: Factor.h:73
size_t size() const
Definition: Factor.h:136
A Linear Factor Graph is a factor graph where all factors are Gaussian, i.e.
Definition: GaussianFactorGraph.h:69
A Gaussian factor using the canonical parameters (information form)
Definition: HessianFactor.h:101
Matrix augmentedInformation() const override
Return the augmented information matrix represented by this GaussianFactor.
Definition: HessianFactor.cpp:281
SymmetricBlockMatrix info_
The full augmented information matrix, s.t. the quadratic error is 0.5*[x -1]'H[x -1].
Definition: HessianFactor.h:104
void multiplyHessianAdd(double alpha, const VectorValues &x, VectorValues &y) const override
y += alpha * A'*A*x
Definition: HessianFactor.cpp:390
Definition: RegularHessianFactor.h:28
RegularHessianFactor(const GaussianFactorGraph &factors)
Construct from a GaussianFactorGraph.
Definition: RegularHessianFactor.h:86
void multiplyHessianAdd(double alpha, const VectorValues &x, VectorValues &y) const override
y += alpha * A'*A*x
Definition: RegularHessianFactor.h:112
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)
Construct a ternary factor.
Definition: RegularHessianFactor.h:58
void multiplyHessianAdd(double alpha, const double *x, double *yvalues, std::vector< size_t > offsets) const
Raw memory version, with offsets TODO document reasoning.
Definition: RegularHessianFactor.h:150
void multiplyHessianAdd(double alpha, const double *x, double *yvalues) const
y += alpha * A'*A*x
Definition: RegularHessianFactor.h:118
void hessianDiagonal(double *d) const override
Return the diagonal of the Hessian for this factor (raw memory version)
Definition: RegularHessianFactor.h:185
RegularHessianFactor(const KEYS &keys, const SymmetricBlockMatrix &augmentedInformation)
Constructor with an arbitrary number of keys and with the augmented information matrix specified as a...
Definition: RegularHessianFactor.h:68
void gradientAtZero(double *d) const override
Add gradient at zero to d TODO: is it really the goal to add ??
Definition: RegularHessianFactor.h:196
RegularHessianFactor(const GaussianFactorGraph &factors, const Scatter &scatter)
Construct from a GaussianFactorGraph.
Definition: RegularHessianFactor.h:79
RegularHessianFactor(const KeyVector &js, const std::vector< Matrix > &Gs, const std::vector< Vector > &gs, double f)
Construct an n-way factor.
Definition: RegularHessianFactor.h:39
RegularHessianFactor(Key j1, Key j2, const MatrixD &G11, const MatrixD &G12, const VectorD &g1, const MatrixD &G22, const VectorD &g2, double f)
Construct a binary factor.
Definition: RegularHessianFactor.h:49
RegularHessianFactor(const RegularJacobianFactor< D > &jf)
Construct from RegularJacobianFactor.
Definition: RegularHessianFactor.h:75
JacobianFactor with constant sized blocks Provides raw memory access versions of linear operator.
Definition: RegularJacobianFactor.h:32
Scatter is an intermediate data structure used when building a HessianFactor incrementally,...
Definition: Scatter.h:49
This class represents a collection of vector-valued variables associated each with a unique integer i...
Definition: VectorValues.h:74