40 result.
add(plan.fitParameter());
49 std::vector<double> result;
51 result.push_back(plan.expectedValue());
63 throw std::runtime_error(
"FunctionTestPlan::valuesAsExpected() -> Error. Sizes differ.");
66 std::ostringstream text;
71 if (diff > plan.tolerance())
74 text << plan.fitParameter().name() <<
" found:" << values[index]
75 <<
" expected:" << plan.expectedValue() <<
" diff:" << diff <<
" "
76 << (diff_ok ?
"OK" :
"FAILED") <<
"\n";
83 std::cout << text.str();
Defines class MinimizerTestPlan.
Defines constants and "almost equal" in namespace Numeric.
Defines class Parameters.
A fittable parameter with value, error, step, and limits.
A collection of fit parameters.
void add(const Parameter &par)
std::vector< double > expectedValues() const
Return vector of expected parameter values.
void addParameter(const Fit::Parameter ¶m, double expected_value, double tolerance=0.01)
MinimizerTestPlan(const std::string &name)
bool valuesAsExpected(const std::vector< double > &values) const
Returns true if given values coincide with expected fit parameter values.
Fit::Parameters parameters() const
Returns fit parameters which will be used as initial one for the minimization.
virtual ~MinimizerTestPlan()
std::vector< ParameterPlan > m_parameter_plan
Defines initial settings of single fit parameter and the final value which has to be found in the cou...
Objective function types.
double GetRelativeDifference(double a, double b)
Returns the safe relative difference, which is 2(|a-b|)/(|a|+|b|) except in special cases.