bpp-core3  3.0.0
bpp::TransformedParameter Class Referenceabstract

The TransformedParameter abstract class. More...

#include <Bpp/Numeric/TransformedParameter.h>

+ Inheritance diagram for bpp::TransformedParameter:
+ Collaboration diagram for bpp::TransformedParameter:

Public Member Functions

 TransformedParameter (const std::string &name, double value)
 
TransformedParameterclone () const =0
 Create a copy of this object and send a pointer to it. More...
 
virtual void setOriginalValue (double value)=0
 Set the value of the parameter using the orignal coordinate system. More...
 
virtual double getOriginalValue () const =0
 
virtual double getFirstOrderDerivative () const =0
 
virtual double getSecondOrderDerivative () const =0
 
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 ConstraintInterfacegetConstraint () const
 Return the constraint associated to this parameter if there is one. More...
 
virtual std::shared_ptr< ConstraintInterfacegetConstraint ()
 Return the constraint associated to this parameter if there is one. More...
 
virtual const ConstraintInterfaceconstraint () const
 Return the constraint associated to this parameter if there is one. More...
 
virtual ConstraintInterfaceconstraint ()
 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< ConstraintInterfaceremoveConstraint ()
 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< IntervalConstraintR_PLUS
 
static const std::shared_ptr< IntervalConstraintR_PLUS_STAR
 
static const std::shared_ptr< IntervalConstraintR_MINUS
 
static const std::shared_ptr< IntervalConstraintR_MINUS_STAR
 
static const std::shared_ptr< IntervalConstraintPROP_CONSTRAINT_IN
 
static const std::shared_ptr< IntervalConstraintPROP_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< ConstraintInterfaceconstraint_
 
std::vector< std::shared_ptr< ParameterListener > > listeners_
 

Detailed Description

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 23 of file TransformedParameter.h.

Constructor & Destructor Documentation

◆ TransformedParameter()

bpp::TransformedParameter::TransformedParameter ( const std::string &  name,
double  value 
)
inline

Member Function Documentation

◆ addParameterListener()

virtual void bpp::Parameter::addParameterListener ( std::shared_ptr< ParameterListener listener)
inlinevirtualinherited

Add a new listener to this parameter.

Parameters
listenerThe listener to add.

Definition at line 261 of file Parameter.h.

Referenced by bpp::AbstractParameterAliasable::aliasParameters().

◆ clone()

TransformedParameter* bpp::TransformedParameter::clone ( ) const
pure virtual

Create a copy of this object and send a pointer to it.

Returns
A pointer toward the copy object.

Reimplemented from bpp::Parameter.

Implemented in bpp::PlaceboTransformedParameter, bpp::IntervalTransformedParameter, and bpp::RTransformedParameter.

Referenced by TransformedParameter().

◆ constraint() [1/2]

virtual const ConstraintInterface& bpp::Parameter::constraint ( ) const
inlinevirtualinherited

Return the constraint associated to this parameter if there is one.

Returns
A referec toward the constraint if there is one, otherwise throw an exception.

Definition at line 203 of file Parameter.h.

Referenced by bpp::Parameter::setConstraint().

◆ constraint() [2/2]

virtual ConstraintInterface& bpp::Parameter::constraint ( )
inlinevirtualinherited

Return the constraint associated to this parameter if there is one.

Returns
A referec toward the constraint if there is one, otherwise throw an exception.

Definition at line 225 of file Parameter.h.

◆ fireParameterConstraintChanged()

void bpp::Parameter::fireParameterConstraintChanged ( ParameterEvent event)
inlineprotectedinherited

Definition at line 298 of file Parameter.h.

◆ fireParameterNameChanged()

void bpp::Parameter::fireParameterNameChanged ( ParameterEvent event)
inlineprotectedinherited

Definition at line 282 of file Parameter.h.

◆ fireParameterValueChanged()

void bpp::Parameter::fireParameterValueChanged ( ParameterEvent event)
inlineprotectedinherited

Definition at line 290 of file Parameter.h.

Referenced by bpp::Parameter::setValue().

◆ getConstraint() [1/2]

virtual std::shared_ptr<const ConstraintInterface> bpp::Parameter::getConstraint ( ) const
inlinevirtualinherited

Return the constraint associated to this parameter if there is one.

Returns
A shared pointer toward the constraint, or NULL if there is no constraint.

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().

◆ getConstraint() [2/2]

virtual std::shared_ptr<ConstraintInterface> bpp::Parameter::getConstraint ( )
inlinevirtualinherited

Return the constraint associated to this parameter if there is one.

Returns
A shared pointer toward the constraint, or NULL if there is no constraint.

Definition at line 218 of file Parameter.h.

◆ getFirstOrderDerivative()

virtual double bpp::TransformedParameter::getFirstOrderDerivative ( ) const
pure virtual
Returns
The first order derivative of the transformation at the original point.
Exceptions
NotImplementedExceptionif the transformation does not support derivation or if the derivation was not implemented.

Implemented in bpp::PlaceboTransformedParameter, bpp::IntervalTransformedParameter, and bpp::RTransformedParameter.

Referenced by TransformedParameter().

◆ getName()

◆ getOriginalValue()

