bpp-core
2.2.0
|
The TransformedParameter abstract class. More...
#include <Bpp/Numeric/TransformedParameter.h>
Public Member Functions | |
TransformedParameter (const std::string &name, double value) | |
TransformedParameter * | clone () const =0 |
Create a copy of this object and send a pointer to it. More... | |
virtual void | setOriginalValue (double value)=0 throw (ConstraintException) |
Set the value of the parameter using the orignal coordinate system. More... | |
virtual double | getOriginalValue () const =0 |
virtual double | getFirstOrderDerivative () const =0 throw (NotImplementedException) |
virtual double | getSecondOrderDerivative () const =0 throw (NotImplementedException) |
virtual void | setName (const std::string &name) |
Set the name of this parameter. More... | |
virtual void | setValue (double value) throw (ConstraintException) |
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 Constraint * | getConstraint () const |
Return the constraint associated to this parameter if there is one. More... | |
virtual 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 const Constraint * | removeConstraint () |
Remove the constraint associated to this parameter. More... | |
virtual void | setConstraint (Constraint *constraint, bool attach=false) |
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 IntervalConstraint | R_PLUS |
static const IntervalConstraint | R_PLUS_STAR |
static const IntervalConstraint | R_MINUS |
static const IntervalConstraint | R_MINUS_STAR |
static const IntervalConstraint | PROP_CONSTRAINT_IN |
static const IntervalConstraint | PROP_CONSTRAINT_EX |
Protected Member Functions | |
void | fireParameterNameChanged (ParameterEvent &event) |
void | fireParameterValueChanged (ParameterEvent &event) |
Protected Attributes | |
std::string | name_ |
double | value_ |
double | precision_ |
Constraint * | constraint_ |
bool | attach_ |
std::vector< ParameterListener * > | listeners_ |
std::vector< bool > | listenerAttach_ |
The TransformedParameter abstract class.
This class extends the Parameter class. A transformed parameter does not have a constraint attached to it, and is supposed to range from -inf to +inf. It uses a transformation in order to do this, typically using a bijection. The exact function used to achieve the transformation depends on the implementation of the interface.
Definition at line 59 of file TransformedParameter.h.
|
inline |
Definition at line 63 of file TransformedParameter.h.
|
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 298 of file Parameter.h.
References bpp::Parameter::listenerAttach_, and bpp::Parameter::listeners_.
Referenced by bpp::AbstractParameterAliasable::aliasParameters().
|
pure virtual |
Create a copy of this object and send a pointer to it.
Reimplemented from bpp::Parameter.
Implemented in bpp::PlaceboTransformedParameter, bpp::IntervalTransformedParameter, and bpp::RTransformedParameter.
|
inlineprotectedinherited |
Definition at line 320 of file Parameter.h.
References bpp::Parameter::listeners_.
Referenced by bpp::Parameter::setName().
|
inlineprotectedinherited |
Definition at line 325 of file Parameter.h.
References bpp::Parameter::listeners_.
|
inlinevirtualinherited |
Return the constraint associated to this parameter if there is one.
Definition at line 255 of file Parameter.h.
References bpp::Parameter::constraint_.
Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::ReparametrizationFunctionWrapper::init_(), bpp::ParameterList::matchParametersValues(), bpp::ParameterList::setParametersValues(), and bpp::ParameterList::testParametersValues().
|
inlinevirtualinherited |
Return the constraint associated to this parameter if there is one.
Definition at line 262 of file Parameter.h.
References bpp::Parameter::constraint_.
|
pure virtual |
NotImplementedException | if the transformation does not support derivation or if the derivation was not implemented. |
Implemented in bpp::PlaceboTransformedParameter, bpp::IntervalTransformedParameter, and bpp::RTransformedParameter.
|
inlinevirtualinherited |
Get the name of this parameter.
Definition at line 234 of file Parameter.h.
References bpp::Parameter::name_.
Referenced by bpp::ParameterList::deleteParameter(), bpp::AbstractParameterAliasable::deleteParameter_(), bpp::FullHmmTransitionMatrix::FullHmmTransitionMatrix(), 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::parameterValueChanged(), and bpp::FullHmmTransitionMatrix::setTransitionProbabilities().
|
pure virtual |
Implemented in bpp::PlaceboTransformedParameter, bpp::IntervalTransformedParameter, and bpp::RTransformedParameter.
|
inlinevirtualinherited |
Get the precision of this parameter.
Definition at line 248 of file Parameter.h.
References bpp::Parameter::precision_.
|
pure virtual |
NotImplementedException | if the transformation does not support derivation or if the derivation was not implemented. |
Implemented in bpp::PlaceboTransformedParameter, bpp::IntervalTransformedParameter, and bpp::RTransformedParameter.
|
inlinevirtualinherited |
Get the value of this parameter.
Definition at line 241 of file Parameter.h.
References bpp::Parameter::value_.
Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::ParametersStopCondition::getCurrentTolerance(), bpp::NumCalcApplicationTools::getDefaultValue(), bpp::RTransformedParameter::getFirstOrderDerivative(), bpp::IntervalTransformedParameter::getFirstOrderDerivative(), bpp::RTransformedParameter::getOriginalValue(), bpp::IntervalTransformedParameter::getOriginalValue(), bpp::PlaceboTransformedParameter::getOriginalValue(), bpp::AbstractParametrizable::getParameterValue(), bpp::ParameterList::getParameterValue(), bpp::RTransformedParameter::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 269 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 187 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 163 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 172 of file Parameter.cpp.
References bpp::Parameter::listenerAttach_, and bpp::Parameter::listeners_.
|
virtualinherited |
Set a constraint to this parameter.
constraint | a pointer to the constraint (may be null) |
attach | says if the constraint is attached to the Parameter (default: false). |
Definition at line 143 of file Parameter.cpp.
References bpp::Parameter::attach_, bpp::Parameter::constraint_, bpp::Constraint::isCorrect(), and bpp::Parameter::value_.
Referenced by bpp::ConstantDistribution::restrictToConstraint(), bpp::TruncatedExponentialDiscreteDistribution::restrictToConstraint(), and bpp::SimpleDiscreteDistribution::restrictToConstraint().
|
inlinevirtualinherited |
Set the name of this parameter.
name | the new parameter name. |
Definition at line 208 of file Parameter.h.
References bpp::Parameter::fireParameterNameChanged(), and bpp::Parameter::name_.
Referenced by bpp::ParametrizableCollection< N >::addObject(), bpp::FullHmmTransitionMatrix::FullHmmTransitionMatrix(), and bpp::FullHmmTransitionMatrix::setTransitionProbabilities().
|
pure virtual |
Set the value of the parameter using the orignal coordinate system.
value | Parameter value in original coordinates. |
ConstraintException | if the value is not correct. |
Implemented in bpp::PlaceboTransformedParameter, bpp::IntervalTransformedParameter, and bpp::RTransformedParameter.
Referenced by bpp::RTransformedParameter::RTransformedParameter().
|
inherited |
Set the precision of this parameter.
precision | the new parameter precision. |
Precision:
Definition at line 136 of file Parameter.cpp.
References bpp::Parameter::precision_.
|
virtualinherited |
Set the value of this parameter.
value | the new parameter value. |
Value:
Reimplemented in bpp::AutoParameter.
Definition at line 123 of file Parameter.cpp.
Referenced by bpp::NewtonBacktrackOneDimension::doStep(), bpp::GoldenSectionSearch::doStep(), bpp::BrentOneDimension::doStep(), bpp::ReparametrizationFunctionWrapper::fireParameterChanged(), bpp::ParameterList::matchParametersValues(), bpp::AliasParameterListener::parameterValueChanged(), bpp::ParameterList::setAllParametersValues(), bpp::RTransformedParameter::setOriginalValue(), bpp::IntervalTransformedParameter::setOriginalValue(), bpp::PlaceboTransformedParameter::setOriginalValue(), bpp::ParameterList::setParametersValues(), bpp::ParameterList::setParameterValue(), and bpp::AutoParameter::setValue().
|
protectedinherited |
Definition at line 143 of file Parameter.h.
Referenced by bpp::Parameter::operator=(), bpp::Parameter::Parameter(), bpp::Parameter::setConstraint(), and bpp::Parameter::~Parameter().
|
protectedinherited |
Definition at line 142 of file Parameter.h.
Referenced by bpp::Parameter::getConstraint(), bpp::Parameter::hasConstraint(), bpp::Parameter::operator=(), bpp::Parameter::Parameter(), bpp::Parameter::removeConstraint(), bpp::Parameter::setConstraint(), and bpp::Parameter::~Parameter().
|
protectedinherited |
Definition at line 145 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 144 of file Parameter.h.
Referenced by bpp::Parameter::addParameterListener(), 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 139 of file Parameter.h.
Referenced by bpp::Parameter::getName(), bpp::Parameter::operator=(), and bpp::Parameter::setName().
|
protectedinherited |
Definition at line 141 of file Parameter.h.
Referenced by bpp::Parameter::getPrecision(), bpp::Parameter::operator=(), and bpp::Parameter::setPrecision().
|
staticinherited |
Definition at line 337 of file Parameter.h.
Referenced by bpp::AutoCorrelationTransitionMatrix::AutoCorrelationTransitionMatrix(), and bpp::Simplex::Simplex().
|
staticinherited |
|
staticinherited |
Definition at line 334 of file Parameter.h.
|
staticinherited |
Definition at line 335 of file Parameter.h.
|
staticinherited |
Definition at line 332 of file Parameter.h.
Referenced by bpp::ExponentialDiscreteDistribution::ExponentialDiscreteDistribution(), and bpp::TruncatedExponentialDiscreteDistribution::TruncatedExponentialDiscreteDistribution().
|
staticinherited |
Definition at line 333 of file Parameter.h.
Referenced by bpp::GaussianDiscreteDistribution::GaussianDiscreteDistribution().
|
protectedinherited |
Definition at line 140 of file Parameter.h.
Referenced by bpp::Parameter::getValue(), bpp::Parameter::operator=(), and bpp::Parameter::setConstraint().