26#include <gtsam/dllexport.h>
28#if GTSAM_ENABLE_BOOST_SERIALIZATION
29#include <boost/serialization/extended_type_info.hpp>
30#include <boost/serialization/nvp.hpp>
31#include <boost/serialization/version.hpp>
32#include <boost/serialization/optional.hpp>
33#include <boost/serialization/shared_ptr.hpp>
34#include <boost/serialization/singleton.hpp>
81class GTSAM_EXPORT Base {
86 typedef std::shared_ptr<Base> shared_ptr;
112 virtual double loss(
double distance)
const {
return 0; }
124 virtual double weight(
double distance)
const = 0;
142 virtual void print(
const std::string &s)
const = 0;
143 virtual bool equals(
const Base &expected,
double tol = 1e-8)
const = 0;
145 double sqrtWeight(
double distance)
const {
return std::sqrt(
weight(distance)); }
149 Vector weight(
const Vector &error)
const;
152 Vector sqrtWeight(
const Vector &error)
const;
156 void reweight(Vector &error)
const;
157 void reweight(std::vector<Matrix> &A, Vector &error)
const;
158 void reweight(Matrix &A, Vector &error)
const;
159 void reweight(Matrix &A1, Matrix &A2, Vector &error)
const;
160 void reweight(Matrix &A1, Matrix &A2, Matrix &A3, Vector &error)
const;
163#if 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_NVP(reweight_);
182class GTSAM_EXPORT Null :
public Base {
184 typedef std::shared_ptr<Null> shared_ptr;
188 double weight(
double )
const override {
return 1.0; }
189 double loss(
double distance)
const override {
return 0.5 * distance * distance; }
192 void print(
const std::string &s)
const override;
193 bool equals(
const Base & ,
double )
const override {
return true; }
194 static shared_ptr Create();
197#if 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);
217class GTSAM_EXPORT Fair :
public Base {
222 typedef std::shared_ptr<Fair> shared_ptr;
225 double weight(
double distance)
const override;
226 double loss(
double distance)
const override;
229 void print(
const std::string &s)
const override;
230 bool equals(
const Base &expected,
double tol = 1e-8)
const override;
232 double modelParameter()
const {
return c_; }
235#if GTSAM_ENABLE_BOOST_SERIALIZATION
237 friend class boost::serialization::access;
238 template <
class ARCHIVE>
239 void serialize(ARCHIVE &ar,
const unsigned int ) {
240 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
241 ar &BOOST_SERIALIZATION_NVP(c_);
257class GTSAM_EXPORT Huber :
public Base {
262 typedef std::shared_ptr<Huber> shared_ptr;
265 double weight(
double distance)
const override;
266 double loss(
double distance)
const override;
268 double graduatedLoss(
double distance,
double mu)
const override;
269 void print(
const std::string &s)
const override;
270 bool equals(
const Base &expected,
double tol = 1e-8)
const override;
272 double modelParameter()
const {
return k_; }
275 static double Weight(
double distance,
double k);
277 static double Loss(
double distance,
double k);
280#if GTSAM_ENABLE_BOOST_SERIALIZATION
282 friend class boost::serialization::access;
283 template <
class ARCHIVE>
284 void serialize(ARCHIVE &ar,
const unsigned int ) {
285 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
286 ar &BOOST_SERIALIZATION_NVP(k_);
307class GTSAM_EXPORT Cauchy :
public Base {
309 double k_, ksquared_;
312 typedef std::shared_ptr<Cauchy> shared_ptr;
315 double weight(
double distance)
const override;
316 double loss(
double distance)
const override;
318 double graduatedLoss(
double distance,
double mu)
const override;
319 void print(
const std::string &s)
const override;
320 bool equals(
const Base &expected,
double tol = 1e-8)
const override;
322 double modelParameter()
const {
return k_; }
325 static double Weight(
double distance,
double ksquared);
327 static double Loss(
double distance,
double ksquared);
330#if GTSAM_ENABLE_BOOST_SERIALIZATION
332 friend class boost::serialization::access;
333 template <
class ARCHIVE>
334 void serialize(ARCHIVE &ar,
const unsigned int ) {
335 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
336 ar &BOOST_SERIALIZATION_NVP(k_);
337 ar &BOOST_SERIALIZATION_NVP(ksquared_);
353class GTSAM_EXPORT Tukey :
public Base {
355 double c_, csquared_;
358 typedef std::shared_ptr<Tukey> shared_ptr;
361 double weight(
double distance)
const override;
362 double loss(
double distance)
const override;
364 double graduatedLoss(
double distance,
double mu)
const override;
365 void print(
const std::string &s)
const override;
366 bool equals(
const Base &expected,
double tol = 1e-8)
const override;
368 double modelParameter()
const {
return c_; }
371 static double Weight(
double distance,
double c,
double csquared);
373 static double Loss(
double distance,
double c,
double csquared);
377#if GTSAM_ENABLE_BOOST_SERIALIZATION
379 friend class boost::serialization::access;
380 template <
class ARCHIVE>
381 void serialize(ARCHIVE &ar,
const unsigned int ) {
382 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
383 ar &BOOST_SERIALIZATION_NVP(c_);
399class GTSAM_EXPORT Welsch :
public Base {
401 double c_, csquared_;
405 typedef std::shared_ptr<Welsch> shared_ptr;
408 double weight(
double distance)
const override;
409 double loss(
double distance)
const override;
411 double graduatedLoss(
double distance,
double mu)
const override;
412 void print(
const std::string &s)
const override;
413 bool equals(
const Base &expected,
double tol = 1e-8)
const override;
415 double modelParameter()
const {
return c_; }
418 static double Weight(
double distance,
double csquared);
420 static double Loss(
double distance,
double csquared);
423#if GTSAM_ENABLE_BOOST_SERIALIZATION
425 friend class boost::serialization::access;
426 template <
class ARCHIVE>
427 void serialize(ARCHIVE &ar,
const unsigned int ) {
428 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
429 ar &BOOST_SERIALIZATION_NVP(c_);
430 ar &BOOST_SERIALIZATION_NVP(csquared_);
464 typedef std::shared_ptr<GemanMcClure> shared_ptr;
465 enum GradScheme { STANDARD, SCALE_INVARIANT };
473 double weight(
double distance)
const override;
474 double loss(
double distance)
const override;
476 double graduatedLoss(
double distance,
double mu)
const override;
477 void print(
const std::string &s)
const override;
478 bool equals(
const Base &expected,
double tol = 1e-8)
const override;
481 static shared_ptr Create(
double k,
const GradScheme graduation,
483 double modelParameter()
const {
return c_; }
488 static double Weight(
double distance2,
double c2);
490 static double Loss(
double distance2,
double c2);
492 static double GraduatedWeight(
double distance2,
double c2,
double mu,
493 GradScheme graduation);
495 static double GraduatedLoss(
double distance2,
double c2,
double mu,
496 GradScheme graduation);
509 static double ShapeParameterFromInfluenceThreshold(
510 double influenceThreshold,
size_t dof,
double chiSquaredOutlierThreshold);
515 GradScheme graduation_;
518#if GTSAM_ENABLE_BOOST_SERIALIZATION
520 friend class boost::serialization::access;
521 template <
class ARCHIVE>
522 void serialize(ARCHIVE &ar,
const unsigned int ) {
523 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
524 ar &BOOST_SERIALIZATION_NVP(c_);
525 ar &BOOST_SERIALIZATION_NVP(csquared_);
526 ar &BOOST_SERIALIZATION_NVP(graduation_);
575 typedef std::shared_ptr<TruncatedLeastSquares> shared_ptr;
576 enum GradScheme { STANDARD, GNC_LINEAR, GNC_SUPERLINEAR };
583 double weight(
double distance)
const override;
584 double loss(
double distance)
const override;
586 double graduatedLoss(
double distance,
double mu)
const override;
587 void print(
const std::string& s)
const override;
588 bool equals(
const Base& expected,
double tol = 1e-8)
const override;
591 static shared_ptr Create(
double c, GradScheme graduation,
593 double modelParameter()
const {
return c_; }
598 static double Weight(
double distance2,
double c2);
600 static double Loss(
double distance2,
double c2);
603 static double GraduatedWeight(
double distance2,
double c2,
double mu,
604 GradScheme graduation);
606 static double GraduatedLoss(
double distance2,
double c2,
double mu,
607 GradScheme graduation);
612 GradScheme graduation_;
615#if GTSAM_ENABLE_BOOST_SERIALIZATION
617 friend class boost::serialization::access;
618 template <
class ARCHIVE>
619 void serialize(ARCHIVE &ar,
const unsigned int ) {
620 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
621 ar &BOOST_SERIALIZATION_NVP(c_);
622 ar &BOOST_SERIALIZATION_NVP(csquared_);
623 ar &BOOST_SERIALIZATION_NVP(graduation_);
647class GTSAM_EXPORT DCS :
public Base {
649 typedef std::shared_ptr<DCS> shared_ptr;
653 double weight(
double distance)
const override;
654 double loss(
double distance)
const override;
656 double graduatedLoss(
double distance,
double mu)
const override;
657 void print(
const std::string &s)
const override;
658 bool equals(
const Base &expected,
double tol = 1e-8)
const override;
660 double modelParameter()
const {
return c_; }
663 static double Weight(
double distance,
double c);
665 static double Loss(
double distance,
double c);
671#if GTSAM_ENABLE_BOOST_SERIALIZATION
673 friend class boost::serialization::access;
674 template <
class ARCHIVE>
675 void serialize(ARCHIVE &ar,
const unsigned int ) {
676 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
677 ar &BOOST_SERIALIZATION_NVP(c_);
697class GTSAM_EXPORT L2WithDeadZone :
public Base {
702 typedef std::shared_ptr<L2WithDeadZone> shared_ptr;
705 double weight(
double distance)
const override;
706 double loss(
double distance)
const override;
709 void print(
const std::string &s)
const override;
710 bool equals(
const Base &expected,
double tol = 1e-8)
const override;
712 double modelParameter()
const {
return k_; }
715#if GTSAM_ENABLE_BOOST_SERIALIZATION
717 friend class boost::serialization::access;
718 template <
class ARCHIVE>
719 void serialize(ARCHIVE &ar,
const unsigned int ) {
720 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
721 ar &BOOST_SERIALIZATION_NVP(k_);
737class GTSAM_EXPORT AsymmetricTukey :
public Base {
739 double c_, csquared_;
742 typedef std::shared_ptr<AsymmetricTukey> shared_ptr;
745 double weight(
double distance)
const override;
746 double loss(
double distance)
const override;
749 void print(
const std::string &s)
const override;
750 bool equals(
const Base &expected,
double tol = 1e-8)
const override;
752 double modelParameter()
const {
return c_; }
755#if GTSAM_ENABLE_BOOST_SERIALIZATION
757 friend class boost::serialization::access;
758 template <
class ARCHIVE>
759 void serialize(ARCHIVE &ar,
const unsigned int ) {
760 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
761 ar &BOOST_SERIALIZATION_NVP(c_);
777class GTSAM_EXPORT AsymmetricCauchy :
public Base {
779 double k_, ksquared_;
782 typedef std::shared_ptr<AsymmetricCauchy> shared_ptr;
785 double weight(
double distance)
const override;
786 double loss(
double distance)
const override;
789 void print(
const std::string &s)
const override;
790 bool equals(
const Base &expected,
double tol = 1e-8)
const override;
792 double modelParameter()
const {
return k_; }
795#if GTSAM_ENABLE_BOOST_SERIALIZATION
797 friend class boost::serialization::access;
798 template <
class ARCHIVE>
799 void serialize(ARCHIVE &ar,
const unsigned int ) {
800 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
801 ar &BOOST_SERIALIZATION_NVP(k_);
802 ar &BOOST_SERIALIZATION_NVP(ksquared_);
808using CustomLossFunction = std::function<double(
double)>;
809using CustomWeightFunction = std::function<double(
double)>;
810using CustomGraduatedLossFunction =
811 std::optional<std::function<double(
double,
double)>>;
812using CustomGraduatedWeightFunction =
813 std::optional<std::function<double(
double,
double)>>;
821class GTSAM_EXPORT Custom :
public Base {
823 std::function<double(
double)> weight_, loss_;
824 std::optional<std::function<double(
double,
double)>> gradWeight_, gradLoss_;
828 typedef std::shared_ptr<Custom> shared_ptr;
830 Custom(CustomWeightFunction
weight, CustomLossFunction
loss,
831 CustomGraduatedWeightFunction gradWeight = std::nullopt,
832 CustomGraduatedLossFunction gradLoss = std::nullopt,
834 Custom(CustomWeightFunction
weight, CustomLossFunction
loss,
836 double weight(
double distance)
const override;
837 double loss(
double distance)
const override;
839 double graduatedLoss(
double distance,
double mu)
const override;
840 void print(
const std::string& s)
const override;
841 bool equals(
const Base& expected,
double tol = 1e-8)
const override;
842 static shared_ptr Create(
843 std::function<
double(
double)>
weight, std::function<
double(
double)>
loss,
844 CustomGraduatedWeightFunction gradWeight = std::nullopt,
845 CustomGraduatedLossFunction gradLoss = std::nullopt,
847 const std::string &name =
"Custom");
848 static shared_ptr Create(std::function<
double(
double)>
weight,
849 std::function<
double(
double)>
loss,
851 const std::string& name =
"Custom");
852 inline std::string& name() {
return name_; }
854 inline std::function<double(
double)>& weightFunction() {
return weight_; }
855 inline std::function<double(
double)>& lossFunction() {
return loss_; }
858 inline Custom() =
default;
861#if GTSAM_ENABLE_BOOST_SERIALIZATION
863 friend class boost::serialization::access;
864 template <
class ARCHIVE>
865 void serialize(ARCHIVE &ar,
const unsigned int ) {
866 ar &BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
867 ar &BOOST_SERIALIZATION_NVP(name_);
typedef and functions to augment Eigen's MatrixXd
Concept check for values that can be used in unit tests.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:143
double distance2(const Point2 &p, const Point2 &q, OptionalJacobian< 1, 2 > H1, OptionalJacobian< 1, 2 > H2)
distance between two points
Definition Point2.cpp:39
All noise models live in the noiseModel namespace.
Definition LossFunctions.cpp:33
The mEstimator name space contains all robust error functions.
Definition LossFunctions.cpp:39
Template to create a binary predicate.
Definition Testable.h:112
Pure virtual class for all robust error function classes.
Definition LossFunctions.h:81
virtual double graduatedLoss(double distance, double mu) const =0
This method is responsible for returning the total penalty for a given amount of error and the curren...
virtual double loss(double distance) const
This method is responsible for returning the total penalty for a given amount of error.
Definition LossFunctions.h:112
ReweightScheme reweight_
Strategy for reweighting.
Definition LossFunctions.h:90
ReweightScheme reweightScheme() const
Returns the reweight scheme, as explained in ReweightScheme.
Definition LossFunctions.h:97
void reweight(Vector &error) const
reweight block matrices and a vector according to their weight implementation
Definition LossFunctions.cpp:99
virtual double weight(double distance) const =0
This method is responsible for returning the weight function for a given amount of error.
virtual double graduatedWeight(double distance, double mu) const =0
This method is responsible for returning the weight for a given amount of error and the current contr...
ReweightScheme
the rows can be weighted independently according to the error or uniformly with the norm of the right...
Definition LossFunctions.h:85
double weight(double) const override
This method is responsible for returning the weight function for a given amount of error.
Definition LossFunctions.h:188
double graduatedLoss(double distance, double) const override
This method is responsible for returning the total penalty for a given amount of error and the curren...
Definition LossFunctions.h:191
double loss(double distance) const override
This method is responsible for returning the total penalty for a given amount of error.
Definition LossFunctions.h:189
double graduatedWeight(double distance, double) const override
This method is responsible for returning the weight for a given amount of error and the current contr...
Definition LossFunctions.h:190
double graduatedLoss(double, double) const override
This method is responsible for returning the total penalty for a given amount of error and the curren...
Definition LossFunctions.cpp:167
double loss(double distance) const override
This method is responsible for returning the total penalty for a given amount of error.
Definition LossFunctions.cpp:156
double graduatedWeight(double, double) const override
This method is responsible for returning the weight for a given amount of error and the current contr...
Definition LossFunctions.cpp:163
double weight(double distance) const override
This method is responsible for returning the weight function for a given amount of error.
Definition LossFunctions.cpp:152
double graduatedWeight(double distance, double mu) const override
This method is responsible for returning the weight for a given amount of error and the current contr...
Definition LossFunctions.cpp:211
static double Weight(double distance, double k)
Static implementation of Huber Weight.
Definition LossFunctions.cpp:193
static double Loss(double distance, double k)
Static implementation of Huber Loss.
Definition LossFunctions.cpp:198
double weight(double distance) const override
This method is responsible for returning the weight function for a given amount of error.
Definition LossFunctions.cpp:207
double graduatedLoss(double distance, double mu) const override
This method is responsible for returning the total penalty for a given amount of error and the curren...
Definition LossFunctions.cpp:217
double loss(double distance) const override
This method is responsible for returning the total penalty for a given amount of error.
Definition LossFunctions.cpp:209
static double Loss(double distance, double ksquared)
Static implementation of Cauchy Loss.
Definition LossFunctions.cpp:251
double graduatedWeight(double distance, double mu) const override
This method is responsible for returning the weight for a given amount of error and the current contr...
Definition LossFunctions.cpp:262
double weight(double distance) const override
This method is responsible for returning the weight function for a given amount of error.
Definition LossFunctions.cpp:256
double loss(double distance) const override
This method is responsible for returning the total penalty for a given amount of error.
Definition LossFunctions.cpp:260
static double Weight(double distance, double ksquared)
Static implementation of Cauchy Weight.
Definition LossFunctions.cpp:247
double graduatedLoss(double distance, double mu) const override
This method is responsible for returning the total penalty for a given amount of error and the curren...
Definition LossFunctions.cpp:268
double loss(double distance) const override
This method is responsible for returning the total penalty for a given amount of error.
Definition LossFunctions.cpp:321
double graduatedLoss(double distance, double mu) const override
This method is responsible for returning the total penalty for a given amount of error and the curren...
Definition LossFunctions.cpp:331
static double Loss(double distance, double c, double csquared)
Static implementation of Tukey Loss.
Definition LossFunctions.cpp:306
static double Weight(double distance, double c, double csquared)
Static implementation of Tukey Weight.
Definition LossFunctions.cpp:298
double graduatedWeight(double distance, double mu) const override
This method is responsible for returning the weight for a given amount of error and the current contr...
Definition LossFunctions.cpp:325
double weight(double distance) const override
This method is responsible for returning the weight function for a given amount of error.
Definition LossFunctions.cpp:317
static double Weight(double distance, double csquared)
Static implementation of Welsch Weight.
Definition LossFunctions.cpp:357
double loss(double distance) const override
This method is responsible for returning the total penalty for a given amount of error.
Definition LossFunctions.cpp:371
double weight(double distance) const override
This method is responsible for returning the weight function for a given amount of error.
Definition LossFunctions.cpp:367
double graduatedLoss(double distance, double mu) const override
This method is responsible for returning the total penalty for a given amount of error and the curren...
Definition LossFunctions.cpp:379
static double Loss(double distance, double csquared)
Static implementation of Welsch Loss.
Definition LossFunctions.cpp:362
double graduatedWeight(double distance, double mu) const override
This method is responsible for returning the weight for a given amount of error and the current contr...
Definition LossFunctions.cpp:373
double graduatedWeight(double distance, double mu) const override
This method is responsible for returning the weight for a given amount of error and the current contr...
Definition LossFunctions.cpp:453
double graduatedLoss(double distance, double mu) const override
This method is responsible for returning the total penalty for a given amount of error and the curren...
Definition LossFunctions.cpp:457
GradScheme gradScheme() const
Returns the graduation scheme used by this loss.
Definition LossFunctions.h:485
double loss(double distance) const override
This method is responsible for returning the total penalty for a given amount of error.
Definition LossFunctions.cpp:449
GemanMcClure(double c=1.0, const ReweightScheme reweight=Block)
Construct standard GemanMcClure loss.
Definition LossFunctions.cpp:402
double weight(double distance) const override
This method is responsible for returning the weight function for a given amount of error.
Definition LossFunctions.cpp:445
GradScheme gradScheme() const
Returns the graduation scheme used by this loss.
Definition LossFunctions.h:595
double graduatedWeight(double distance, double mu) const override
This method is responsible for returning the weight for a given amount of error and the current contr...
Definition LossFunctions.cpp:601
TruncatedLeastSquares(double c=1.0, const ReweightScheme reweight=Block)
Construct standard TLS loss.
Definition LossFunctions.cpp:514
double loss(double distance) const override
This method is responsible for returning the total penalty for a given amount of error.
Definition LossFunctions.cpp:597
double weight(double distance) const override
This method is responsible for returning the weight function for a given amount of error.
Definition LossFunctions.cpp:593
double graduatedLoss(double distance, double mu) const override
This method is responsible for returning the total penalty for a given amount of error and the curren...
Definition LossFunctions.cpp:606
double weight(double distance) const override
This method is responsible for returning the weight function for a given amount of error.
Definition LossFunctions.cpp:671
static double Weight(double distance, double c)
Static implementation of DCS Weight.
Definition LossFunctions.cpp:654
static double Loss(double distance, double c)
Static implementation of DCS Loss.
Definition LossFunctions.cpp:663
double graduatedLoss(double distance, double mu) const override
This method is responsible for returning the total penalty for a given amount of error and the curren...
Definition LossFunctions.cpp:682
double loss(double distance) const override
This method is responsible for returning the total penalty for a given amount of error.
Definition LossFunctions.cpp:673
double graduatedWeight(double distance, double mu) const override
This method is responsible for returning the weight for a given amount of error and the current contr...
Definition LossFunctions.cpp:675
double graduatedLoss(double, double) const override
This method is responsible for returning the total penalty for a given amount of error and the curren...
Definition LossFunctions.cpp:732
double weight(double distance) const override
This method is responsible for returning the weight function for a given amount of error.
Definition LossFunctions.cpp:713
double loss(double distance) const override
This method is responsible for returning the total penalty for a given amount of error.
Definition LossFunctions.cpp:722
double graduatedWeight(double, double) const override
This method is responsible for returning the weight for a given amount of error and the current contr...
Definition LossFunctions.cpp:727
double graduatedLoss(double, double) const override
This method is responsible for returning the total penalty for a given amount of error and the curren...
Definition LossFunctions.cpp:789
double loss(double distance) const override
This method is responsible for returning the total penalty for a given amount of error.
Definition LossFunctions.cpp:772
double graduatedWeight(double, double) const override
This method is responsible for returning the weight for a given amount of error and the current contr...
Definition LossFunctions.cpp:784
double weight(double distance) const override
This method is responsible for returning the weight function for a given amount of error.
Definition LossFunctions.cpp:761
double graduatedLoss(double, double) const override
This method is responsible for returning the total penalty for a given amount of error and the curren...
Definition LossFunctions.cpp:843
double weight(double distance) const override
This method is responsible for returning the weight function for a given amount of error.
Definition LossFunctions.cpp:819
double loss(double distance) const override
This method is responsible for returning the total penalty for a given amount of error.
Definition LossFunctions.cpp:829
double graduatedWeight(double, double) const override
This method is responsible for returning the weight for a given amount of error and the current contr...
Definition LossFunctions.cpp:838
double weight(double distance) const override
This method is responsible for returning the weight function for a given amount of error.
Definition LossFunctions.cpp:885
double loss(double distance) const override
This method is responsible for returning the total penalty for a given amount of error.
Definition LossFunctions.cpp:887
double graduatedLoss(double distance, double mu) const override
This method is responsible for returning the total penalty for a given amount of error and the curren...
Definition LossFunctions.cpp:897
double graduatedWeight(double distance, double mu) const override
This method is responsible for returning the weight for a given amount of error and the current contr...
Definition LossFunctions.cpp:889
noiseModel::Base is the abstract base class for all noise models.
Definition NoiseModel.h:60