25 throw std::runtime_error(
"Parameters::add() -> Error. Parameter with the name '"
26 + par.
name() +
"' already exists.");
58 std::vector<double> result;
60 result.push_back(par.value());
70 if (std::isnan(
values[index]))
71 throw std::runtime_error(
"Parameters::setValues() -> Error."
72 " Attempt to set nan '"
74 if (std::isinf(
values[index]))
75 throw std::runtime_error(
"Parameters::setValues() -> Error. Attempt to set inf '"
77 par.setValue(
values[index]);
84 std::vector<double> result;
86 result.push_back(par.error());
95 par.setError(
errors[index++]);
101 if (par.name() == name)
104 std::ostringstream ostr;
105 ostr <<
"Parameters::operator[] -> Error. No parameter with name '" << name <<
"'. ";
106 ostr <<
"Existing names:\n";
108 ostr << par.
name() <<
"\n";
109 throw std::runtime_error(ostr.str());
124 if (matrix.size() !=
size())
125 throw std::runtime_error(
"Parameters::setCorrelationMatrix() -> Error. Wrong "
126 "dimension of correlation matrix.");
136 if (!par.limits().isFixed())
144 if (par.name() == name)
152 std::ostringstream ostr;
153 ostr <<
"Parameters::check_array_size() -> Error. Size of input array " <<
values.size()
154 <<
" doesn't mach number of fit parameters " <<
m_parameters.size() <<
"."
156 throw std::runtime_error(ostr.str());
163 throw std::runtime_error(
"Parameters::check_index() -> Index out of bounds");
Defines class Parameters.
A fittable parameter with value, error, step, and limits.
std::vector< double > values() const
const Parameter & operator[](const std::string &name) const
corr_matrix_t correlationMatrix() const
const_iterator end() const
corr_matrix_t m_corr_matrix
correlation matrix
size_t check_index(size_t index) const
void setValues(const std::vector< double > &values)
bool exists(const std::string ¶meter_name) const
size_t freeParameterCount() const
Returns number of free parameters.
void setCorrelationMatrix(const corr_matrix_t &matrix)
const_iterator begin() const
parameters_t::const_iterator const_iterator
void setErrors(const std::vector< double > &errors)
parameters_t m_parameters
std::vector< double > errors() const
void add(const Parameter &par)
std::vector< std::vector< double > > corr_matrix_t
void check_array_size(const std::vector< double > &values) const
parameters_t::iterator iterator
Objective function types.