|
bpp-core
2.1.0
|
Numerical derivative function wrapper, partial implementation. More...
#include <Bpp/Numeric/Function/AbstractNumericalDerivative.h>
Inheritance diagram for bpp::AbstractNumericalDerivative:
Collaboration diagram for bpp::AbstractNumericalDerivative:Public Member Functions | |
| AbstractNumericalDerivative (Function *function) | |
| AbstractNumericalDerivative (DerivableFirstOrder *function) | |
| AbstractNumericalDerivative (DerivableSecondOrder *function) | |
| AbstractNumericalDerivative (const AbstractNumericalDerivative &ad) | |
| AbstractNumericalDerivative & | operator= (const AbstractNumericalDerivative &ad) |
| virtual | ~AbstractNumericalDerivative () |
| AbstractNumericalDerivative * | clone () const =0 |
| Create a copy of this object and send a pointer to it. | |
| void | setInterval (double h) |
| Set the interval value used in numerical approximation. | |
| double | getInterval () const |
| void | setParametersToDerivate (const std::vector< std::string > &variables) |
| Set the list of parameters to derivate. | |
| void | enableSecondOrderCrossDerivatives (bool yn) |
| bool | enableSecondOrderCrossDerivatives () const |
| virtual double | d2f (const std::string &variable, const ParameterList ¶meters) throw (Exception) |
| Get the value of the second order derivative of the function according to a given set of parameters. | |
| virtual double | d2f (const std::string &variable1, const std::string &variable2, const ParameterList ¶meters) throw (Exception) |
| Get the value of the cross derivative of the function according to a given set of parameters. | |
| virtual double | df (const std::string &variable, const ParameterList ¶meters) throw (Exception) |
| Get the value of the first derivative of the function according to a given set of parameters. | |
| virtual double | getValue () const =0 throw (Exception) |
| Get the value of the function at the current point. | |
| virtual bool | hasParameter (const std::string &name) const =0 |
| Tell if there is a parameter with specified name. | |
| virtual const ParameterList & | getParameters () const =0 |
| Get all parameters available. | |
| virtual const Parameter & | getParameter (const std::string &name) const =0 throw (ParameterNotFoundException) |
| Get the parameter with specified name. | |
| virtual double | getParameterValue (const std::string &name) const =0 throw (ParameterNotFoundException) |
| Get the value for parameter of name 'name'. | |
| virtual size_t | getNumberOfParameters () const =0 |
| Get the number of parameters. | |
| virtual void | setNamespace (const std::string &prefix)=0 |
| Set the namespace for the parameter names. | |
| virtual std::string | getNamespace () const =0 |
| virtual std::string | getParameterNameWithoutNamespace (const std::string &name) const =0 |
| Resolves a parameter name according to the current namespace. | |
| bool | hasParameter (const std::string &name) const |
| Tell if there is a parameter with specified name. | |
| const ParameterList & | getParameters () const throw (Exception) |
| Get all parameters available. | |
| const Parameter & | getParameter (const std::string &name) const throw (ParameterNotFoundException) |
| Get the parameter with specified name. | |
| double | getValue () const throw (Exception) |
| Get the value of the function at the current point. | |
| double | getParameterValue (const std::string &name) const throw (ParameterNotFoundException) |
| Get the value for parameter of name 'name'. | |
| size_t | getNumberOfParameters () const |
| Get the number of parameters. | |
| void | setNamespace (const std::string &prefix) |
| Set the namespace for the parameter names. | |
| std::string | getNamespace () const |
| std::string | getParameterNameWithoutNamespace (const std::string &name) const |
| Resolves a parameter name according to the current namespace. | |
The DerivableFirstOrder interface | |
| void | enableFirstOrderDerivatives (bool yn) |
| Tell if derivatives must be computed. | |
| bool | enableFirstOrderDerivatives () const |
| Tell if derivatives must be computed. | |
| double | getFirstOrderDerivative (const std::string &variable) const throw (Exception) |
| Get the derivative of the function at the current point. | |
The DerivableSecondOrder interface | |
| void | enableSecondOrderDerivatives (bool yn) |
| Tell if derivatives must be computed. | |
| bool | enableSecondOrderDerivatives () const |
| Tell if derivatives must be computed. | |
| double | getSecondOrderDerivative (const std::string &variable) const throw (Exception) |
| Get the second order derivative of the function at the current point. | |
| double | getSecondOrderDerivative (const std::string &variable1, const std::string &variable2) const throw (Exception) |
| Get the value of the cross derivative of the function according to a given set of parameters. | |
The Parametrizable interface. | |
| double | f (const ParameterList ¶meters) throw (Exception) |
| Get the value of the function according to a given set of parameters. | |
| void | setParameters (const ParameterList ¶meters) throw (ParameterNotFoundException, ConstraintException) |
| Set the point where the function must be computed. | |
| void | setAllParametersValues (const ParameterList ¶meters) throw (ParameterNotFoundException, ConstraintException) |
| Set the parameters values to be equals to those of parameters. | |
| void | setParameterValue (const std::string &name, double value) throw (ParameterNotFoundException, ConstraintException) |
| Set the value of parameter with name name to be equal to value. | |
| void | setParametersValues (const ParameterList ¶meters) throw (ParameterNotFoundException, ConstraintException) |
| Update the parameters from parameters. | |
| bool | matchParametersValues (const ParameterList ¶meters) throw (ConstraintException) |
| Update the parameters from parameters. | |
Protected Member Functions | |
| virtual void | updateDerivatives (const ParameterList parameters)=0 |
| Compute derivatives. | |
Protected Attributes | |
| DerivableFirstOrder * | function1_ |
| DerivableSecondOrder * | function2_ |
| double | h_ |
| std::vector< std::string > | variables_ |
| std::map< std::string, size_t > | index_ |
| std::vector< double > | der1_ |
| std::vector< double > | der2_ |
| RowMatrix< double > | crossDer2_ |
| bool | computeD1_ |
| bool | computeD2_ |
| bool | computeCrossD2_ |
| Function * | function_ |
Numerical derivative function wrapper, partial implementation.
This class provides a wrapper for Function object, implementing the DerivableSecondOrder interface (Although no cross derivative is implemented for now). Derivations of this class can be used as full DerivableSecondOrder objects, with derivative functions.
Three kinds of constructors are provided: one with a Function object, another with a DerivableFirstOrder object, and one with a DerivableSecondOrder object. In the first case, all derivatives will be computed numerically. In the second case, first order derivative will be computed numerically only if no appropriate analytical derivative is available, second order derivative will always be computed numerically. In the last case, first and second order derivative will be computed numerically only if no appropriate analytical derivative is available.
Definition at line 66 of file AbstractNumericalDerivative.h.
| bpp::AbstractNumericalDerivative::AbstractNumericalDerivative | ( | Function * | function | ) | [inline] |
Definition at line 82 of file AbstractNumericalDerivative.h.
| bpp::AbstractNumericalDerivative::AbstractNumericalDerivative | ( | DerivableFirstOrder * | function | ) | [inline] |
Definition at line 87 of file AbstractNumericalDerivative.h.
| bpp::AbstractNumericalDerivative::AbstractNumericalDerivative | ( | DerivableSecondOrder * | function | ) | [inline] |
Definition at line 92 of file AbstractNumericalDerivative.h.
| bpp::AbstractNumericalDerivative::AbstractNumericalDerivative | ( | const AbstractNumericalDerivative & | ad | ) | [inline] |
Definition at line 97 of file AbstractNumericalDerivative.h.
| virtual bpp::AbstractNumericalDerivative::~AbstractNumericalDerivative | ( | ) | [inline, virtual] |
Definition at line 119 of file AbstractNumericalDerivative.h.
| AbstractNumericalDerivative* bpp::AbstractNumericalDerivative::clone | ( | ) | const [pure virtual] |
Create a copy of this object and send a pointer to it.
Implements bpp::DerivableSecondOrder.
Implemented in bpp::FivePointsNumericalDerivative, bpp::ThreePointsNumericalDerivative, and bpp::TwoPointsNumericalDerivative.
| virtual double bpp::DerivableSecondOrder::d2f | ( | const std::string & | variable, |
| const ParameterList & | parameters | ||
| ) | throw (Exception) [inline, virtual, inherited] |
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 236 of file Functions.h.
References bpp::DerivableSecondOrder::getSecondOrderDerivative(), and bpp::Function::setParameters().
| virtual double bpp::DerivableSecondOrder::d2f | ( | const std::string & | variable1, |
| const std::string & | variable2, | ||
| const ParameterList & | parameters | ||
| ) | throw (Exception) [inline, virtual, inherited] |
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 263 of file Functions.h.
References bpp::DerivableSecondOrder::getSecondOrderDerivative(), and bpp::Function::setParameters().
| virtual double bpp::DerivableFirstOrder::df | ( | const std::string & | variable, |
| const ParameterList & | parameters | ||
| ) | throw (Exception) [inline, virtual, inherited] |
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 176 of file Functions.h.
References bpp::DerivableFirstOrder::getFirstOrderDerivative(), and bpp::Function::setParameters().
| void bpp::AbstractNumericalDerivative::enableFirstOrderDerivatives | ( | bool | yn | ) | [inline, virtual] |
Tell if derivatives must be computed.
| yn | yes/no |
Implements bpp::DerivableFirstOrder.
Definition at line 159 of file AbstractNumericalDerivative.h.
References computeD1_.
| bool bpp::AbstractNumericalDerivative::enableFirstOrderDerivatives | ( | ) | const [inline, virtual] |
Tell if derivatives must be computed.
Implements bpp::DerivableFirstOrder.
Definition at line 160 of file AbstractNumericalDerivative.h.
References computeD1_.
| void bpp::AbstractNumericalDerivative::enableSecondOrderCrossDerivatives | ( | bool | yn | ) | [inline] |
Definition at line 268 of file AbstractNumericalDerivative.h.
References computeCrossD2_.
| bool bpp::AbstractNumericalDerivative::enableSecondOrderCrossDerivatives | ( | ) | const [inline] |
Definition at line 269 of file AbstractNumericalDerivative.h.
References computeCrossD2_.
| void bpp::AbstractNumericalDerivative::enableSecondOrderDerivatives | ( | bool | yn | ) | [inline, virtual] |
Tell if derivatives must be computed.
| yn | yes/no |
Implements bpp::DerivableSecondOrder.
Definition at line 185 of file AbstractNumericalDerivative.h.
References computeD2_.
| bool bpp::AbstractNumericalDerivative::enableSecondOrderDerivatives | ( | ) | const [inline, virtual] |
Tell if derivatives must be computed.
Implements bpp::DerivableSecondOrder.
Definition at line 186 of file AbstractNumericalDerivative.h.
References computeD2_.
| double bpp::AbstractNumericalDerivative::f | ( | const ParameterList & | parameters | ) | throw (Exception) [inline, virtual] |
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::FunctionWrapper.
Definition at line 227 of file AbstractNumericalDerivative.h.
References bpp::FunctionWrapper::getValue(), and setParameters().
| double bpp::AbstractNumericalDerivative::getFirstOrderDerivative | ( | const std::string & | variable | ) | const throw (Exception) [inline, virtual] |
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::DerivableFirstOrder.
Definition at line 162 of file AbstractNumericalDerivative.h.
References computeD1_, der1_, function1_, bpp::DerivableFirstOrder::getFirstOrderDerivative(), and index_.
| double bpp::AbstractNumericalDerivative::getInterval | ( | ) | const [inline] |
Definition at line 136 of file AbstractNumericalDerivative.h.
References h_.
| virtual std::string bpp::Parametrizable::getNamespace | ( | ) | const [pure virtual, inherited] |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::FunctionWrapper::getNamespace().
| std::string bpp::FunctionWrapper::getNamespace | ( | ) | const [inline, virtual, inherited] |
Implements bpp::Parametrizable.
Definition at line 360 of file Functions.h.
References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getNamespace().
| virtual size_t bpp::Parametrizable::getNumberOfParameters | ( | ) | const [pure virtual, inherited] |
Get the number of parameters.
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, bpp::AbstractParametrizable, and bpp::DirectionFunction.
Referenced by bpp::FunctionWrapper::getNumberOfParameters(), and bpp::BppODiscreteDistributionFormat::write().
| size_t bpp::FunctionWrapper::getNumberOfParameters | ( | ) | const [inline, virtual, inherited] |
Get the number of parameters.
Implements bpp::Parametrizable.
Definition at line 350 of file Functions.h.
References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getNumberOfParameters().
| virtual const Parameter& bpp::Parametrizable::getParameter | ( | const std::string & | name | ) | const throw (ParameterNotFoundException) [pure virtual, inherited] |
Get the parameter with specified name.
| name | The name of the parameter to look for. |
| ParameterNotFoundException | if no parameter with this name is found. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::FunctionWrapper::getParameter().
| const Parameter& bpp::FunctionWrapper::getParameter | ( | const std::string & | name | ) | const throw (ParameterNotFoundException) [inline, virtual, inherited] |
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 306 of file Functions.h.
References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getParameter().
| virtual std::string bpp::Parametrizable::getParameterNameWithoutNamespace | ( | const std::string & | name | ) | const [pure virtual, inherited] |
Resolves a parameter name according to the current namespace.
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::FunctionWrapper::getParameterNameWithoutNamespace(), bpp::BppODiscreteDistributionFormat::read(), and bpp::BppOParametrizableFormat::write().
| std::string bpp::FunctionWrapper::getParameterNameWithoutNamespace | ( | const std::string & | name | ) | const [inline, virtual, inherited] |
Resolves a parameter name according to the current namespace.
Implements bpp::Parametrizable.
Definition at line 365 of file Functions.h.
References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getParameterNameWithoutNamespace().
| virtual const ParameterList& bpp::Parametrizable::getParameters | ( | ) | const [pure virtual, inherited] |
Get all parameters available.
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, bpp::DirectionFunction, and bpp::AbstractParametrizable.
Referenced by bpp::NewtonOneDimension::doStep(), bpp::FunctionWrapper::getParameters(), bpp::BppODiscreteDistributionFormat::read(), setParameterValue(), bpp::AbstractOptimizer::step(), and bpp::BppOParametrizableFormat::write().
| const ParameterList& bpp::FunctionWrapper::getParameters | ( | ) | const throw (Exception) [inline, virtual, inherited] |
Get all parameters available.
Implements bpp::Parametrizable.
Definition at line 301 of file Functions.h.
References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getParameters().
| virtual double bpp::Parametrizable::getParameterValue | ( | const std::string & | name | ) | const throw (ParameterNotFoundException) [pure virtual, inherited] |
Get the value for parameter of name 'name'.
| name | The name of the parameter. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::FunctionWrapper::getParameterValue(), and bpp::BppODiscreteDistributionFormat::read().
| double bpp::FunctionWrapper::getParameterValue | ( | const std::string & | name | ) | const throw (ParameterNotFoundException) [inline, virtual, inherited] |
Get the value for parameter of name 'name'.
| name | The name of the parameter. |
Implements bpp::Parametrizable.
Definition at line 321 of file Functions.h.
References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getParameterValue().
| double bpp::AbstractNumericalDerivative::getSecondOrderDerivative | ( | const std::string & | variable | ) | const throw (Exception) [inline, virtual] |
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::DerivableSecondOrder.
Reimplemented in bpp::TwoPointsNumericalDerivative.
Definition at line 188 of file AbstractNumericalDerivative.h.
References computeD2_, der2_, function2_, bpp::DerivableSecondOrder::getSecondOrderDerivative(), and index_.
| double bpp::AbstractNumericalDerivative::getSecondOrderDerivative | ( | const std::string & | variable1, |
| const std::string & | variable2 | ||
| ) | const throw (Exception) [inline, virtual] |
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::DerivableSecondOrder.
Reimplemented in bpp::FivePointsNumericalDerivative, and bpp::TwoPointsNumericalDerivative.
Definition at line 204 of file AbstractNumericalDerivative.h.
References computeCrossD2_, crossDer2_, function2_, bpp::DerivableSecondOrder::getSecondOrderDerivative(), and index_.
| virtual double bpp::Function::getValue | ( | ) | const throw (Exception) [pure virtual, inherited] |
Get the value of the function at the current point.
| Exception | If no point is specified or if an error occured. |
Implemented in bpp::TestFunction, bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::LowMemoryRescaledHmmLikelihood, bpp::LogsumHmmLikelihood, bpp::RescaledHmmLikelihood, bpp::ReparametrizationFunctionWrapper, bpp::FivePointsNumericalDerivative, bpp::ThreePointsNumericalDerivative, bpp::DirectionFunction, and bpp::TwoPointsNumericalDerivative.
Referenced by bpp::SimpleNewtonMultiDimensions::doStep(), bpp::SimpleMultiDimensions::doStep(), bpp::MetaOptimizer::doStep(), bpp::Function::f(), bpp::ReparametrizationFunctionWrapper::getValue(), bpp::FunctionWrapper::getValue(), and bpp::InfinityFunctionWrapper::getValue().
| double bpp::FunctionWrapper::getValue | ( | ) | const throw (Exception) [inline, virtual, inherited] |
Get the value of the function at the current point.
| Exception | If no point is specified or if an error occured. |
Implements bpp::Function.
Reimplemented in bpp::InfinityFunctionWrapper, bpp::FivePointsNumericalDerivative, bpp::ThreePointsNumericalDerivative, and bpp::TwoPointsNumericalDerivative.
Definition at line 311 of file Functions.h.
References bpp::FunctionWrapper::function_, and bpp::Function::getValue().
Referenced by f().
| virtual bool bpp::Parametrizable::hasParameter | ( | const std::string & | name | ) | const [pure virtual, inherited] |
Tell if there is a parameter with specified name.
| name | The name of the parameter to look for. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::FunctionWrapper::hasParameter().
| bool bpp::FunctionWrapper::hasParameter | ( | const std::string & | name | ) | const [inline, virtual, inherited] |
Tell if there is a parameter with specified name.
| name | The name of the parameter to look for. |
Implements bpp::Parametrizable.
Definition at line 290 of file Functions.h.
References bpp::FunctionWrapper::function_, and bpp::Parametrizable::hasParameter().
| bool bpp::AbstractNumericalDerivative::matchParametersValues | ( | const ParameterList & | parameters | ) | throw (ConstraintException) [inline, virtual] |
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. |
Reimplemented from bpp::FunctionWrapper.
Definition at line 259 of file AbstractNumericalDerivative.h.
References bpp::FunctionWrapper::function_, bpp::Parametrizable::matchParametersValues(), and updateDerivatives().
| AbstractNumericalDerivative& bpp::AbstractNumericalDerivative::operator= | ( | const AbstractNumericalDerivative & | ad | ) | [inline] |
Definition at line 102 of file AbstractNumericalDerivative.h.
References computeCrossD2_, computeD1_, computeD2_, crossDer2_, der1_, der2_, function1_, function2_, h_, index_, and variables_.
| void bpp::AbstractNumericalDerivative::setAllParametersValues | ( | const ParameterList & | parameters | ) | throw (ParameterNotFoundException, ConstraintException) [inline, virtual] |
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. |
Reimplemented from bpp::FunctionWrapper.
Definition at line 238 of file AbstractNumericalDerivative.h.
References bpp::FunctionWrapper::function_, bpp::Parametrizable::setAllParametersValues(), and updateDerivatives().
| void bpp::AbstractNumericalDerivative::setInterval | ( | double | h | ) | [inline] |
Set the interval value used in numerical approximation.
Default value is 0.0001.
| h | Interval value. |
Definition at line 131 of file AbstractNumericalDerivative.h.
References h_.
| virtual void bpp::Parametrizable::setNamespace | ( | const std::string & | prefix | ) | [pure virtual, inherited] |
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. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, bpp::AbstractParameterAliasable, bpp::MixtureOfDiscreteDistributions, bpp::AbstractParametrizable, and bpp::InvariantMixedDiscreteDistribution.
Referenced by bpp::InvariantMixedDiscreteDistribution::InvariantMixedDiscreteDistribution(), bpp::InvariantMixedDiscreteDistribution::setNamespace(), and bpp::FunctionWrapper::setNamespace().
| void bpp::FunctionWrapper::setNamespace | ( | const std::string & | prefix | ) | [inline, virtual, inherited] |
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 355 of file Functions.h.
References bpp::FunctionWrapper::function_, and bpp::Parametrizable::setNamespace().
| void bpp::AbstractNumericalDerivative::setParameters | ( | const ParameterList & | parameters | ) | throw (ParameterNotFoundException, ConstraintException) [inline, virtual] |
Set the point where the function must be computed.
| parameters | The parameter set to pass to the function. |
Reimplemented from bpp::FunctionWrapper.
Definition at line 232 of file AbstractNumericalDerivative.h.
References bpp::FunctionWrapper::function_, bpp::Function::setParameters(), and updateDerivatives().
Referenced by f().
| void bpp::AbstractNumericalDerivative::setParametersToDerivate | ( | const std::vector< std::string > & | variables | ) | [inline] |
Set the list of parameters to derivate.
| variables | A list of all parameter names. |
Definition at line 143 of file AbstractNumericalDerivative.h.
References crossDer2_, der1_, der2_, index_, bpp::RowMatrix< Scalar >::resize(), and variables_.
| void bpp::AbstractNumericalDerivative::setParametersValues | ( | const ParameterList & | parameters | ) | throw (ParameterNotFoundException, ConstraintException) [inline, virtual] |
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. |
Reimplemented from bpp::FunctionWrapper.
Definition at line 252 of file AbstractNumericalDerivative.h.
References bpp::FunctionWrapper::function_, bpp::Parametrizable::setParametersValues(), and updateDerivatives().
| void bpp::AbstractNumericalDerivative::setParameterValue | ( | const std::string & | name, |
| double | value | ||
| ) | throw (ParameterNotFoundException, ConstraintException) [inline, virtual] |
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. |
Reimplemented from bpp::FunctionWrapper.
Definition at line 245 of file AbstractNumericalDerivative.h.
References bpp::FunctionWrapper::function_, bpp::Parametrizable::getParameters(), bpp::Parametrizable::setParameterValue(), bpp::ParameterList::subList(), and updateDerivatives().
| virtual void bpp::AbstractNumericalDerivative::updateDerivatives | ( | const ParameterList | parameters | ) | [protected, pure virtual] |
Compute derivatives.
| parameters | The point where to compute derivatives. It is NOT passed as references, as the inner parameters of the function will be changed when computing the numerical derivatives. |
Implemented in bpp::FivePointsNumericalDerivative, bpp::TwoPointsNumericalDerivative, and bpp::ThreePointsNumericalDerivative.
Referenced by matchParametersValues(), setAllParametersValues(), setParameters(), setParametersValues(), and setParameterValue().
bool bpp::AbstractNumericalDerivative::computeCrossD2_ [protected] |
Definition at line 79 of file AbstractNumericalDerivative.h.
Referenced by enableSecondOrderCrossDerivatives(), getSecondOrderDerivative(), and operator=().
bool bpp::AbstractNumericalDerivative::computeD1_ [protected] |
Definition at line 79 of file AbstractNumericalDerivative.h.
Referenced by enableFirstOrderDerivatives(), getFirstOrderDerivative(), and operator=().
bool bpp::AbstractNumericalDerivative::computeD2_ [protected] |
Definition at line 79 of file AbstractNumericalDerivative.h.
Referenced by enableSecondOrderDerivatives(), getSecondOrderDerivative(), and operator=().
RowMatrix<double> bpp::AbstractNumericalDerivative::crossDer2_ [protected] |
Definition at line 78 of file AbstractNumericalDerivative.h.
Referenced by getSecondOrderDerivative(), operator=(), and setParametersToDerivate().
std::vector<double> bpp::AbstractNumericalDerivative::der1_ [protected] |
Definition at line 76 of file AbstractNumericalDerivative.h.
Referenced by getFirstOrderDerivative(), operator=(), and setParametersToDerivate().
std::vector<double> bpp::AbstractNumericalDerivative::der2_ [protected] |
Definition at line 77 of file AbstractNumericalDerivative.h.
Referenced by getSecondOrderDerivative(), operator=(), and setParametersToDerivate().
Definition at line 71 of file AbstractNumericalDerivative.h.
Referenced by getFirstOrderDerivative(), and operator=().
Definition at line 72 of file AbstractNumericalDerivative.h.
Referenced by getSecondOrderDerivative(), and operator=().
Function* bpp::FunctionWrapper::function_ [protected, inherited] |
Definition at line 278 of file Functions.h.
Referenced by bpp::DerivableFirstOrderWrapper::enableFirstOrderDerivatives(), bpp::DerivableSecondOrderWrapper::enableSecondOrderDerivatives(), bpp::FunctionWrapper::f(), bpp::DerivableFirstOrderWrapper::getFirstOrderDerivative(), bpp::InfinityDerivableFirstOrderWrapper::getFirstOrderDerivative(), bpp::FunctionWrapper::getNamespace(), bpp::FunctionWrapper::getNumberOfParameters(), bpp::FunctionWrapper::getParameter(), bpp::FunctionWrapper::getParameterNameWithoutNamespace(), bpp::FunctionWrapper::getParameters(), bpp::FunctionWrapper::getParameterValue(), bpp::DerivableSecondOrderWrapper::getSecondOrderDerivative(), bpp::InfinityDerivableSecondOrderWrapper::getSecondOrderDerivative(), bpp::FunctionWrapper::getValue(), bpp::InfinityFunctionWrapper::getValue(), bpp::FunctionWrapper::hasParameter(), matchParametersValues(), bpp::FunctionWrapper::matchParametersValues(), bpp::InfinityFunctionWrapper::matchParametersValues(), bpp::FunctionWrapper::operator=(), setAllParametersValues(), bpp::FunctionWrapper::setAllParametersValues(), bpp::InfinityFunctionWrapper::setAllParametersValues(), bpp::FunctionWrapper::setNamespace(), setParameters(), bpp::FunctionWrapper::setParameters(), bpp::InfinityFunctionWrapper::setParameters(), setParametersValues(), bpp::FunctionWrapper::setParametersValues(), bpp::InfinityFunctionWrapper::setParametersValues(), setParameterValue(), bpp::FunctionWrapper::setParameterValue(), and bpp::InfinityFunctionWrapper::setParameterValue().
double bpp::AbstractNumericalDerivative::h_ [protected] |
Definition at line 73 of file AbstractNumericalDerivative.h.
Referenced by getInterval(), operator=(), and setInterval().
std::map<std::string, size_t> bpp::AbstractNumericalDerivative::index_ [mutable, protected] |
Definition at line 75 of file AbstractNumericalDerivative.h.
Referenced by getFirstOrderDerivative(), getSecondOrderDerivative(), operator=(), and setParametersToDerivate().
std::vector<std::string> bpp::AbstractNumericalDerivative::variables_ [protected] |
Definition at line 74 of file AbstractNumericalDerivative.h.
Referenced by operator=(), and setParametersToDerivate().