bpp-core3
3.0.0
|
#include <Bpp/Numeric/Function/DirectionFunction.h>
Public Member Functions | |
DirectionFunction (std::shared_ptr< FunctionInterface > function=nullptr) | |
DirectionFunction (const DirectionFunction &df) | |
DirectionFunction & | operator= (const DirectionFunction &df) |
virtual | ~DirectionFunction () |
DirectionFunction * | clone () const override |
Create a copy of this object and send a pointer to it. More... | |
void | setParameters (const ParameterList ¶meters) override |
Set the point where the function must be computed. More... | |
double | getValue () const override |
Get the value of the function at the current point. More... | |
const ParameterList & | getParameters () const override |
Get all parameters available. More... | |
void | init (const ParameterList &p, const std::vector< double > &xi) |
void | autoParameter () |
void | ignoreConstraints () |
void | setConstraintPolicy (const std::string &constraintPolicy) |
std::string | getConstraintPolicy () const |
void | setMessageHandler (std::shared_ptr< OutputStream > messenger) |
std::shared_ptr< FunctionInterface > | getFunction () const |
ParameterList | getFunctionParameters () const |
size_t | getNumberOfParameters () const override |
Get the number of parameters. More... | |
virtual double | f (const ParameterList ¶meters) |
Get the value of the function according to a given set of parameters. More... | |
virtual bool | hasParameter (const std::string &name) const =0 |
Tell if there is a parameter with specified name. More... | |
virtual const Parameter & | parameter (const std::string &name) const =0 |
Get the parameter with specified name. More... | |
virtual double | getParameterValue (const std::string &name) const =0 |
Get the value for parameter of name 'name'. More... | |
virtual void | setAllParametersValues (const ParameterList ¶meters)=0 |
Set the parameters values to be equals to those of parameters. More... | |
virtual void | setParameterValue (const std::string &name, double value)=0 |
Set the value of parameter with name name to be equal to value. More... | |
virtual void | setParametersValues (const ParameterList ¶meters)=0 |
Update the parameters from parameters. More... | |
virtual bool | matchParametersValues (const ParameterList ¶meters)=0 |
Update the parameters from parameters. More... | |
virtual void | removeConstraint (const std::string &name)=0 |
Remove the constraint associated with one parameter, if any. More... | |
virtual void | setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint)=0 |
Set/Change the constraint associated with one parameter. More... | |
virtual void | setNamespace (const std::string &prefix)=0 |
Set the namespace for the parameter names. More... | |
virtual std::string | getNamespace () const =0 |
virtual std::string | getParameterNameWithoutNamespace (const std::string &name) const =0 |
Resolves a parameter name according to the current namespace. More... | |
The Parametrizable interface. | |
bool | hasParameter (const std::string &name) const override |
Tell if there is a parameter with specified name. More... | |
const Parameter & | parameter (const std::string &name) const override |
Get the parameter with specified name. More... | |
double | getParameterValue (const std::string &name) const override |
Get the value for parameter of name 'name'. More... | |
void | setAllParametersValues (const ParameterList ¶meters) override |
Set the parameters values to be equals to those of parameters. More... | |
void | setParameterValue (const std::string &name, double value) override |
Set the value of parameter with name name to be equal to value. More... | |
void | setParametersValues (const ParameterList ¶meters) override |
Update the parameters from parameters. More... | |
bool | matchParametersValues (const ParameterList ¶meters) override |
Update the parameters from parameters. More... | |
void | removeConstraint (const std::string &name) override |
Remove the constraint associated with one parameter, if any. More... | |
void | setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint) override |
Set/Change the constraint associated with one parameter. More... | |
void | setNamespace (const std::string &prefix) override |
Set the namespace for the parameter names. More... | |
std::string | getNamespace () const override |
std::string | getParameterNameWithoutNamespace (const std::string &name) const override |
Resolves a parameter name according to the current namespace. More... | |
Protected Member Functions | |
ParameterList & | getParameters_ () override |
Get all parameters available. More... | |
Protected Attributes | |
ParameterList | parameters_ |
Parameter | parameter_ |
Private Attributes | |
ParameterList | params_ |
ParameterList | p_ |
ParameterList | xt_ |
std::vector< double > | xi_ |
std::shared_ptr< FunctionInterface > | function_ |
std::string | constraintPolicy_ |
std::shared_ptr< OutputStream > | messenger_ |
Definition at line 17 of file DirectionFunction.h.
|
inline |
Definition at line 29 of file DirectionFunction.h.
Referenced by clone().
|
inline |
Definition at line 34 of file DirectionFunction.h.
|
inlinevirtual |
Definition at line 51 of file DirectionFunction.h.
void DirectionFunction::autoParameter | ( | ) |
Definition at line 58 of file DirectionFunction.cpp.
References bpp::AutoParameter::setMessageHandler().
Referenced by clone().
|
inlineoverridevirtual |
Create a copy of this object and send a pointer to it.
Implements bpp::Clonable.
Definition at line 53 of file DirectionFunction.h.
References autoParameter(), DirectionFunction(), getParameters(), getValue(), ignoreConstraints(), init(), and setParameters().
|
inlinevirtualinherited |
Get the value of the function according to a given set of parameters.
parameters | The parameter set to pass to the function. |
Exception | If an error occured. |
Reimplemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, and bpp::AbstractNumericalDerivative.
Definition at line 82 of file Functions.h.
References bpp::FunctionInterface::getValue(), and bpp::FunctionInterface::setParameters().
Referenced by bpp::NumTools::uniRoot().
|
inline |
Definition at line 68 of file DirectionFunction.h.
References constraintPolicy_.
|
inline |
Definition at line 71 of file DirectionFunction.h.
References function_.
|
inline |
Definition at line 75 of file DirectionFunction.h.
References p_.
|
pure virtualinherited |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::Parametrizable::~Parametrizable().
|
inlineoverridevirtualinherited |
Implements bpp::Parametrizable.
Definition at line 204 of file Parametrizable.h.
|
inlineoverridevirtual |
Get the number of parameters.
Implements bpp::Parametrizable.
Definition at line 77 of file DirectionFunction.h.
References getParameters_(), and bpp::ParameterList::size().
|
pure virtualinherited |
Resolves a parameter name according to the current namespace.
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::BppODiscreteDistributionFormat::readDiscreteDistribution(), bpp::BppOParametrizableFormat::write(), and bpp::Parametrizable::~Parametrizable().
|
inlineoverridevirtualinherited |
Resolves a parameter name according to the current namespace.
Implements bpp::Parametrizable.
Definition at line 205 of file Parametrizable.h.
|
overridevirtual |
Get all parameters available.
Implements bpp::Parametrizable.
Definition at line 33 of file DirectionFunction.cpp.
Referenced by clone().
|
overrideprotectedvirtual |
Get all parameters available.
Implements bpp::Parametrizable.
Definition at line 38 of file DirectionFunction.cpp.
Referenced by getNumberOfParameters().
|
pure virtualinherited |
Get the value for parameter of name 'name'.
name | The name of the parameter. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::BppODiscreteDistributionFormat::readDiscreteDistribution(), and bpp::Parametrizable::~Parametrizable().
|
inlineoverridevirtualinherited |
Get the value for parameter of name 'name'.
name | The name of the parameter. |
Implements bpp::Parametrizable.
Definition at line 195 of file Parametrizable.h.
|
overridevirtual |
Get the value of the function at the current point.
Exception | If no point is specified or if an error occured. |
Implements bpp::FunctionInterface.
Definition at line 26 of file DirectionFunction.cpp.
Referenced by clone().
|
pure virtualinherited |
Tell if there is a parameter with specified name.
name | The name of the parameter to look for. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::Parametrizable::~Parametrizable().
|
inlineoverridevirtualinherited |
Tell if there is a parameter with specified name.
name | The name of the parameter to look for. |
Implements bpp::Parametrizable.
Definition at line 192 of file Parametrizable.h.
References bpp::ParameterList::hasParameter().
void DirectionFunction::ignoreConstraints | ( | ) |
Definition at line 70 of file DirectionFunction.cpp.
Referenced by clone().
void DirectionFunction::init | ( | const ParameterList & | p, |
const std::vector< double > & | xi | ||
) |
Definition at line 45 of file DirectionFunction.cpp.
References bpp::AutoParameter::CONSTRAINTS_AUTO, and bpp::AutoParameter::CONSTRAINTS_IGNORE.
Referenced by clone().
|
pure virtualinherited |
Update the parameters from parameters.
Only common parameters with parameters will be updated.
parameters | A list of parameters. |
ConstraintException | If a value in parameters does not match the constraint in the corresponding parameter in the list. |
Implemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::BppODiscreteDistributionFormat::initialize_(), bpp::TestFunction::setParameters(), and bpp::Parametrizable::~Parametrizable().
|
inlineoverridevirtualinherited |
Update the parameters from parameters.
Only common parameters with parameters will be updated.
parameters | A list of parameters. |
ConstraintException | If a value in parameters does not match the constraint in the corresponding parameter in the list. |
Implements bpp::Parametrizable.
Definition at line 199 of file Parametrizable.h.
|
inline |
Definition at line 38 of file DirectionFunction.h.
References constraintPolicy_, function_, messenger_, p_, params_, and xi_.
|
pure virtualinherited |
Get the parameter with specified name.
name | The name of the parameter to look for. |
ParameterNotFoundException | if no parameter with this name is found. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::TestFunction::getValue(), and bpp::Parametrizable::~Parametrizable().
|
inlineoverridevirtualinherited |
Get the parameter with specified name.
name | The name of the parameter to look for. |
ParameterNotFoundException | if no parameter with this name is found. |
Implements bpp::Parametrizable.
Definition at line 194 of file Parametrizable.h.
|
pure virtualinherited |
Remove the constraint associated with one parameter, if any.
name | The name of the parameter to look for. |
ParameterNotFoundException | if no parameter with this name is found. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::Parametrizable::~Parametrizable().
|
inlineoverridevirtualinherited |
Remove the constraint associated with one parameter, if any.
name | The name of the parameter to look for. |
ParameterNotFoundException | if no parameter with this name is found. |
Implements bpp::Parametrizable.
Definition at line 200 of file Parametrizable.h.
|
pure virtualinherited |
Set the parameters values to be equals to those of parameters.
The list must contain exactly the same parameters (ie same names) than the parameters available.
parameters | A list with all parameters. |
ParameterNotFoundException | If a some parameter in the list is not in params. |
ConstraintException | If a value in parameters does not match the constraint in the corresponding parameter in the list. |
Implemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::Parametrizable::~Parametrizable().
|
inlineoverridevirtualinherited |
Set the parameters values to be equals to those of parameters.
The list must contain exactly the same parameters (ie same names) than the parameters available.
parameters | A list with all parameters. |
ParameterNotFoundException | If a some parameter in the list is not in params. |
ConstraintException | If a value in parameters does not match the constraint in the corresponding parameter in the list. |
Implements bpp::Parametrizable.
Definition at line 196 of file Parametrizable.h.
|
pure virtualinherited |
Set/Change the constraint associated with one parameter.
name | The name of the parameter to look for. |
constraint | A pointer to the constraint (may be null) |
ParameterNotFoundException | if no parameter with this name is found. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::Parametrizable::~Parametrizable().
|
inlineoverridevirtualinherited |
Set/Change the constraint associated with one parameter.
name | The name of the parameter to look for. |
constraint | A pointer to the constraint (may be null) |
ParameterNotFoundException | if no parameter with this name is found. |
Implements bpp::Parametrizable.
Definition at line 201 of file Parametrizable.h.
|
inline |
Definition at line 66 of file DirectionFunction.h.
|
inline |
Definition at line 70 of file DirectionFunction.h.
|
pure virtualinherited |
Set the namespace for the parameter names.
prefix | The 'namespace', that is a prefix to add to all parameter names. If parameter names are already prefixed, the new prefix will be used instead. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, bpp::LogsumHmmLikelihood, bpp::RescaledHmmLikelihood, bpp::LowMemoryRescaledHmmLikelihood, bpp::AbstractParameterAliasable, bpp::MixtureOfDiscreteDistributions, bpp::AbstractParametrizable, and bpp::InvariantMixedDiscreteDistribution.
Referenced by bpp::Parametrizable::~Parametrizable().
|
inlineoverridevirtualinherited |
Set the namespace for the parameter names.
prefix | The 'namespace', that is a prefix to add to all parameter names. If parameter names are already prefixed, the new prefix will be used instead. |
Implements bpp::Parametrizable.
Definition at line 203 of file Parametrizable.h.
|
overridevirtual |
Set the point where the function must be computed.
parameters | The parameter set to pass to the function. |
Implements bpp::FunctionInterface.
Definition at line 12 of file DirectionFunction.cpp.
References bpp::ParameterList::setParameters().
Referenced by clone().
|
pure virtualinherited |
Update the parameters from parameters.
parameters must be a subset of all parameters available.
parameters | A list containing all parameters to update. |
ParameterNotFoundException | If a some parameter in params is not in the list. |
ConstraintException | If a value in parameters does not match the constraint in the corresponding parameter in the list. |
Implemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::Parametrizable::~Parametrizable().
|
inlineoverridevirtualinherited |
Update the parameters from parameters.
parameters must be a subset of all parameters available.
parameters | A list containing all parameters to update. |
ParameterNotFoundException | If a some parameter in params is not in the list. |
ConstraintException | If a value in parameters does not match the constraint in the corresponding parameter in the list. |
Implements bpp::Parametrizable.
Definition at line 198 of file Parametrizable.h.
|
pure virtualinherited |
Set the value of parameter with name name to be equal to value.
name | the name of the parameter to set. |
value | The value of the parameter. |
ParameterNotFoundException | If no parameter in the list has the name name. |
ConstraintException | If value does not match the constraint associated to parameter name. |
Implemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::Parametrizable::~Parametrizable().
|
inlineoverridevirtualinherited |
Set the value of parameter with name name to be equal to value.
name | the name of the parameter to set. |
value | The value of the parameter. |
ParameterNotFoundException | If no parameter in the list has the name name. |
ConstraintException | If value does not match the constraint associated to parameter name. |
Implements bpp::Parametrizable.
Definition at line 197 of file Parametrizable.h.
|
private |
Definition at line 25 of file DirectionFunction.h.
Referenced by getConstraintPolicy(), and operator=().
|
private |
Definition at line 24 of file DirectionFunction.h.
Referenced by getFunction(), and operator=().
|
private |
Definition at line 26 of file DirectionFunction.h.
Referenced by operator=().
|
mutableprivate |
Definition at line 22 of file DirectionFunction.h.
Referenced by getFunctionParameters(), and operator=().
|
protectedinherited |
Definition at line 180 of file Parametrizable.h.
|
protectedinherited |
Definition at line 179 of file Parametrizable.h.
|
mutableprivate |
Definition at line 22 of file DirectionFunction.h.
Referenced by operator=().
|
private |
Definition at line 23 of file DirectionFunction.h.
Referenced by operator=().
|
mutableprivate |
Definition at line 22 of file DirectionFunction.h.