Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
fuse_loss::TolerantLoss Class Reference

The TolerantLoss loss function. More...

#include <tolerant_loss.h>

Inheritance diagram for fuse_loss::TolerantLoss:
Inheritance graph
[legend]

Public Member Functions

double a () const
 Parameter 'a' accessor. More...
 
void a (const double a)
 Parameter 'a' mutator. More...
 
double b () const
 Parameter 'b' accessor. More...
 
void b (const double b)
 Parameter 'b' mutator. More...
 
 FUSE_LOSS_DEFINITIONS (TolerantLoss)
 
void initialize (const std::string &name) override
 Perform any required post-construction initialization, such as reading from the parameter server. More...
 
ceres::LossFunction * lossFunction () const override
 Return a raw pointer to a ceres::LossFunction that implements the loss function. More...
 
void print (std::ostream &stream=std::cout) const override
 Print a human-readable description of the loss function to the provided stream. More...
 
 TolerantLoss (const double a=1.0, const double b=0.1)
 Constructor. More...
 
 ~TolerantLoss () override=default
 Destructor. More...
 
- Public Member Functions inherited from fuse_core::Loss
virtual Loss::UniquePtr clone () const=0
 
virtual void deserialize (fuse_core::BinaryInputArchive &)=0
 
virtual void deserialize (fuse_core::TextInputArchive &)=0
 
 FUSE_SMART_PTR_ALIASES_ONLY (Loss)
 
 Loss ()=default
 
virtual void serialize (fuse_core::BinaryOutputArchive &) const=0
 
virtual void serialize (fuse_core::TextOutputArchive &) const=0
 
virtual std::string type () const=0
 
virtual ~Loss ()=default
 

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int)
 The Boost Serialize method that serializes all of the data members in to/out of the archive. More...
 

Private Attributes

double a_ { 1.0 }
 TolerantLoss parameter 'a'. See Ceres documentation for more details. More...
 
double b_ { 0.1 }
 TolerantLoss parameter 'b'. See Ceres documentation for more details. More...
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- Static Public Attributes inherited from fuse_core::Loss
static constexpr ceres::Ownership Ownership
 

Detailed Description

The TolerantLoss loss function.

This class encapsulates the ceres::TolerantLoss class, adding the ability to serialize it and load it dynamically.

See the Ceres documentation for more details. http://ceres-solver.org/nnls_modeling.html#lossfunction

Definition at line 57 of file tolerant_loss.h.

Constructor & Destructor Documentation

◆ TolerantLoss()

fuse_loss::TolerantLoss::TolerantLoss ( const double  a = 1.0,
const double  b = 0.1 
)
explicit

Constructor.

Parameters
[in]aTolerantLoss parameter 'a'. See Ceres documentation for more details
[in]bTolerantLoss parameter 'b'. See Ceres documentation for more details

Definition at line 48 of file tolerant_loss.cpp.

◆ ~TolerantLoss()

fuse_loss::TolerantLoss::~TolerantLoss ( )
overridedefault

Destructor.

Member Function Documentation

◆ a() [1/2]

double fuse_loss::TolerantLoss::a ( ) const
inline

Parameter 'a' accessor.

Returns
Parameter 'a'.

Definition at line 108 of file tolerant_loss.h.

◆ a() [2/2]

void fuse_loss::TolerantLoss::a ( const double  a)
inline

Parameter 'a' mutator.

Parameters
[in]aParameter 'a'.

Definition at line 128 of file tolerant_loss.h.

◆ b() [1/2]

double fuse_loss::TolerantLoss::b ( ) const
inline

Parameter 'b' accessor.

Returns
Parameter 'b'.

Definition at line 118 of file tolerant_loss.h.

◆ b() [2/2]

void fuse_loss::TolerantLoss::b ( const double  b)
inline

Parameter 'b' mutator.

Parameters
[in]bParameter 'b'.

Definition at line 138 of file tolerant_loss.h.

◆ FUSE_LOSS_DEFINITIONS()

fuse_loss::TolerantLoss::FUSE_LOSS_DEFINITIONS ( TolerantLoss  )

◆ initialize()

void fuse_loss::TolerantLoss::initialize ( const std::string &  name)
overridevirtual

Perform any required post-construction initialization, such as reading from the parameter server.

This will be called on each plugin after construction.

Parameters
[in]nameA unique name to initialize this plugin instance, such as from the parameter server.

Implements fuse_core::Loss.

Definition at line 53 of file tolerant_loss.cpp.

◆ lossFunction()

ceres::LossFunction * fuse_loss::TolerantLoss::lossFunction ( ) const
overridevirtual

Return a raw pointer to a ceres::LossFunction that implements the loss function.

The Ceres interface requires a raw pointer. Ceres will take ownership of the pointer and promises to properly delete the loss function when it is done. Additionally, Fuse promises that the Loss object will outlive any generated loss functions (i.e. the Ceres objects will be destroyed before the Loss Function objects). This guarantee may allow optimizations for the creation of the loss function objects.

Returns
A base pointer to an instance of a derived ceres::LossFunction.

Implements fuse_core::Loss.

Definition at line 68 of file tolerant_loss.cpp.

◆ print()

void fuse_loss::TolerantLoss::print ( std::ostream &  stream = std::cout) const
overridevirtual

Print a human-readable description of the loss function to the provided stream.

Parameters
[out]streamThe stream to write to. Defaults to stdout.

Implements fuse_core::Loss.

Definition at line 61 of file tolerant_loss.cpp.

◆ serialize()

template<class Archive >
void fuse_loss::TolerantLoss::serialize ( Archive &  archive,
const unsigned int   
)
inlineprivate

The Boost Serialize method that serializes all of the data members in to/out of the archive.

Parameters
[in/out]archive - The archive object that holds the serialized class members
[in]version- The version of the archive being read/written. Generally unused.

Definition at line 157 of file tolerant_loss.h.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 148 of file tolerant_loss.h.

Member Data Documentation

◆ a_

double fuse_loss::TolerantLoss::a_ { 1.0 }
private

TolerantLoss parameter 'a'. See Ceres documentation for more details.

Definition at line 144 of file tolerant_loss.h.

◆ b_

double fuse_loss::TolerantLoss::b_ { 0.1 }
private

TolerantLoss parameter 'b'. See Ceres documentation for more details.

Definition at line 145 of file tolerant_loss.h.


The documentation for this class was generated from the following files:


fuse_loss
Author(s): Enrique Fernandez , Stephen Williams
autogenerated on Thu Apr 24 2025 02:19:00