bpp-core3
3.0.0
|
General class that wraps a function into another one. This class is meant to be derivated and just provides a general framework. More...
#include <Bpp/Numeric/Function/Functions.h>
Public Member Functions | |
SecondOrderDerivableWrapper (std::shared_ptr< SecondOrderDerivable > function) | |
void | enableSecondOrderDerivatives (bool yn) |
Tell if derivatives must be computed. More... | |
bool | enableSecondOrderDerivatives () const |
Tell if derivatives must be computed. More... | |
double | getSecondOrderDerivative (const std::string &variable) const |
Get the second order derivative of the function at the current point. More... | |
double | getSecondOrderDerivative (const std::string &variable1, const std::string &variable2) const |
Get the value of the cross derivative of the function according to a given set of parameters. More... | |
void | enableFirstOrderDerivatives (bool yn) |
Tell if derivatives must be computed. More... | |
bool | enableFirstOrderDerivatives () const |
Tell if derivatives must be computed. More... | |
double | getFirstOrderDerivative (const std::string &variable) const |
Get the derivative of the function at the current point. More... | |
bool | hasParameter (const std::string &name) const override |
Tell if there is a parameter with specified name. More... | |
void | setParameters (const ParameterList ¶meters) override |
Set the point where the function must be computed. More... | |
const ParameterList & | getParameters () const override |
Get all parameters available. More... | |
const Parameter & | parameter (const std::string &name) const override |
Get the parameter with specified name. More... | |
double | getValue () const override |
Get the value of the function at the current point. More... | |
double | f (const ParameterList ¶meters) override |
Get the value of the function according to a given set of parameters. 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... | |
size_t | getNumberOfParameters () const override |
Get the number of parameters. 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... | |
virtual Clonable * | clone () const =0 |
Create a copy of this object and send a pointer to it. More... | |
FirstOrderDerivable * | clone () const =0 |
Create a copy of this object and send a pointer to it. More... | |
virtual double | df (const std::string &variable, const ParameterList ¶meters) |
Get the value of the first derivative of the function according to a given set of parameters. More... | |
SecondOrderDerivable * | clone () const =0 |
Create a copy of this object and send a pointer to it. More... | |
virtual double | d2f (const std::string &variable, const ParameterList ¶meters) |
Get the value of the second order derivative of the function according to a given set of parameters. More... | |
virtual double | d2f (const std::string &variable1, const std::string &variable2, const ParameterList ¶meters) |
Get the value of the cross derivative of the function according to a given set of parameters. More... | |
Protected Member Functions | |
ParameterList & | getParameters_ () override |
Get all parameters available. More... | |
Protected Attributes | |
std::shared_ptr< FunctionInterface > | function_ |
General class that wraps a function into another one. This class is meant to be derivated and just provides a general framework.
Definition at line 374 of file Functions.h.
|
inline |
Definition at line 379 of file Functions.h.
|
pure virtualinherited |
Create a copy of this object and send a pointer to it.
Implemented in bpp::TestFunction, bpp::InfinityDerivableSecondOrderWrapper, bpp::InfinityDerivableFirstOrderWrapper, bpp::InfinityFunctionWrapper, bpp::LinearMatrix< Scalar >, bpp::AssociationGraphImplObserver< N, E, GraphImpl >, bpp::AssociationGraphImplObserver< N, E, DAGraphImpl >, bpp::AssociationGraphImplObserver< N, E, TreeGraphImpl >, bpp::StdErr, bpp::FunctionStopCondition, bpp::ColMatrix< Scalar >, bpp::PlaceboTransformedParameter, bpp::StdOut, bpp::GlobalGraph, bpp::ParametersStopCondition, bpp::StlOutputStreamWrapper, bpp::ReparametrizationDerivableSecondOrderWrapper, bpp::IntervalTransformedParameter, bpp::MetaOptimizer, bpp::IntervalConstraint, bpp::BppUnsignedInteger, bpp::StlOutputStream, bpp::SecondOrderDerivable, bpp::LogsumHmmLikelihood, bpp::RescaledHmmLikelihood, bpp::ReparametrizationDerivableFirstOrderWrapper, bpp::BppInteger, bpp::RowMatrix< Scalar >, bpp::RowMatrix< double >, bpp::RowMatrix< Real >, bpp::Parameter, bpp::Simplex, bpp::LowMemoryRescaledHmmLikelihood, bpp::Table< T >, bpp::AbstractNumericalDerivative, bpp::BppDouble, bpp::RTransformedParameter, bpp::NullOutputStream, bpp::ParametrizableCollection< N >, bpp::FirstOrderDerivable, bpp::OptimizerInterface, bpp::AssociationTreeGraphImplObserver< N, E, TreeGraphImpl >, bpp::AssociationDAGraphImplObserver< N, E, DAGraphImpl >, bpp::ThreePointsNumericalDerivative, bpp::DirichletDiscreteDistribution, bpp::SimpleDiscreteDistribution, bpp::DownhillSimplexMethod, bpp::Number< T >, bpp::Number< double >, bpp::Number< int >, bpp::Number< unsigned int >, bpp::FivePointsNumericalDerivative, bpp::ReparametrizationFunctionWrapper, bpp::DataTable, bpp::PrincipalComponentAnalysis, bpp::DualityDiagram, bpp::TruncatedExponentialDiscreteDistribution, bpp::MetaOptimizerInfos, bpp::BrentOneDimension, bpp::NewtonBacktrackOneDimension, bpp::FunctionOperator< F >, bpp::AutoParameter, bpp::GammaDiscreteDistribution, bpp::MixtureOfDiscreteDistributions, bpp::AliasParameterListener, bpp::Range< T >, bpp::PowellMultiDimensions, bpp::InvariantMixedDiscreteDistribution, bpp::TwoPointsNumericalDerivative, bpp::ParameterListener, bpp::OutputStream, bpp::GoldenSectionSearch, bpp::DirectionFunction, bpp::Point2D< T >, bpp::BetaDiscreteDistribution, bpp::ExponentialDiscreteDistribution, bpp::ParameterList, bpp::CorrespondenceAnalysis, bpp::HmmLikelihood, bpp::GaussianDiscreteDistribution, bpp::BfgsMultiDimensions, bpp::NewtonBacktrackOneDimension::NBODStopCondition, bpp::FullHmmTransitionMatrix, bpp::BppNotANumber, bpp::UniformDiscreteDistribution, bpp::ContingencyTableTest, bpp::Font, bpp::ConstantDistribution, bpp::DiscreteDistributionInterface, bpp::MultipleDiscreteDistribution, bpp::DownhillSimplexMethod::DSMStopCondition, bpp::MathOperator, bpp::BrentOneDimension::BODStopCondition, bpp::ConjugateGradientMultiDimensions, bpp::OptimizationStopCondition, bpp::AutoCorrelationTransitionMatrix, bpp::ParameterEvent, bpp::ComputationTree, bpp::GoldenSectionSearch::GSSStopCondition, bpp::PowellMultiDimensions::PMDStopCondition, bpp::ConstraintInterface, bpp::HmmStateAlphabet, bpp::RGBColor, bpp::SimpleMultiDimensions, bpp::SimpleNewtonMultiDimensions, bpp::HmmEmissionProbabilities, bpp::BinaryOperator, bpp::BppVector< T >, bpp::TransformedParameter, bpp::BppString, bpp::ConstantOperator, bpp::NegativeOperator, bpp::HmmTransitionMatrix, bpp::BppNumberI, bpp::BppBoolean, and bpp::NewtonOneDimension.
Referenced by bpp::FirstOrderDerivable::~FirstOrderDerivable(), and bpp::SecondOrderDerivable::~SecondOrderDerivable().
|
pure virtualinherited |
Create a copy of this object and send a pointer to it.
Implements bpp::Clonable.
Implemented in bpp::ReparametrizationDerivableSecondOrderWrapper, bpp::SecondOrderDerivable, bpp::LogsumHmmLikelihood, bpp::RescaledHmmLikelihood, bpp::ReparametrizationDerivableFirstOrderWrapper, bpp::LowMemoryRescaledHmmLikelihood, bpp::AbstractNumericalDerivative, bpp::ThreePointsNumericalDerivative, bpp::FivePointsNumericalDerivative, bpp::TwoPointsNumericalDerivative, and bpp::HmmLikelihood.
|
pure virtualinherited |
Create a copy of this object and send a pointer to it.
Implements bpp::FirstOrderDerivable.
Implemented in bpp::ReparametrizationDerivableSecondOrderWrapper, bpp::LogsumHmmLikelihood, bpp::RescaledHmmLikelihood, bpp::LowMemoryRescaledHmmLikelihood, bpp::AbstractNumericalDerivative, bpp::ThreePointsNumericalDerivative, bpp::FivePointsNumericalDerivative, bpp::TwoPointsNumericalDerivative, and bpp::HmmLikelihood.
Referenced by bpp::AbstractNumericalDerivative::~AbstractNumericalDerivative().
|
inlinevirtualinherited |
Get the value of the second order derivative of the function according to a given set of parameters.
variable | The name of the variable in . |
parameters | The parameter set to pass to the function. |
Exception | If an error occured. |
Definition at line 193 of file Functions.h.
References bpp::FunctionInterface::setParameters().
|
inlinevirtualinherited |
Get the value of the cross derivative of the function according to a given set of parameters.
variable1 | The name of the variable in . |
variable2 | The name of the variable in . |
parameters | The parameter set to pass to the function. |
Exception | If an error occured. |
Definition at line 220 of file Functions.h.
References bpp::FunctionInterface::setParameters().
|
inlinevirtualinherited |
Get the value of the first derivative of the function according to a given set of parameters.
variable | The name of the variable in . |
parameters | The parameter set to pass to the function. |
Exception | If an error occured. |
Definition at line 138 of file Functions.h.
References bpp::FunctionInterface::setParameters().
|
inlinevirtualinherited |
Tell if derivatives must be computed.
yn | yes/no |
Implements bpp::FirstOrderDerivable.
Definition at line 353 of file Functions.h.
|
inlinevirtualinherited |
Tell if derivatives must be computed.
Implements bpp::FirstOrderDerivable.
Definition at line 358 of file Functions.h.
|
inlinevirtual |
Tell if derivatives must be computed.
yn | yes/no |
Implements bpp::SecondOrderDerivable.
Definition at line 383 of file Functions.h.
|
inlinevirtual |
Tell if derivatives must be computed.
Implements bpp::SecondOrderDerivable.
Definition at line 388 of file Functions.h.
|
inlineoverridevirtualinherited |
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 from bpp::FunctionInterface.
Reimplemented in bpp::InfinityFunctionWrapper, and bpp::AbstractNumericalDerivative.
Definition at line 272 of file Functions.h.
|
inlinevirtualinherited |
Get the derivative of the function at the current point.
variable | The name of the variable in . |
Exception | If no point is specified or if an error occured. |
Implements bpp::FirstOrderDerivable.
Definition at line 363 of file Functions.h.
|
inlineoverridevirtualinherited |
Implements bpp::Parametrizable.
Definition at line 322 of file Functions.h.
|
inlineoverridevirtualinherited |
Get the number of parameters.
Implements bpp::Parametrizable.
Definition at line 312 of file Functions.h.
|
inlineoverridevirtualinherited |
Resolves a parameter name according to the current namespace.
Implements bpp::Parametrizable.
Definition at line 327 of file Functions.h.
|
inlineoverridevirtualinherited |
Get all parameters available.
Implements bpp::Parametrizable.
Definition at line 257 of file Functions.h.
|
inlineoverrideprotectedvirtualinherited |
Get all parameters available.
Implements bpp::Parametrizable.
Definition at line 333 of file Functions.h.
|
inlineoverridevirtualinherited |
Get the value for parameter of name 'name'.
name | The name of the parameter. |
Implements bpp::Parametrizable.
Definition at line 277 of file Functions.h.
|
inlinevirtual |
Get the second order derivative of the function at the current point.
variable | The name of the variable in . |
Exception | If no point is specified or if an error occured. |
Implements bpp::SecondOrderDerivable.
Definition at line 393 of file Functions.h.
|
inlinevirtual |
Get the value of the cross derivative of the function according to a given set of parameters.
variable1 | The name of the variable in . |
variable2 | The name of the variable in . |
Exception | If an error occured. |
Implements bpp::SecondOrderDerivable.
Definition at line 398 of file Functions.h.
|
inlineoverridevirtualinherited |
Get the value of the function at the current point.
Exception | If no point is specified or if an error occured. |
Implements bpp::FunctionInterface.
Reimplemented in bpp::InfinityFunctionWrapper, bpp::ThreePointsNumericalDerivative, and bpp::TwoPointsNumericalDerivative.
Definition at line 267 of file Functions.h.
|
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 247 of file Functions.h.
|
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.
Reimplemented in bpp::InfinityFunctionWrapper, and bpp::AbstractNumericalDerivative.
Definition at line 297 of file Functions.h.
|
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 262 of file Functions.h.
|
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 302 of file Functions.h.
|
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.
Reimplemented in bpp::InfinityFunctionWrapper, and bpp::AbstractNumericalDerivative.
Definition at line 282 of file Functions.h.
|
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 307 of file Functions.h.
|
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 317 of file Functions.h.
|
inlineoverridevirtualinherited |
Set the point where the function must be computed.
parameters | The parameter set to pass to the function. |
Implements bpp::FunctionInterface.
Reimplemented in bpp::InfinityFunctionWrapper, and bpp::AbstractNumericalDerivative.
Definition at line 252 of file Functions.h.
|
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.
Reimplemented in bpp::InfinityFunctionWrapper, and bpp::AbstractNumericalDerivative.
Definition at line 292 of file Functions.h.
|
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.
Reimplemented in bpp::InfinityFunctionWrapper, and bpp::AbstractNumericalDerivative.
Definition at line 287 of file Functions.h.
|
protectedinherited |
Definition at line 235 of file Functions.h.
Referenced by bpp::FunctionWrapper::operator=().