SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
FlexibleModelFittingPrior.cpp
Go to the documentation of this file.
1
17/*
18 * FlexibleModelFittingPrior.cpp
19 *
20 * Created on: 2018 M11 16
21 * Author: mschefer
22 */
23
24#include <iostream>
25#include <mutex>
26
27#include "AlexandriaKernel/memory_tools.h"
28
33
34
37
41
43
44namespace SourceXtractor {
45
46using namespace ModelFitting;
47
49 FlexibleModelFittingParameterManager& parameter_manager, const SourceInterface& source,
50 ResidualEstimator& residual_estimator) const {
51 double expected_value = m_expected_value(source);
52 double weight = 1. / m_standard_deviation(source);
53
54 auto prior_residual = std::unique_ptr<WorldValueResidual>(
55 new WorldValueResidual(parameter_manager.getParameter(source, m_parameter), expected_value, weight));
56 residual_estimator.registerBlockProvider(std::move(prior_residual));
57}
58
59}
60
Provides to the LeastSquareEngine the residual values.
void registerBlockProvider(std::unique_ptr< ResidualBlockProvider > provider)
Registers a ResidualBlockProvider to the ResidualEstimator.
ResidualBlockProvider implementation for adding a prior to a parameter world value.
std::shared_ptr< ModelFitting::BasicParameter > getParameter(const SourceInterface &source, std::shared_ptr< const FlexibleModelFittingParameter > parameter) const
std::shared_ptr< FlexibleModelFittingParameter > m_parameter
void setupPrior(FlexibleModelFittingParameterManager &parameter_manager, const SourceInterface &source, ModelFitting::ResidualEstimator &residual_estimator) const
The SourceInterface is an abstract "source" that has properties attached to it.
T move(T... args)