SourceXtractorPlusPlus  0.11
Please provide a description of the project.
Public Member Functions | Private Attributes | List of all members
ModelFitting::EngineValueResidual Class Reference

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

#include <EngineValueResidual.h>

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

Public Member Functions

 EngineValueResidual (EngineParameter &parameter, double expected_value, double weight=1.)
 Constructs a new instance of EngineValueResidual. More...
 
virtual ~EngineValueResidual ()
 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

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 engine value.

The residual is calculated as:

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

where:

Definition at line 46 of file EngineValueResidual.h.

Constructor & Destructor Documentation

◆ EngineValueResidual()

ModelFitting::EngineValueResidual::EngineValueResidual ( EngineParameter parameter,
double  expected_value,
double  weight = 1. 
)

Constructs a new instance of EngineValueResidual.

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

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

Definition at line 33 of file EngineValueResidual.cpp.

References ModelFitting::computeResidual(), and ModelFitting::EngineParameter::getEngineValue().

Here is the call graph for this function:

◆ ~EngineValueResidual()

ModelFitting::EngineValueResidual::~EngineValueResidual ( )
virtualdefault

Destructor.

Member Function Documentation

◆ numberOfResiduals()

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

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

Implements ModelFitting::ResidualBlockProvider.

Definition at line 43 of file EngineValueResidual.cpp.

◆ populateResidualBlock()

void ModelFitting::EngineValueResidual::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 47 of file EngineValueResidual.cpp.

References m_residual.

Member Data Documentation

◆ m_residual

double ModelFitting::EngineValueResidual::m_residual
private

Definition at line 80 of file EngineValueResidual.h.

Referenced by populateResidualBlock().


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