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 | |
FunctionWrapper (std::shared_ptr< FunctionInterface > function) | |
FunctionWrapper (const FunctionWrapper &fw) | |
FunctionWrapper & | operator= (const FunctionWrapper &fw) |
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... | |
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 231 of file Functions.h.
|
inline |
Definition at line 238 of file Functions.h.
|
inline |
Definition at line 239 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().
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
Implements bpp::Parametrizable.
Definition at line 322 of file Functions.h.
|
inlineoverridevirtual |
Get the number of parameters.
Implements bpp::Parametrizable.
Definition at line 312 of file Functions.h.
|
inlineoverridevirtual |
Resolves a parameter name according to the current namespace.
Implements bpp::Parametrizable.
Definition at line 327 of file Functions.h.
|
inlineoverridevirtual |
Get all parameters available.
Implements bpp::Parametrizable.
Definition at line 257 of file Functions.h.
|
inlineoverrideprotectedvirtual |
Get all parameters available.
Implements bpp::Parametrizable.
Definition at line 333 of file Functions.h.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inline |
Definition at line 240 of file Functions.h.
References function_.
Referenced by bpp::AbstractNumericalDerivative::operator=().
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
inlineoverridevirtual |
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.
|
protected |
Definition at line 235 of file Functions.h.
Referenced by operator=().