Class DCSLoss

Inheritance Relationships

Base Type

  • public fuse_core::Loss

Class Documentation

class DCSLoss : public fuse_core::Loss

The DCS (Dynamic Covariance Scaling) loss function.

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

The DCS loss is not provided by the Ceres solver, so it is implemented here, based on equation #315 from: (p. 3)

See the Ceres documentation for more details. http://ceres-

Public Functions

explicit DCSLoss(const double a = 1.0)



a[in] DCSLoss parameter ‘a’

~DCSLoss() override = default


void initialize(fuse_core::node_interfaces::NodeInterfaces<fuse_core::node_interfaces::Base, fuse_core::node_interfaces::Logging, fuse_core::node_interfaces::Parameters> interfaces, const std::string &name) override

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

This will be called on each plugin after construction.

  • interfaces[in] - The node interfaces used to load the parameter

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

void print(std::ostream &stream = std::cout) const override

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


stream[out] The stream to write to. Defaults to stdout.

ceres::LossFunction *lossFunction() const override

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.


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

inline double a() const

Parameter ‘a’ accessor.


Parameter ‘a’.

inline void a(const double a)

Parameter ‘a’ mutator.


a[in] Parameter ‘a’.


friend class boost::serialization::access