Go to the documentation of this file.
28 throw std::runtime_error(
"NonlinearFactor::error is not implemented");
39 std::cout <<
s <<
" keys = { ";
41 std::cout << keyFormatter(
key) <<
" ";
43 std::cout <<
"}" << std::endl;
53 const std::map<Key, Key>& rekey_mapping)
const {
55 for (
size_t i = 0;
i < new_factor->size(); ++
i) {
56 Key& cur_key = new_factor->keys()[
i];
57 std::map<Key, Key>::const_iterator mapping = rekey_mapping.find(cur_key);
58 if (mapping != rekey_mapping.end())
59 cur_key = mapping->second;
67 assert(new_keys.size() ==
keys().
size());
69 new_factor->keys() = new_keys;
94 new_factor->noiseModel_ = newNoise;
100 if (noiseModel &&
m != noiseModel->dim()) {
101 throw std::invalid_argument(
102 "NoiseModelFactor: NoiseModel has dimension " +
103 std::to_string(noiseModel->dim()) +
104 " instead of " + std::to_string(
m) +
".");
145 return 0.5 *
b.squaredNorm();
157 return std::shared_ptr<JacobianFactor>();
160 std::vector<Matrix>
A(
size());
169 std::vector<std::pair<Key, Matrix> > terms(
size());
170 for (
size_t j = 0;
j <
size(); ++
j) {
171 terms[
j].first =
keys()[
j];
172 terms[
j].second.swap(
A[
j]);
180 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 Sun Dec 22 2024 04:12:23