SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
FlexibleModelFittingParameter.h
Go to the documentation of this file.
1
17/*
18 * FlexibleModelFittingParameter.h
19 *
20 * Created on: Sep 17, 2018
21 * Author: mschefer
22 */
23
24#ifndef _SEIMPLEMENTATION_PLUGIN_FLEXIBLEMODELFITTING_FLEXIBLEMODELFITTINGPARAMETER_H_
25#define _SEIMPLEMENTATION_PLUGIN_FLEXIBLEMODELFITTING_FLEXIBLEMODELFITTINGPARAMETER_H_
26
27#include <memory>
28#include <utility>
29#include <functional>
30#include <vector>
31#include <mutex>
33
34namespace ModelFitting {
35 class BasicParameter;
37}
38
39namespace SourceXtractor {
40
41class SourceInterface;
44
45class FlexibleModelFittingParameter : public std::enable_shared_from_this<FlexibleModelFittingParameter>{
46public:
47 explicit FlexibleModelFittingParameter(int id);
48 virtual ~FlexibleModelFittingParameter() = default;
49
51 FlexibleModelFittingParameterManager& parameter_manager,
53 const SourceInterface& source) const = 0;
54
55 virtual int getId() const final;
56
57 // returns the estimated 1-sigma margin of error for the parameter on a given source, takes the vector of errors
58 // for the free parameters from the minimization engine as input
59 virtual double getSigma(FlexibleModelFittingParameterManager& parameter_manager, const SourceInterface& source,
60 const std::vector<double>& free_parameter_sigmas) const = 0;
61
62
63private:
64 int m_id;
65};
66
68
69public:
70
73 using ValueFunc = std::function<double(const SourceInterface&)>;
74
76
78 FlexibleModelFittingParameterManager& parameter_manager,
80 const SourceInterface& source) const override;
81
83 const std::vector<double>&) const override {
84 return 0.0;
85 }
86
87
88private:
89
91
92};
93
95public:
96
100
106
108 FlexibleModelFittingParameterManager& parameter_manager,
110 const SourceInterface& source) const override;
111
113 FlexibleModelFittingParameterManager& parameter_manager,
115 const SourceInterface& source,
116 double initial_value, double current_value) const;
117
118 double getSigma(FlexibleModelFittingParameterManager& parameter_manager, const SourceInterface& source,
119 const std::vector<double>& free_parameter_sigmas) const override;
120
121 double getInitialValue(const SourceInterface& source) const;
122
123private:
124
127};
128
130
131public:
132
136
142
144 FlexibleModelFittingParameterManager& parameter_manager,
146 const SourceInterface& source) const override;
147
151
152 double getSigma(FlexibleModelFittingParameterManager& parameter_manager, const SourceInterface& source,
153 const std::vector<double>& free_parameter_sigmas) const override;
154
155 std::vector<double> getPartialDerivatives(const SourceInterface& source, const std::vector<double>& param_values) const;
156
157private:
158
161
162};
163
164}
165
166#endif /* _SEIMPLEMENTATION_PLUGIN_FLEXIBLEMODELFITTING_FLEXIBLEMODELFITTINGPARAMETER_H_ */
The parameter base class.
Class responsible for managing the parameters the least square engine minimizes.
std::function< double(const SourceInterface &)> ValueFunc
double getSigma(FlexibleModelFittingParameterManager &, const SourceInterface &, const std::vector< double > &) const override
std::function< double(const std::shared_ptr< CoordinateSystem > &, const std::vector< double > &)> ValueFunc
std::vector< std::shared_ptr< FlexibleModelFittingParameter > > m_parameters
FlexibleModelFittingDependentParameter(int id, ValueFunc value_calculator, std::vector< std::shared_ptr< FlexibleModelFittingParameter > > parameters)
const std::vector< std::shared_ptr< FlexibleModelFittingParameter > > & getDependees() const
std::function< double(const SourceInterface &)> InitialValueFunc
std::shared_ptr< FlexibleModelFittingConverterFactory > m_converter_factory
FlexibleModelFittingFreeParameter(int id, InitialValueFunc initial_value, std::shared_ptr< FlexibleModelFittingConverterFactory > converter_factory)
virtual std::shared_ptr< ModelFitting::BasicParameter > create(FlexibleModelFittingParameterManager &parameter_manager, ModelFitting::EngineParameterManager &engine_manager, const SourceInterface &source) const =0
virtual double getSigma(FlexibleModelFittingParameterManager &parameter_manager, const SourceInterface &source, const std::vector< double > &free_parameter_sigmas) const =0
The SourceInterface is an abstract "source" that has properties attached to it.
STL namespace.