24 #include <gtsam/dllexport.h> 26 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 27 #include <boost/serialization/extended_type_info.hpp> 28 #include <boost/serialization/nvp.hpp> 29 #include <boost/serialization/version.hpp> 30 #include <boost/serialization/optional.hpp> 31 #include <boost/serialization/shared_ptr.hpp> 32 #include <boost/serialization/singleton.hpp> 36 namespace noiseModel {
57 namespace mEstimator {
108 virtual double weight(
double distance)
const = 0;
110 virtual void print(
const std::string &
s)
const = 0;
124 void reweight(
Vector &error)
const;
125 void reweight(std::vector<Matrix> &
A,
Vector &error)
const;
131 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 133 friend class boost::serialization::access;
134 template <
class ARCHIVE>
135 void serialize(ARCHIVE &ar,
const unsigned int ) {
136 ar &BOOST_SERIALIZATION_NVP(reweight_);
156 double weight(
double )
const override {
return 1.0; }
158 void print(
const std::string &
s)
const override;
159 bool equals(
const Base & ,
double )
const override {
return true; }
160 static shared_ptr Create();
163 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 165 friend class boost::serialization::access;
166 template <
class ARCHIVE>
167 void serialize(ARCHIVE &ar,
const unsigned int ) {
168 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
189 double weight(
double distance)
const override;
190 double loss(
double distance)
const override;
191 void print(
const std::string &
s)
const override;
193 static shared_ptr Create(
double c,
const ReweightScheme reweight = Block);
197 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 199 friend class boost::serialization::access;
200 template <
class ARCHIVE>
201 void serialize(ARCHIVE &ar,
const unsigned int ) {
202 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
203 ar &BOOST_SERIALIZATION_NVP(c_);
224 double weight(
double distance)
const override;
225 double loss(
double distance)
const override;
226 void print(
const std::string &
s)
const override;
228 static shared_ptr Create(
double k,
const ReweightScheme reweight = Block);
232 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 234 friend class boost::serialization::access;
235 template <
class ARCHIVE>
236 void serialize(ARCHIVE &ar,
const unsigned int ) {
237 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
238 ar &BOOST_SERIALIZATION_NVP(k_);
264 double weight(
double distance)
const override;
265 double loss(
double distance)
const override;
266 void print(
const std::string &
s)
const override;
268 static shared_ptr Create(
double k,
const ReweightScheme reweight = Block);
272 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 274 friend class boost::serialization::access;
275 template <
class ARCHIVE>
276 void serialize(ARCHIVE &ar,
const unsigned int ) {
277 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
278 ar &BOOST_SERIALIZATION_NVP(k_);
279 ar &BOOST_SERIALIZATION_NVP(ksquared_);
300 double weight(
double distance)
const override;
301 double loss(
double distance)
const override;
302 void print(
const std::string &
s)
const override;
304 static shared_ptr Create(
double k,
const ReweightScheme reweight = Block);
308 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 310 friend class boost::serialization::access;
311 template <
class ARCHIVE>
312 void serialize(ARCHIVE &ar,
const unsigned int ) {
313 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
314 ar &BOOST_SERIALIZATION_NVP(c_);
335 double weight(
double distance)
const override;
336 double loss(
double distance)
const override;
337 void print(
const std::string &
s)
const override;
339 static shared_ptr Create(
double k,
const ReweightScheme reweight = Block);
343 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 345 friend class boost::serialization::access;
346 template <
class ARCHIVE>
347 void serialize(ARCHIVE &ar,
const unsigned int ) {
348 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
349 ar &BOOST_SERIALIZATION_NVP(c_);
350 ar &BOOST_SERIALIZATION_NVP(csquared_);
371 double weight(
double distance)
const override;
372 double loss(
double distance)
const override;
373 void print(
const std::string &
s)
const override;
375 static shared_ptr Create(
double k,
const ReweightScheme reweight = Block);
382 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 384 friend class boost::serialization::access;
385 template <
class ARCHIVE>
386 void serialize(ARCHIVE &ar,
const unsigned int ) {
387 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
388 ar &BOOST_SERIALIZATION_NVP(c_);
411 double weight(
double distance)
const override;
412 double loss(
double distance)
const override;
413 void print(
const std::string &
s)
const override;
415 static shared_ptr Create(
double k,
const ReweightScheme reweight = Block);
422 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 424 friend class boost::serialization::access;
425 template <
class ARCHIVE>
426 void serialize(ARCHIVE &ar,
const unsigned int ) {
427 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
428 ar &BOOST_SERIALIZATION_NVP(c_);
454 double weight(
double distance)
const override;
455 double loss(
double distance)
const override;
456 void print(
const std::string &
s)
const override;
458 static shared_ptr Create(
double k,
const ReweightScheme reweight = Block);
462 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 464 friend class boost::serialization::access;
465 template <
class ARCHIVE>
466 void serialize(ARCHIVE &ar,
const unsigned int ) {
467 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
468 ar &BOOST_SERIALIZATION_NVP(k_);
void print(const Matrix &A, const string &s, ostream &stream)
std::shared_ptr< L2WithDeadZone > shared_ptr
double modelParameter() const
std::shared_ptr< DCS > shared_ptr
ReweightScheme reweightScheme() const
Returns the reweight scheme, as explained in ReweightScheme.
Concept check for values that can be used in unit tests.
std::shared_ptr< Tukey > shared_ptr
double modelParameter() const
std::string serialize(const T &input)
serializes to a string
double modelParameter() const
std::shared_ptr< Null > shared_ptr
std::shared_ptr< Base > shared_ptr
Double_ distance(const OrientedPlane3_ &p)
double modelParameter() const
bool equals(const Base &, double) const override
ReweightScheme reweight_
Strategy for reweighting.
double modelParameter() const
double modelParameter() const
double modelParameter() const
Base(const ReweightScheme reweight=Block)
double sqrtWeight(double distance) const
Array< double, 1, 3 > e(1./3., 0.5, 2.)
std::shared_ptr< Welsch > shared_ptr
std::shared_ptr< Fair > shared_ptr
double weight(double) const override
std::shared_ptr< GemanMcClure > shared_ptr
virtual double loss(double distance) const
std::shared_ptr< Huber > shared_ptr
double loss(double distance) const override
Jet< T, N > sqrt(const Jet< T, N > &f)
std::shared_ptr< Cauchy > shared_ptr
double modelParameter() const
Null(const ReweightScheme reweight=Block)