NumericalErrorPropagation.h
Go to the documentation of this file.
1 #ifndef _utl_NumericalErrorPropagation_h_
2 #define _utl_NumericalErrorPropagation_h_
3 
4 #include <vector>
5 
6 
7 namespace utl {
8 
9  class CorrelationMatrix;
10 
11 
12  class FCNCalculator {
13  public:
14  virtual ~FCNCalculator() = default;
15  virtual std::vector<double> operator()(const std::vector<double>& p) const = 0;
16  };
17 
18 
19  // symmetrical error
20  struct Parameter {
21  Parameter() = default;
22  Parameter(const double v, const double e) : value(v), error(e) { }
23  Parameter(const Parameter& o) { value = o.value; error = o.error; }
24 
25  double value = 0;
26  double error = 0;
27  };
28 
29 
31  public:
33  const std::vector<Parameter>& params,
34  const CorrelationMatrix& corr);
36 
37  const std::vector<double>& GetFunctionResult() const { return fResult; }
38  const std::vector<double>& GetPropagatedErrors() const { return fPropagatedErrors; }
40 
41  private:
45 
46  void Propagate();
47 
49  const std::vector<Parameter> fParameter;
51 
52  std::vector<double> fResult;
53  std::vector<double> fPropagatedErrors;
55  };
56 
57 }
58 
59 
60 #endif
const std::vector< Parameter > fParameter
const std::vector< double > & GetPropagatedErrors() const
Parameter(const Parameter &o)
const CorrelationMatrix & GetPropagatedCorrelations() const
NumericalErrorPropagation & operator=(const NumericalErrorPropagation &that)
Parameter()=default
virtual std::vector< double > operator()(const std::vector< double > &p) const =0
Parameter(const double v, const double e)
const std::vector< double > & GetFunctionResult() const
const CorrelationMatrix & fCorrelation
virtual ~FCNCalculator()=default

, generated on Tue Sep 26 2023.