SourceXtractorPlusPlus 0.21
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
EngineValueResidual.cpp
Go to the documentation of this file.
1
24
25namespace ModelFitting {
26
28
29static double computeResidual(double current, double expected, double weight) {
30 return weight * (expected - current);
31}
32
34 double expected_value, double weight)
35 : m_residual{computeResidual(parameter.getEngineValue(), expected_value, weight)} {
36 parameter.addObserver(
37 [this, &parameter, expected_value, weight](double){
38 m_residual = computeResidual(parameter.getEngineValue(), expected_value, weight);
39 }
40 );
41}
42
46
50
51} // end of namespace ModelFitting
EngineParameter are those derived from the minimization process.
std::size_t numberOfResiduals() const override
Always returns 1, as this class creates a single residual.
virtual ~EngineValueResidual()
Destructor.
void populateResidualBlock(IterType output_iter) override
EngineValueResidual(EngineParameter &parameter, double expected_value, double weight=1.)
Constructs a new instance of EngineValueResidual.
static double computeResidual(double current, double expected, double weight)