25#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 13
26#pragma GCC diagnostic warning "-Wstringop-overread"
32 template <
typename TERMS>
34 const SharedDiagonal& model) {
39 template <
int M,
int N1,
typename>
41 const Eigen::Matrix<double, M, 1>& b,
42 const SharedDiagonal& model)
48 const std::array<size_t, 1> dims = {
49 static_cast<size_t>(A1.cols())};
50 Ab_ = VerticalBlockMatrix(dims, rows,
true);
57 template <
int M,
int N1,
int N2,
typename>
59 Key i2,
const Eigen::Matrix<double, M, N2>& A2,
60 const Eigen::Matrix<double, M, 1>& b,
61 const SharedDiagonal& model)
67 const std::array<size_t, 2> dims = {
68 static_cast<size_t>(A1.cols()),
69 static_cast<size_t>(A2.cols())};
70 Ab_ = VerticalBlockMatrix(dims, rows,
true);
78 template <
int M,
int N1,
int N2,
int N3,
typename>
80 Key i2,
const Eigen::Matrix<double, M, N2>& A2,
81 Key i3,
const Eigen::Matrix<double, M, N3>& A3,
82 const Eigen::Matrix<double, M, 1>& b,
83 const SharedDiagonal& model)
89 const std::array<size_t, 3> dims = {
90 static_cast<size_t>(A1.cols()),
91 static_cast<size_t>(A2.cols()),
92 static_cast<size_t>(A3.cols())};
93 Ab_ = VerticalBlockMatrix(dims, rows,
true);
102 template <
typename KEYS>
105 const SharedDiagonal& model)
106 :
Base(
keys), Ab_(augmentedMatrix), model_(model) {
107 checkAb(model, augmentedMatrix);
111 template <
typename KEYS>
114 const SharedDiagonal& model)
115 :
Base(
keys), Ab_(
std::move(augmentedMatrix)), model_(model) {
120 template<
typename TERMS>
131 std::vector<size_t> dimensions;
132 dimensions.reserve(terms.size());
133 for(
typename TERMS::const_iterator it = terms.begin(); it != terms.end(); ++it) {
134 const std::pair<Key, Matrix>& term = *it;
135 const Matrix& Ai = term.second;
136 dimensions.push_back(Ai.cols());
144 for(
typename TERMS::const_iterator it = terms.begin(); it != terms.end(); ++it) {
145 const std::pair<Key, Matrix>& term = *it;
146 Key key = term.first;
147 const Matrix& Ai = term.second;
150 if(Ai.rows() != Ab_.rows())
Exceptions that may be thrown by linear solver components.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
ptrdiff_t DenseIndex
The index type for Eigen objects.
Definition types.h:49
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:43
All noise models live in the noiseModel namespace.
Definition LossFunctions.cpp:33
This class stores a dense matrix and allows it to be accessed as a collection of vertical blocks.
Definition VerticalBlockMatrix.h:47
const KeyVector & keys() const
Access the factor's involved variable keys.
Definition Factor.h:143
KeyVector keys_
The keys involved in this factor.
Definition Factor.h:88
const constBVector getb() const
Get a view of the r.h.s.
Definition JacobianFactor.h:344
JacobianFactor()
default constructor for I/O
Definition JacobianFactor.cpp:48
void fillTerms(const TERMS &terms, const Vector &b, const SharedDiagonal &noiseModel)
Internal function to fill blocks and set dimensions.
Definition JacobianFactor-inl.h:121
GaussianFactor Base
Typedef to base class.
Definition JacobianFactor.h:96
void checkAb(const SharedDiagonal &model, const VerticalBlockMatrix &augmentedMatrix) const
Common code between VerticalBlockMatrix constructors.
Definition JacobianFactor.cpp:155
An exception indicating that the noise model dimension passed into a JacobianFactor has a different d...
Definition linearExceptions.h:128
An exception indicating that a matrix block passed into a JacobianFactor has a different dimensionali...
Definition linearExceptions.h:143