SourceXtractorPlusPlus  0.11
Please provide a description of the project.
EngineValueResidual.cpp
Go to the documentation of this file.
1 
24 
25 namespace ModelFitting {
26 
28 
29 static 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 
44  return 1;
45 }
46 
48  *output_iter = m_residual;
49 }
50 
51 } // end of namespace ModelFitting
EngineParameter are those derived from the minimization process.
virtual ~EngineValueResidual()
Destructor.
void populateResidualBlock(IterType output_iter) override
std::size_t numberOfResiduals() const override
Always returns 1, as this class creates a single residual.
EngineValueResidual(EngineParameter &parameter, double expected_value, double weight=1.)
Constructs a new instance of EngineValueResidual.
static double computeResidual(double current, double expected, double weight)