5 #ifndef BPP_NUMERIC_PARAMETERLIST_H 6 #define BPP_NUMERIC_PARAMETERLIST_H 9 #include "../Clonable.h" 10 #include "../Io/OutputStream.h" 56 size_t size()
const {
return parameters_.size(); }
69 virtual const std::shared_ptr<Parameter>&
getParameter(
size_t i)
const {
return parameters_[i]; }
70 virtual std::shared_ptr<Parameter>&
getParameter(
size_t i) {
return parameters_[i]; }
88 virtual const std::shared_ptr<Parameter>&
getParameter(
const std::string& name)
const;
116 virtual std::shared_ptr<Parameter>&
getParameter(
const std::string& name);
219 virtual void shareParameter(
const std::shared_ptr<Parameter>& param);
297 virtual bool hasParameter(
const std::string& name)
const;
370 virtual void deleteParameters(
const std::vector<std::string>& names,
bool mustExist =
true);
411 virtual void reset();
414 #endif // BPP_NUMERIC_PARAMETERLIST_H virtual const Parameter & operator[](size_t i) const
virtual const Parameter & parameter(const std::string &name) const
Get the parameter with name name.
virtual void includeParameters(const ParameterList ¶ms)
Add parameters to the list. If the parameter already exists, only the value is updated, otherwise the new parameter is added at the end of the list.
virtual bool testParametersValues(const ParameterList ¶ms) const
Tests the parameters from params.
virtual void reset()
Reset the list: delete all parameters.
virtual std::vector< std::string > getMatchingParameterNames(const std::string &pattern) const
Get all parameter names matching with the given name. Up to now, only "*" jokers are available...
virtual ParameterList createSubList(const std::vector< std::string > &names) const
Get given parameters as a sublist.
virtual double getParameterValue(const std::string &name) const
Get the value of the parameter with name name.
virtual bool matchParametersValues(const ParameterList ¶ms, std::vector< size_t > *updatedParameters=0)
Update the parameters from params.
virtual void setAllParameters(const ParameterList ¶ms)
Set the parameters to be equals to params.
virtual void deleteParameters(const std::vector< std::string > &names, bool mustExist=true)
Delete several parameters from the list.
ParameterList & operator=(const ParameterList &pl)
ParameterList()
Build a new ParameterList object.
virtual void shareParameter(const std::shared_ptr< Parameter > ¶m)
Share a parameter at the end of the list.
This class is designed to facilitate the manipulation of parameters.
virtual void setAllParametersValues(const ParameterList ¶ms)
Set the parameters to be equals to params.
virtual void deleteParameter(const std::string &name)
Delete a parameter from the list.
virtual void setParameterValue(const std::string &name, double value)
Set the value of parameter with name name to be equal to value.
virtual ParameterList getCommonParametersWith(const ParameterList ¶ms) const
Get the sublist containing all common parameter between this list and pl.
virtual Parameter & operator[](size_t i)
The parameter list object.
virtual void addParameters(const ParameterList ¶ms)
Add new parameters at the end of the list.
virtual void printParameters(std::ostream &out) const
virtual std::vector< std::string > getParameterNames() const
Get all parameter names in the list.
ParameterList * clone() const
Create a copy of this object and send a pointer to it.
virtual bool hasParameter(const std::string &name) const
virtual void shareParameters(const ParameterList ¶ms)
Share parameters with a given list. They are added the end of this list.
virtual size_t whichParameterHasName(const std::string &name) const
Get the position of a given parameter according to its name.
virtual void setParameter(size_t index, const Parameter ¶m)
Change given parameter.
virtual void setParameters(const ParameterList ¶ms)
Update the parameters from params.
virtual ParameterList shareSubList(const std::vector< std::string > &names) const
Share given parameters as a sublist.
virtual void addParameter(const Parameter ¶m)
Add a new parameter at the end of the list.
STL wrapper for output stream.
The Clonable interface (allow an object to be cloned).
virtual void matchParameters(const ParameterList ¶ms)
Update the parameters from params.
virtual void printParameters(OutputStream &out) const
Print all parameters.
std::vector< std::shared_ptr< Parameter > > parameters_
virtual const std::shared_ptr< Parameter > & getParameter(size_t i) const
virtual void setParametersValues(const ParameterList ¶ms)
Update the parameters from the ones in params that have matching names.
virtual std::shared_ptr< Parameter > & getParameter(size_t i)