15 #ifndef BORNAGAIN_CORE_PARAMETRIZATION_PARAMETERPOOL_H
16 #define BORNAGAIN_CORE_PARAMETRIZATION_PARAMETERPOOL_H
42 size_t size()
const {
return m_params.size(); }
43 bool empty()
const {
return size() == 0; }
52 const std::vector<RealParameter*>
parameters()
const {
return m_params; }
62 std::vector<std::string> parameterNames()
const;
64 friend std::ostream& operator<<(std::ostream& ostr,
const ParameterPool& obj)
76 virtual void print(std::ostream& ostr)
const;
78 [[noreturn]]
void report_find_matched_parameters_error(
const std::string& pattern)
const;
79 [[noreturn]]
void report_set_value_error(
const std::string& parname,
double value,
80 std::string message = {})
const;
82 size_t check_index(
size_t index)
const;
84 std::vector<RealParameter*> m_params;
Defines and implements the standard mix-in ICloneable.
Interface for polymorphic classes that should not be copied, except by explicit cloning.
Container with parameters for IParameterized object.
RealParameter * parameter(const std::string &name)
Returns parameter with given name.
const std::vector< RealParameter * > parameters() const
Returns full vector of parameters.
RealParameter & addParameter(RealParameter *newPar)
Adds parameter to the pool, and returns reference to the input pointer.
void setUniqueMatchValue(const std::string &pattern, double value)
Sets value of the one parameter that matches pattern ('*' allowed), or throws.
void copyToExternalPool(const std::string &prefix, ParameterPool *other_pool) const
Copies parameters of given pool to other pool, prepeding prefix to the parameter names.
void clear()
Clears the parameter map.
ParameterPool * clone() const
Returns a literal clone.
int setMatchedParametersValue(const std::string &wildcards, double value)
Sets value of the nonzero parameters that match pattern ('*' allowed), or throws.
size_t size() const
Returns number of parameters in the pool.
ParameterPool()
Constructs an empty parameter pool.
void setParameterValue(const std::string &name, double value)
Sets parameter value.
void removeParameter(const std::string &name)
Removes parameter with given name from the pool.
std::vector< RealParameter * > getMatchedParameters(const std::string &pattern) const
Returns nonempty vector of parameters that match the pattern ('*' allowed), or throws.
RealParameter * getUniqueMatch(const std::string &pattern) const
Returns the one parameter that matches the pattern (wildcards '*' allowed), or throws.
Limits for a real fit parameter.
Wraps a parameter of type double.