SourceXtractorPlusPlus  0.11
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
ModelFitting::WorldValueResidual Class Reference

ResidualBlockProvider implementation for adding a prior to a parameter world value. More...

#include <WorldValueResidual.h>

Inheritance diagram for ModelFitting::WorldValueResidual:
[legend]
Collaboration diagram for ModelFitting::WorldValueResidual:
[legend]

Public Member Functions

 WorldValueResidual (std::shared_ptr< BasicParameter > parameter, double expected_value, double weight=1.)
 Constructs a new instance of WorldValueResidual. More...
 
virtual ~WorldValueResidual ()
 Destructor. More...
 
std::size_t numberOfResiduals () const override
 Always returns 1, as this class creates a single residual. More...
 
void populateResidualBlock (IterType output_iter) override
 
- Public Member Functions inherited from ModelFitting::ResidualBlockProvider
virtual ~ResidualBlockProvider ()=default
 Destructor. More...
 

Private Attributes

std::shared_ptr< BasicParameterm_parameter
 
std::size_t m_observer_id
 
double m_residual
 

Additional Inherited Members

- Public Types inherited from ModelFitting::ResidualBlockProvider
using IterType = double *
 

Detailed Description

ResidualBlockProvider implementation for adding a prior to a parameter world value.

The residual is calculated as:

\[ r = w*(P_c-P_p) \]

where:

Definition at line 46 of file WorldValueResidual.h.

Constructor & Destructor Documentation

ModelFitting::WorldValueResidual::WorldValueResidual ( std::shared_ptr< BasicParameter parameter,
double  expected_value,
double  weight = 1. 
)

Constructs a new instance of WorldValueResidual.

Note that this class will add an observer to the parameter which requires that the WorldValueResidual instance is still alive when it is called. For this reason, any updates of a parameter value after a related WorldValueResidual is deleted, leeds to undefined behavior.

Parameters
parameterA reference to the parameter the residual is calculated for
expected_valueThe prior expected world value
weightThe weight or the residual

Definition at line 35 of file WorldValueResidual.cpp.

References ModelFitting::computeResidual(), m_observer_id, and m_residual.

Here is the call graph for this function:

ModelFitting::WorldValueResidual::~WorldValueResidual ( )
virtual

Destructor.

Definition at line 27 of file WorldValueResidual.cpp.

References m_observer_id, and m_parameter.

Member Function Documentation

std::size_t ModelFitting::WorldValueResidual::numberOfResiduals ( ) const
overridevirtual

Always returns 1, as this class creates a single residual.

Implements ModelFitting::ResidualBlockProvider.

Definition at line 45 of file WorldValueResidual.cpp.

void ModelFitting::WorldValueResidual::populateResidualBlock ( IterType  output_iter)
overridevirtual

Updates the value where the iterator points with the value of the residual for the current value of the parameter

Implements ModelFitting::ResidualBlockProvider.

Definition at line 49 of file WorldValueResidual.cpp.

References m_residual.

Member Data Documentation

std::size_t ModelFitting::WorldValueResidual::m_observer_id
private

Definition at line 81 of file WorldValueResidual.h.

Referenced by WorldValueResidual(), and ~WorldValueResidual().

std::shared_ptr<BasicParameter> ModelFitting::WorldValueResidual::m_parameter
private

Definition at line 80 of file WorldValueResidual.h.

Referenced by ~WorldValueResidual().

double ModelFitting::WorldValueResidual::m_residual
private

Definition at line 83 of file WorldValueResidual.h.

Referenced by populateResidualBlock(), and WorldValueResidual().


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