bpp-core3
3.0.0
|
Parameter transformation from ] b, +inf [ or ] -inf, b [ to ]-inf, + inf [. More...
#include <Bpp/Numeric/TransformedParameter.h>
Public Member Functions | |
RTransformedParameter (const std::string &name, double value, double bound=0, bool positive=true, double scale=1) | |
Build a new RTransformedParameter, with given bound and scale. More... | |
RTransformedParameter * | clone () const |
Create a copy of this object and send a pointer to it. More... | |
void | setOriginalValue (double value) |
Set the value of the parameter using the orignal coordinate system. More... | |
double | getOriginalValue () const |
double | getFirstOrderDerivative () const |
double | getSecondOrderDerivative () const |
virtual void | setName (const std::string &name) |
Set the name of this parameter. More... | |
virtual void | setValue (double value) |
Set the value of this parameter. More... | |
void | setPrecision (double precision) |
Set the precision of this parameter. More... | |
virtual const std::string & | getName () const |
Get the name of this parameter. More... | |
virtual double | getValue () const |
Get the value of this parameter. More... | |
virtual double | getPrecision () const |
Get the precision of this parameter. More... | |
virtual const std::shared_ptr< Constraint > | getConstraint () const |
Return the constraint associated to this parameter if there is one. More... | |
virtual std::shared_ptr< Constraint > | getConstraint () |
Return the constraint associated to this parameter if there is one. More... | |
virtual bool | hasConstraint () const |
Tells if this parameter has a constraint. More... | |
virtual std::shared_ptr< Constraint > | removeConstraint () |
Remove the constraint associated to this parameter. More... | |
virtual void | setConstraint (std::shared_ptr< Constraint > constraint) |
Set a constraint to this parameter. More... | |
virtual void | addParameterListener (ParameterListener *listener, bool attachListener=true) |
Add a new listener to this parameter. More... | |
virtual void | removeParameterListener (const std::string &listenerId) |
Remove all listeners with a given id from this parameter. More... | |
virtual bool | hasParameterListener (const std::string &listenerId) |
Tell is there is a listener with a given id from this parameter. More... | |
Static Public Attributes | |
static const std::shared_ptr< IntervalConstraint > | R_PLUS |
static const std::shared_ptr< IntervalConstraint > | R_PLUS_STAR |
static const std::shared_ptr< IntervalConstraint > | R_MINUS |
static const std::shared_ptr< IntervalConstraint > | R_MINUS_STAR |
static const std::shared_ptr< IntervalConstraint > | PROP_CONSTRAINT_IN |
static const std::shared_ptr< IntervalConstraint > | PROP_CONSTRAINT_EX |
Protected Member Functions | |
void | fireParameterNameChanged (ParameterEvent &event) |
void | fireParameterValueChanged (ParameterEvent &event) |
void | fireParameterConstraintChanged (ParameterEvent &event) |
Protected Attributes | |
std::string | name_ |
double | value_ |
double | precision_ |
std::shared_ptr< Constraint > | constraint_ |
std::vector< ParameterListener * > | listeners_ |
std::vector< bool > | listenerAttach_ |
Private Attributes | |
double | scale_ |
double | bound_ |
bool | positive_ |
Parameter transformation from ] b, +inf [ or ] -inf, b [ to ]-inf, + inf [.
The equation of the tranformation is
for a transformation from ] b, +inf [ to ]-inf, + inf [. The 'b' parameter is the lower bound and 'a' is a scaling factor set to 1 by default. For a transformation from ] -inf, b [, the transformation is then
Definition at line 117 of file TransformedParameter.h.
|
inline |
Build a new RTransformedParameter, with given bound and scale.
name | the name of the parameter. |
value | the value of th eparameter, in orginal coordinates. |
bound | the inerval bound to use. |
positive | tell if the original interval is positive or negative. |
scale | the scaling factor. |
Definition at line 135 of file TransformedParameter.h.
References setOriginalValue().
Referenced by clone().
|
inlinevirtualinherited |
Add a new listener to this parameter.
listener | The listener to add. |
attachListener | Tell if the parameter will own this listener. If so, deep copies will be made when cloning the parameter, and the listener will be destroyed upon destruction of the parameter or upon removal. Alternatively, only superficial copies will be made, and the listener will persist if the parameter is destroyed. |
Definition at line 278 of file Parameter.h.
References bpp::Parameter::listenerAttach_, and bpp::Parameter::listeners_.
Referenced by bpp::AbstractParameterAliasable::aliasParameters().
|
inlinevirtual |
Create a copy of this object and send a pointer to it.
Implements bpp::TransformedParameter.
Definition at line 144 of file TransformedParameter.h.
References RTransformedParameter().
|
inlineprotectedinherited |
Definition at line 316 of file Parameter.h.
References bpp::Parameter::listeners_.
|
inlineprotectedinherited |
Definition at line 300 of file Parameter.h.
References bpp::Parameter::listeners_.
Referenced by bpp::Parameter::setName().
|
inlineprotectedinherited |
Definition at line 308 of file Parameter.h.
References bpp::Parameter::listeners_.
Referenced by bpp::Parameter::setValue().
|
inlinevirtualinherited |
Return the constraint associated to this parameter if there is one.
Definition at line 242 of file Parameter.h.
References bpp::Parameter::constraint_.
|
inlinevirtualinherited |
Return the constraint associated to this parameter if there is one.
Definition at line 233 of file Parameter.h.
References bpp::Parameter::constraint_.
Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::ReparametrizationFunctionWrapper::init_(), bpp::ParameterList::matchParametersValues(), bpp::AliasParameterListener::parameterConstraintChanged(), bpp::ParameterList::setParametersValues(), and bpp::ParameterList::testParametersValues().
|
inlinevirtual |
NotImplementedException | if the transformation does not support derivation or if the derivation was not implemented. |
Implements bpp::TransformedParameter.
Definition at line 166 of file TransformedParameter.h.
References bpp::Parameter::getValue(), positive_, and scale_.
|
inlinevirtualinherited |
Get the name of this parameter.
Definition at line 211 of file Parameter.h.
References bpp::Parameter::name_.
Referenced by bpp::ParameterList::addParameter(), bpp::AbstractParameterAliasable::addParameter_(), bpp::AbstractParameterAliasable::deleteParameter_(), bpp::ParameterList::getCommonParametersWith(), bpp::ParametersStopCondition::getCurrentTolerance(), bpp::NumCalcApplicationTools::getDefaultValue(), bpp::ParameterList::getParameter(), bpp::ParameterList::getParameterValue(), bpp::ParameterList::hasParameter(), bpp::ReparametrizationFunctionWrapper::init_(), bpp::ParametersStopCondition::isToleranceReached(), bpp::AliasParameterListener::parameterConstraintChanged(), bpp::AliasParameterListener::parameterValueChanged(), and bpp::FullHmmTransitionMatrix::setTransitionProbabilities().
|
inlinevirtual |
Implements bpp::TransformedParameter.
Definition at line 156 of file TransformedParameter.h.
References bound_, bpp::Parameter::getValue(), positive_, and scale_.
|
inlinevirtualinherited |
Get the precision of this parameter.
Definition at line 225 of file Parameter.h.
References bpp::Parameter::precision_.
|
inlinevirtual |
NotImplementedException | if the transformation does not support derivation or if the derivation was not implemented. |
Implements bpp::TransformedParameter.
Definition at line 176 of file TransformedParameter.h.
References bpp::Parameter::getValue(), positive_, and scale_.
|
inlinevirtualinherited |
Get the value of this parameter.
Definition at line 218 of file Parameter.h.
References bpp::Parameter::value_.
Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::ParametersStopCondition::getCurrentTolerance(), bpp::NumCalcApplicationTools::getDefaultValue(), getFirstOrderDerivative(), bpp::IntervalTransformedParameter::getFirstOrderDerivative(), getOriginalValue(), bpp::IntervalTransformedParameter::getOriginalValue(), bpp::PlaceboTransformedParameter::getOriginalValue(), bpp::AbstractParametrizable::getParameterValue(), bpp::ParameterList::getParameterValue(), getSecondOrderDerivative(), bpp::IntervalTransformedParameter::getSecondOrderDerivative(), bpp::TestFunction::getValue(), bpp::ReparametrizationFunctionWrapper::init_(), bpp::ParametersStopCondition::isToleranceReached(), bpp::ParameterList::matchParametersValues(), bpp::ParameterList::setAllParametersValues(), bpp::ParameterList::setParametersValues(), and bpp::ParameterList::testParametersValues().
|
inlinevirtualinherited |
Tells if this parameter has a constraint.
Definition at line 249 of file Parameter.h.
References bpp::Parameter::constraint_.
Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::ParameterList::matchParametersValues(), bpp::ParameterList::setParametersValues(), and bpp::ParameterList::testParametersValues().
|
virtualinherited |
Tell is there is a listener with a given id from this parameter.
listenerId | The id of listener to remove. |
Definition at line 165 of file Parameter.cpp.
References bpp::Parameter::listeners_.
|
virtualinherited |
Remove the constraint associated to this parameter.
Warning! The contraint objet is not deleted.
Definition at line 140 of file Parameter.cpp.
References bpp::Parameter::constraint_.
Referenced by bpp::SimpleDiscreteDistribution::restrictToConstraint().
|
virtualinherited |
Remove all listeners with a given id from this parameter.
listenerId | The id of listener to remove. |
Definition at line 149 of file Parameter.cpp.
References bpp::Parameter::listenerAttach_, and bpp::Parameter::listeners_.
Referenced by bpp::AbstractParameterAliasable::unaliasParameters().
|
virtualinherited |
Set a constraint to this parameter.
constraint | a pointer to the constraint (may be null) |
Definition at line 131 of file Parameter.cpp.
References bpp::Parameter::constraint_, and bpp::Parameter::value_.
Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::AliasParameterListener::parameterConstraintChanged(), bpp::ConstantDistribution::restrictToConstraint(), bpp::SimpleDiscreteDistribution::restrictToConstraint(), and bpp::TruncatedExponentialDiscreteDistribution::restrictToConstraint().
|
inlinevirtualinherited |
Set the name of this parameter.
name | the new parameter name. |
Definition at line 185 of file Parameter.h.
References bpp::Parameter::fireParameterNameChanged(), and bpp::Parameter::name_.
Referenced by bpp::ParametrizableCollection< N >::addObject(), and bpp::FullHmmTransitionMatrix::setTransitionProbabilities().
|
inlinevirtual |
Set the value of the parameter using the orignal coordinate system.
value | Parameter value in original coordinates. |
ConstraintException | if the value is not correct. |
Implements bpp::TransformedParameter.
Definition at line 147 of file TransformedParameter.h.
References bound_, positive_, scale_, and bpp::Parameter::setValue().
Referenced by RTransformedParameter().
|
inherited |
Set the precision of this parameter.
precision | the new parameter precision. |
Precision:
Definition at line 124 of file Parameter.cpp.
References bpp::Parameter::precision_.
Referenced by bpp::Parameter::Parameter().
|
virtualinherited |
Set the value of this parameter.
value | the new parameter value. |
Value:
Reimplemented in bpp::AutoParameter.
Definition at line 110 of file Parameter.cpp.
References bpp::Parameter::constraint_, bpp::Parameter::fireParameterValueChanged(), bpp::Parameter::precision_, and bpp::Parameter::value_.
Referenced by bpp::BrentOneDimension::doInit(), bpp::GoldenSectionSearch::doInit(), bpp::BrentOneDimension::doStep(), bpp::GoldenSectionSearch::doStep(), bpp::NewtonBacktrackOneDimension::doStep(), bpp::ReparametrizationFunctionWrapper::fireParameterChanged(), bpp::ParameterList::matchParametersValues(), bpp::Parameter::Parameter(), bpp::AliasParameterListener::parameterValueChanged(), bpp::ParameterList::setAllParametersValues(), setOriginalValue(), bpp::IntervalTransformedParameter::setOriginalValue(), bpp::PlaceboTransformedParameter::setOriginalValue(), bpp::ParameterList::setParametersValues(), bpp::ParameterList::setParameterValue(), and bpp::AutoParameter::setValue().
|
private |
Definition at line 122 of file TransformedParameter.h.
Referenced by getOriginalValue(), and setOriginalValue().
|
protectedinherited |
Definition at line 140 of file Parameter.h.
Referenced by bpp::Parameter::getConstraint(), bpp::Parameter::hasConstraint(), bpp::Parameter::operator=(), bpp::Parameter::removeConstraint(), bpp::Parameter::setConstraint(), bpp::AutoParameter::setValue(), and bpp::Parameter::setValue().
|
protectedinherited |
Definition at line 142 of file Parameter.h.
Referenced by bpp::Parameter::addParameterListener(), bpp::Parameter::operator=(), bpp::Parameter::Parameter(), bpp::Parameter::removeParameterListener(), and bpp::Parameter::~Parameter().
|
protectedinherited |
Definition at line 141 of file Parameter.h.
Referenced by bpp::Parameter::addParameterListener(), bpp::Parameter::fireParameterConstraintChanged(), bpp::Parameter::fireParameterNameChanged(), bpp::Parameter::fireParameterValueChanged(), bpp::Parameter::hasParameterListener(), bpp::Parameter::operator=(), bpp::Parameter::Parameter(), bpp::Parameter::removeParameterListener(), and bpp::Parameter::~Parameter().
|
protectedinherited |
Definition at line 137 of file Parameter.h.
Referenced by bpp::Parameter::getName(), bpp::Parameter::operator=(), bpp::Parameter::setName(), and bpp::AutoParameter::setValue().
|
private |
Definition at line 123 of file TransformedParameter.h.
Referenced by getFirstOrderDerivative(), getOriginalValue(), getSecondOrderDerivative(), and setOriginalValue().
|
protectedinherited |
Definition at line 139 of file Parameter.h.
Referenced by bpp::Parameter::getPrecision(), bpp::Parameter::operator=(), bpp::Parameter::setPrecision(), and bpp::Parameter::setValue().
|
staticinherited |
Definition at line 330 of file Parameter.h.
Referenced by bpp::AutoCorrelationTransitionMatrix::AutoCorrelationTransitionMatrix(), and bpp::Simplex::Simplex().
|
staticinherited |
|
staticinherited |
Definition at line 327 of file Parameter.h.
|
staticinherited |
Definition at line 328 of file Parameter.h.
|
staticinherited |
Definition at line 325 of file Parameter.h.
Referenced by bpp::ExponentialDiscreteDistribution::ExponentialDiscreteDistribution(), and bpp::TruncatedExponentialDiscreteDistribution::TruncatedExponentialDiscreteDistribution().
|
staticinherited |
Definition at line 326 of file Parameter.h.
Referenced by bpp::GaussianDiscreteDistribution::GaussianDiscreteDistribution().
|
private |
Definition at line 121 of file TransformedParameter.h.
Referenced by getFirstOrderDerivative(), getOriginalValue(), getSecondOrderDerivative(), and setOriginalValue().
|
protectedinherited |
Definition at line 138 of file Parameter.h.
Referenced by bpp::Parameter::getValue(), bpp::Parameter::operator=(), bpp::Parameter::setConstraint(), and bpp::Parameter::setValue().