virtual double bpp::TransformedParameter::getOriginalValue ( ) const
pure virtual
Returns
The current value of the parameter in orignal coordinates.

Implemented in bpp::PlaceboTransformedParameter, bpp::IntervalTransformedParameter, and bpp::RTransformedParameter.

Referenced by TransformedParameter().

◆ getPrecision()

virtual double bpp::Parameter::getPrecision ( ) const
inlinevirtualinherited

Get the precision of this parameter.

Returns
The precision value.

Definition at line 188 of file Parameter.h.

◆ getSecondOrderDerivative()

virtual double bpp::TransformedParameter::getSecondOrderDerivative ( ) const
pure virtual
Returns
The second order derivative of the transformation at the original point.
Exceptions
NotImplementedExceptionif the transformation does not support derivation or if the derivation was not implemented.

Implemented in bpp::PlaceboTransformedParameter, bpp::IntervalTransformedParameter, and bpp::RTransformedParameter.

Referenced by TransformedParameter().

◆ getValue()

◆ hasConstraint()

virtual bool bpp::Parameter::hasConstraint ( ) const
inlinevirtualinherited

Tells if this parameter has a constraint.

Returns
True if this parameter has a contraint.

Definition at line 238 of file Parameter.h.

Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::ParameterList::matchParametersValues(), bpp::ParameterList::setParametersValues(), and bpp::ParameterList::testParametersValues().

◆ hasParameterListener()

bool Parameter::hasParameterListener ( const std::string &  listenerId)
virtualinherited

Tell is there is a listener with a given id from this parameter.

Parameters
listenerIdThe id of listener to remove.
Returns
True if at list one listener with the given id was found.

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.

◆ removeConstraint()

std::shared_ptr< ConstraintInterface > Parameter::removeConstraint ( )
virtualinherited

Remove the constraint associated to this parameter.

Warning! The contraint objet is not deleted.

Returns
A pointer toward the formerly used contraint.

Definition at line 85 of file Parameter.cpp.

References bpp::Parameter::constraint_.

Referenced by bpp::AbstractParametrizable::removeConstraint(), and bpp::SimpleDiscreteDistribution::restrictToConstraint().

◆ removeParameterListener()

void Parameter::removeParameterListener ( const std::string &  listenerId)
virtualinherited

Remove all listeners with a given id from this parameter.

Parameters
listenerIdThe id of listener to remove.

Definition at line 94 of file Parameter.cpp.

References bpp::Parameter::listeners_.

Referenced by bpp::AbstractParameterAliasable::unaliasParameters().

◆ setConstraint()

◆ setName()

virtual void bpp::Parameter::setName ( const std::string &  name)
inlinevirtualinherited

Set the name of this parameter.

Parameters
namethe new parameter name.

Definition at line 148 of file Parameter.h.

Referenced by bpp::ParametrizableCollection< N >::addObject(), and bpp::FullHmmTransitionMatrix::setTransitionProbabilities().

◆ setOriginalValue()

virtual void bpp::TransformedParameter::setOriginalValue ( double  value)
pure virtual

Set the value of the parameter using the orignal coordinate system.

Parameters
valueParameter value in original coordinates.
Exceptions
ConstraintExceptionif the value is not correct.

Implemented in bpp::PlaceboTransformedParameter, bpp::IntervalTransformedParameter, and bpp::RTransformedParameter.

Referenced by bpp::RTransformedParameter::RTransformedParameter(), and TransformedParameter().

◆ setPrecision()

void Parameter::setPrecision ( double  precision)
inherited

Set the precision of this parameter.

Parameters
precisionthe new parameter precision.

Precision:

Definition at line 69 of file Parameter.cpp.

References bpp::Parameter::precision_.

Referenced by bpp::Parameter::Parameter().

◆ setValue()

Member Data Documentation

◆ constraint_

std::shared_ptr<ConstraintInterface> bpp::Parameter::constraint_
protectedinherited

◆ listeners_

std::vector< std::shared_ptr<ParameterListener> > bpp::Parameter::listeners_
protectedinherited

◆ name_

std::string bpp::Parameter::name_
protectedinherited

Definition at line 101 of file Parameter.h.

Referenced by bpp::Parameter::operator=(), and bpp::AutoParameter::setValue().

◆ precision_

double bpp::Parameter::precision_
protectedinherited

◆ PROP_CONSTRAINT_EX

const std::shared_ptr< IntervalConstraint > Parameter::PROP_CONSTRAINT_EX
staticinherited

◆ PROP_CONSTRAINT_IN

◆ R_MINUS

const std::shared_ptr< IntervalConstraint > Parameter::R_MINUS
staticinherited

Definition at line 309 of file Parameter.h.

Referenced by bpp::Parameter::hasParameterListener().

◆ R_MINUS_STAR

const std::shared_ptr< IntervalConstraint > Parameter::R_MINUS_STAR
staticinherited

Definition at line 310 of file Parameter.h.

Referenced by bpp::Parameter::hasParameterListener().

◆ R_PLUS

◆ R_PLUS_STAR

const std::shared_ptr< IntervalConstraint > Parameter::R_PLUS_STAR
staticinherited

◆ value_

double bpp::Parameter::value_
protectedinherited

The documentation for this class was generated from the following file: