26 template<
typename TERMS>
33 template<
typename KEYS>
35 const KEYS& keys,
const VerticalBlockMatrix& augmentedMatrix,
const SharedDiagonal& model) :
36 Base(keys), Ab_(augmentedMatrix)
44 throw std::invalid_argument(
45 "Error in JacobianFactor constructor input. Number of provided keys plus\n" 46 "one for the RHS vector must equal the number of provided matrix blocks.");
49 if(augmentedMatrix(augmentedMatrix.
nBlocks() - 1).
cols() != 1)
50 throw std::invalid_argument(
51 "Error in JacobianFactor constructor input. The last provided matrix block\n" 52 "must be the RHS vector, but the last provided block had more than one column.");
59 template<
typename TERMS>
63 if(noiseModel && (
DenseIndex)noiseModel->dim() != b.size())
70 std::vector<size_t> dimensions;
71 dimensions.reserve(terms.size());
72 for(
typename TERMS::const_iterator it = terms.begin(); it != terms.end(); ++it) {
73 const std::pair<Key, Matrix>& term = *it;
74 const Matrix& Ai = term.second;
75 dimensions.push_back(Ai.cols());
83 for(
typename TERMS::const_iterator it = terms.begin(); it != terms.end(); ++it) {
84 const std::pair<Key, Matrix>& term = *it;
86 const Matrix& Ai = term.second;
89 if(Ai.rows() != Ab_.
rows())
This is the base class for all factor types.
Definition: Factor.h:54
ptrdiff_t DenseIndex
The index type for Eigen objects.
Definition: types.h:63
An exception indicating that the noise model dimension passed into a JacobianFactor has a different d...
Definition: linearExceptions.h:106
const constBVector getb() const
Get a view of the r.h.s.
Definition: JacobianFactor.h:264
JacobianFactor()
default constructor for I/O
Definition: JacobianFactor.cpp:60
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:57
Definition: VerticalBlockMatrix.h:41
size_t cols() const
return the number of columns in the corresponding linear system
Definition: JacobianFactor.h:255
DenseIndex nBlocks() const
Block count.
Definition: VerticalBlockMatrix.h:120
void fillTerms(const TERMS &terms, const Vector &b, const SharedDiagonal &noiseModel)
Internal function to fill blocks and set dimensions.
Definition: JacobianFactor-inl.h:60
Exceptions that may be thrown by linear solver components.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
DenseIndex rows() const
Row size.
Definition: VerticalBlockMatrix.h:114
KeyVector keys_
The keys involved in this factor.
Definition: Factor.h:72
An exception indicating that a matrix block passed into a JacobianFactor has a different dimensionali...
Definition: linearExceptions.h:124