Go to the documentation of this file.
26 throw std::runtime_error(
"NonlinearFactor::error is not implemented");
37 std::cout <<
s <<
" keys = { ";
39 std::cout << keyFormatter(
key) <<
" ";
41 std::cout <<
"}" << std::endl;
51 const std::map<Key, Key>& rekey_mapping)
const {
53 for (
size_t i = 0;
i < new_factor->size(); ++
i) {
54 Key& cur_key = new_factor->keys()[
i];
55 std::map<Key, Key>::const_iterator mapping = rekey_mapping.find(cur_key);
56 if (mapping != rekey_mapping.end())
57 cur_key = mapping->second;
65 assert(new_keys.size() ==
keys().
size());
67 new_factor->keys() = new_keys;
92 new_factor->noiseModel_ = newNoise;
98 if (noiseModel &&
m != noiseModel->dim()) {
99 throw std::invalid_argument(
100 "NoiseModelFactor: NoiseModel has dimension " +
101 std::to_string(noiseModel->dim()) +
102 " instead of " + std::to_string(
m) +
".");
143 return 0.5 *
b.squaredNorm();
155 return std::shared_ptr<JacobianFactor>();
158 std::vector<Matrix>
A(
size());
167 std::vector<std::pair<Key, Matrix> > terms(
size());
168 for (
size_t j = 0;
j <
size(); ++
j) {
169 terms[
j].first =
keys()[
j];
170 terms[
j].second.swap(
A[
j]);
178 std::static_pointer_cast<Constrained>(
noiseModel_)->unit()));
std::shared_ptr< This > shared_ptr
Array< double, 1, 3 > e(1./3., 0.5, 2.)
double error(const Values &c) const override
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
virtual bool equals(const NonlinearFactor &f, double tol=1e-9) const
std::shared_ptr< This > shared_ptr
virtual shared_ptr rekey(const std::map< Key, Key > &rekey_mapping) const
SharedNoiseModel noiseModel_
std::shared_ptr< Factor > shared_ptr
A shared_ptr to this class.
virtual bool active(const Values &) const
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
std::shared_ptr< GaussianFactor > linearize(const Values &x) const override
Vector whitenedError(const Values &c) const
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
const Values & nonlinear() const
Return the nonlinear values.
std::shared_ptr< This > shared_ptr
shared_ptr to this class
static void check(const SharedNoiseModel &noiseModel, size_t m)
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
bool equals(const NonlinearFactor &f, double tol=1e-9) const override
double weight(const Values &c) const
noiseModel::Base::shared_ptr SharedNoiseModel
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
const gtsam::Symbol key('X', 0)
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Vector unweightedWhitenedError(const Values &c) const
Non-linear factor base classes.
shared_ptr cloneWithNewNoiseModel(const SharedNoiseModel newNoise) const
const KeyVector & keys() const
Access the factor's involved variable keys.
bool equals(const This &other, double tol=1e-9) const
check equality
std::uint64_t Key
Integer nonlinear key type.
virtual shared_ptr clone() const
virtual Vector unwhitenedError(const Values &x, OptionalMatrixVecType H=nullptr) const =0
virtual double error(const Values &c) const
gtsam
Author(s):
autogenerated on Fri Nov 1 2024 03:33:50