eos 1.4.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
eos::fitting::NormCost Struct Reference

#include <ceres_nonlinear.hpp>

Public Member Functions

 NormCost (int num_parameters)
 
template<typename T >
bool operator() (const T *const x, T *residual) const
 

Static Public Member Functions

template<int num_parameters>
static ceres::CostFunction * Create ()
 

Detailed Description

Cost function that consists of the parameter values themselves as residual.

If used with a squared loss, this corresponds to an L2 norm constraint on the parameters. This class is implemented exactly like Ceres' NormalPrior.

Constructor & Destructor Documentation

◆ NormCost()

eos::fitting::NormCost::NormCost ( int  num_parameters)
inline

Creates a new NormCost object with set number of parameters.

Parameters
[in]num_parametersNumber of parameters that the parameter vector contains.

Member Function Documentation

◆ Create()

template<int num_parameters>
static ceres::CostFunction * eos::fitting::NormCost::Create ( )
inlinestatic

Factory to hide the construction of the CostFunction object from the client code.

The number of parameters is given as a template argument, so that we can use Ceres' fixed-size constructor.

◆ operator()()

template<typename T >
bool eos::fitting::NormCost::operator() ( const T *const  x,
T *  residual 
) const
inline

Cost function implementation.

Parameters
[in]xAn array of parameters.
[in]residualAn array of the resulting residuals.
Returns
whether the computation of the residuals was successful. Always returns true.

The documentation for this struct was generated from the following file: