bpp-core3
3.0.0
|
Parameter transformation from ] a, b [ to ]-inf, + inf [. More...
#include <Bpp/Numeric/TransformedParameter.h>
Public Member Functions | |
IntervalTransformedParameter (const std::string &name, double value, double lowerBound=0, double upperBound=1, double scale=1, bool hyper=true) | |
Build a new IntervalTransformedParameter, with given bounds and scale. More... | |
IntervalTransformedParameter * | 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 std::shared_ptr< const ConstraintInterface > | getConstraint () const |
Return the constraint associated to this parameter if there is one. More... | |
virtual std::shared_ptr< ConstraintInterface > | getConstraint () |
Return the constraint associated to this parameter if there is one. More... | |
virtual const ConstraintInterface & | constraint () const |
Return the constraint associated to this parameter if there is one. More... | |
virtual ConstraintInterface & | constraint () |
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< ConstraintInterface > | removeConstraint () |
Remove the constraint associated to this parameter. More... | |
virtual void | setConstraint (std::shared_ptr< ConstraintInterface > constraint) |
Set a constraint to this parameter. More... | |
virtual void | addParameterListener (std::shared_ptr< ParameterListener > listener) |
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< ConstraintInterface > | constraint_ |
std::vector< std::shared_ptr< ParameterListener > > | listeners_ |
Private Attributes | |
double | scale_ |
double | lowerBound_ |
double | upperBound_ |
bool | hyper_ |
double | tiny_ |
Parameter transformation from ] a, b [ to ]-inf, + inf [.
The equation of the tranformation is
The 'a' and 'b' parameters are the lower and upper bounds and 's' is a scaling factor set to 1 by default. If the hyperbolic option is set to true (the default), then the following transformation is used instead:
Definition at line 165 of file TransformedParameter.h.
|
inline |
Build a new IntervalTransformedParameter, with given bounds and scale.
name | the name of the parameter. |
value | the value of th eparameter, in orginal coordinates. |
lowerBound | the inerval lower bound to use. |
upperBound | the inerval lower bound to use. |
scale | the scaling factor. |
hyper | tell if the hyberbolic function should be used (true by default). |
Definition at line 186 of file TransformedParameter.h.
|
inlinevirtualinherited |
Add a new listener to this parameter.
listener | The listener to add. |
Definition at line 261 of file Parameter.h.
Referenced by bpp::AbstractParameterAliasable::aliasParameters().
|
inlinevirtual |
Create a copy of this object and send a pointer to it.
Implements bpp::TransformedParameter.
Definition at line 197 of file TransformedParameter.h.
|
inlinevirtualinherited |
Return the constraint associated to this parameter if there is one.
Definition at line 203 of file Parameter.h.
Referenced by bpp::Parameter::setConstraint().
|
inlinevirtualinherited |
Return the constraint associated to this parameter if there is one.
Definition at line 225 of file Parameter.h.
|
inlineprotectedinherited |
Definition at line 298 of file Parameter.h.
|
inlineprotectedinherited |
Definition at line 282 of file Parameter.h.
|
inlineprotectedinherited |
Definition at line 290 of file Parameter.h.
Referenced by bpp::Parameter::setValue().
|
inlinevirtualinherited |
Return the constraint associated to this parameter if there is one.
Definition at line 196 of file Parameter.h.
Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::ReparametrizationFunctionWrapper::init_(), bpp::ParameterList::matchParametersValues(), bpp::AliasParameterListener::parameterConstraintChanged(), bpp::ParameterList::setParametersValues(), and bpp::ParameterList::testParametersValues().
|
inlinevirtualinherited |
Return the constraint associated to this parameter if there is one.
Definition at line 218 of file Parameter.h.
|
inlinevirtual |
NotImplementedException | if the transformation does not support derivation or if the derivation was not implemented. |
Implements bpp::TransformedParameter.
Definition at line 218 of file TransformedParameter.h.
References bpp::Parameter::getValue(), and bpp::NumConstants::PI().
|
inlinevirtualinherited |
Get the name of this parameter.
Definition at line 174 of file Parameter.h.
Referenced by bpp::ParameterList::addParameter(), bpp::AbstractParameterAliasable::addParameter_(), bpp::ParameterList::getCommonParametersWith(), bpp::ParametersStopCondition::getCurrentTolerance(), bpp::NumCalcApplicationTools::getDefaultValue(), bpp::ParameterList::getParameterValue(), bpp::ParameterList::hasParameter(), bpp::ReparametrizationFunctionWrapper::init_(), bpp::ParametersStopCondition::isToleranceReached(), bpp::ParameterList::parameter(), bpp::AliasParameterListener::parameterConstraintChanged(), bpp::AliasParameterListener::parameterValueChanged(), and bpp::FullHmmTransitionMatrix::setTransitionProbabilities().
|
inlinevirtual |
Implements bpp::TransformedParameter.
Definition at line 208 of file TransformedParameter.h.
References bpp::Parameter::getValue(), and bpp::NumConstants::PI().
|
inlinevirtualinherited |
Get the precision of this parameter.
Definition at line 188 of file Parameter.h.
|
inlinevirtual |
NotImplementedException | if the transformation does not support derivation or if the derivation was not implemented. |
Implements bpp::TransformedParameter.
Definition at line 226 of file TransformedParameter.h.
References bpp::Parameter::getValue(), and bpp::NumConstants::PI().
|
inlinevirtualinherited |
Get the value of this parameter.
Definition at line 181 of file Parameter.h.
Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::ParametersStopCondition::getCurrentTolerance(), bpp::NumCalcApplicationTools::getDefaultValue(), bpp::RTransformedParameter::getFirstOrderDerivative(), getFirstOrderDerivative(), bpp::RTransformedParameter::getOriginalValue(), getOriginalValue(), bpp::PlaceboTransformedParameter::getOriginalValue(), bpp::AbstractParametrizable::getParameterValue(), bpp::ParameterList::getParameterValue(), bpp::RTransformedParameter::getSecondOrderDerivative(), 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 238 of file Parameter.h.
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 104 of file Parameter.cpp.
References bpp::Parameter::listeners_, bpp::Parameter::PROP_CONSTRAINT_EX, bpp::Parameter::PROP_CONSTRAINT_IN, bpp::Parameter::R_MINUS, bpp::Parameter::R_MINUS_STAR, bpp::Parameter::R_PLUS, and bpp::Parameter::R_PLUS_STAR.
|
virtualinherited |
Remove the constraint associated to this parameter.
Warning! The contraint objet is not deleted.
Definition at line 85 of file Parameter.cpp.
References bpp::Parameter::constraint_.
Referenced by bpp::AbstractParametrizable::removeConstraint(), and bpp::SimpleDiscreteDistribution::restrictToConstraint().
|
virtualinherited |
Remove all listeners with a given id from this parameter.
listenerId | The id of listener to remove. |
Definition at line 94 of file Parameter.cpp.
References bpp::Parameter::listeners_.
Referenced by bpp::AbstractParameterAliasable::unaliasParameters().
|
virtualinherited |
Set a constraint to this parameter.
constraint | A pointer to the constraint (may be null) |
Constraint:
Definition at line 76 of file Parameter.cpp.
References bpp::Parameter::constraint(), bpp::Parameter::constraint_, and bpp::Parameter::value_.
Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::AliasParameterListener::parameterConstraintChanged(), bpp::ConstantDistribution::restrictToConstraint(), bpp::TruncatedExponentialDiscreteDistribution::restrictToConstraint(), bpp::SimpleDiscreteDistribution::restrictToConstraint(), and bpp::AbstractParametrizable::setConstraint().
|
inlinevirtualinherited |
Set the name of this parameter.
name | the new parameter name. |
Definition at line 148 of file Parameter.h.
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 200 of file TransformedParameter.h.
References bpp::NumConstants::PI(), and bpp::Parameter::setValue().
|
inherited |
Set the precision of this parameter.
precision | the new parameter precision. |
Precision:
Definition at line 69 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 55 of file Parameter.cpp.
References bpp::Parameter::constraint_, bpp::Parameter::fireParameterValueChanged(), bpp::Parameter::precision_, and bpp::Parameter::value_.
Referenced by bpp::GoldenSectionSearch::doInit(), bpp::BrentOneDimension::doInit(), bpp::NewtonBacktrackOneDimension::doStep(), bpp::GoldenSectionSearch::doStep(), bpp::BrentOneDimension::doStep(), bpp::ReparametrizationFunctionWrapper::fireParameterChanged(), bpp::ParameterList::matchParametersValues(), bpp::Parameter::Parameter(), bpp::AliasParameterListener::parameterValueChanged(), bpp::ParameterList::setAllParametersValues(), bpp::RTransformedParameter::setOriginalValue(), setOriginalValue(), bpp::PlaceboTransformedParameter::setOriginalValue(), bpp::ParameterList::setParametersValues(), bpp::ParameterList::setParameterValue(), and bpp::AutoParameter::setValue().
|
protectedinherited |
Definition at line 104 of file Parameter.h.
Referenced by bpp::Parameter::operator=(), bpp::Parameter::removeConstraint(), bpp::Parameter::setConstraint(), bpp::AutoParameter::setValue(), and bpp::Parameter::setValue().
|
private |
Definition at line 172 of file TransformedParameter.h.
|
protectedinherited |
Definition at line 105 of file Parameter.h.
Referenced by bpp::Parameter::hasParameterListener(), bpp::Parameter::operator=(), and bpp::Parameter::removeParameterListener().
|
private |
Definition at line 170 of file TransformedParameter.h.
|
protectedinherited |
Definition at line 101 of file Parameter.h.
Referenced by bpp::Parameter::operator=(), and bpp::AutoParameter::setValue().
|
protectedinherited |
Definition at line 103 of file Parameter.h.
Referenced by bpp::Parameter::operator=(), bpp::Parameter::setPrecision(), and bpp::Parameter::setValue().
|
staticinherited |
Definition at line 312 of file Parameter.h.
Referenced by bpp::AutoCorrelationTransitionMatrix::AutoCorrelationTransitionMatrix(), bpp::Parameter::hasParameterListener(), and bpp::Simplex::Simplex().
|
staticinherited |
Definition at line 311 of file Parameter.h.
Referenced by bpp::Parameter::hasParameterListener(), bpp::InvariantMixedDiscreteDistribution::InvariantMixedDiscreteDistribution(), bpp::MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions(), bpp::SimpleDiscreteDistribution::SimpleDiscreteDistribution(), and bpp::Simplex::Simplex().
|
staticinherited |
Definition at line 309 of file Parameter.h.
Referenced by bpp::Parameter::hasParameterListener().
|
staticinherited |
Definition at line 310 of file Parameter.h.
Referenced by bpp::Parameter::hasParameterListener().
|
staticinherited |
Definition at line 307 of file Parameter.h.
Referenced by bpp::ExponentialDiscreteDistribution::ExponentialDiscreteDistribution(), bpp::Parameter::hasParameterListener(), and bpp::TruncatedExponentialDiscreteDistribution::TruncatedExponentialDiscreteDistribution().
|
staticinherited |
Definition at line 308 of file Parameter.h.
Referenced by bpp::GaussianDiscreteDistribution::GaussianDiscreteDistribution(), and bpp::Parameter::hasParameterListener().
|
private |
Definition at line 169 of file TransformedParameter.h.
|
private |
Definition at line 173 of file TransformedParameter.h.
|
private |
Definition at line 171 of file TransformedParameter.h.
|
protectedinherited |
Definition at line 102 of file Parameter.h.
Referenced by bpp::Parameter::operator=(), bpp::Parameter::setConstraint(), and bpp::Parameter::setValue().