bpp-core
2.2.0
|
Wrapper class for optimization under constraints. More...
#include <Bpp/Numeric/Function/Functions.h>
Public Member Functions | |
InfinityDerivableSecondOrderWrapper (DerivableFirstOrder *function) | |
virtual | ~InfinityDerivableSecondOrderWrapper () |
InfinityDerivableSecondOrderWrapper * | clone () const |
Create a copy of this object and send a pointer to it. More... | |
double | getSecondOrderDerivative (const std::string &variable) const throw (Exception) |
double | d2f (const std::string &variable, const ParameterList ¶meters) throw (Exception) |
double | getSecondOrderDerivative (const std::string &variable1, const std::string &variable2) const throw (Exception) |
double | d2f (const std::string &variable1, const std::string &variable2, const ParameterList ¶meters) throw (Exception) |
double | getFirstOrderDerivative (const std::string &variable) const throw (Exception) |
double | df (const std::string &variable, const ParameterList ¶meters) throw (Exception) |
void | setParameters (const ParameterList ¶meters) throw (ParameterNotFoundException, ConstraintException) |
Set the point where the function must be computed. More... | |
double | getValue () const throw (Exception) |
Get the value of the function at the current point. More... | |
double | f (const ParameterList ¶meters) throw (Exception) |
Get the value of the function according to a given set of parameters. More... | |
void | setAllParametersValues (const ParameterList ¶meters) throw (ParameterNotFoundException, ConstraintException) |
Set the parameters values to be equals to those of parameters. More... | |
void | setParameterValue (const std::string &name, double value) throw (ParameterNotFoundException, ConstraintException) |
Set the value of parameter with name name to be equal to value. More... | |
void | setParametersValues (const ParameterList ¶meters) throw (ParameterNotFoundException, ConstraintException) |
Update the parameters from parameters. More... | |
bool | matchParametersValues (const ParameterList ¶meters) throw (ConstraintException) |
Update the parameters from parameters. More... | |
bool | hasParameter (const std::string &name) const |
Tell if there is a parameter with specified name. More... | |
const ParameterList & | getParameters () const throw (Exception) |
Get all parameters available. More... | |
const Parameter & | getParameter (const std::string &name) const throw (ParameterNotFoundException) |
Get the parameter with specified name. More... | |
double | getParameterValue (const std::string &name) const throw (ParameterNotFoundException) |
Get the value for parameter of name 'name'. More... | |
size_t | getNumberOfParameters () const |
Get the number of parameters. More... | |
void | setNamespace (const std::string &prefix) |
Set the namespace for the parameter names. More... | |
std::string | getNamespace () const |
std::string | getParameterNameWithoutNamespace (const std::string &name) const |
Resolves a parameter name according to the current namespace. More... | |
Protected Attributes | |
bool | constraintMatch_ |
Function * | function_ |
Wrapper class for optimization under constraints.
Catch any ConstraintException thrown and send +inf.
Definition at line 581 of file Functions.h.
|
inline |
Definition at line 585 of file Functions.h.
Referenced by clone().
|
inlinevirtual |
Definition at line 588 of file Functions.h.
|
inlinevirtual |
Create a copy of this object and send a pointer to it.
Reimplemented from bpp::InfinityDerivableFirstOrderWrapper.
Definition at line 593 of file Functions.h.
References InfinityDerivableSecondOrderWrapper().
|
inline |
Definition at line 603 of file Functions.h.
References getSecondOrderDerivative(), and bpp::InfinityFunctionWrapper::setParameters().
|
inline |
Definition at line 614 of file Functions.h.
References getSecondOrderDerivative(), and bpp::InfinityFunctionWrapper::setParameters().
|
inlineinherited |
Definition at line 569 of file Functions.h.
References bpp::InfinityDerivableFirstOrderWrapper::getFirstOrderDerivative(), and bpp::InfinityFunctionWrapper::setParameters().
|
inlinevirtualinherited |
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 478 of file Functions.h.
References bpp::InfinityFunctionWrapper::getValue(), and bpp::InfinityFunctionWrapper::setParameters().
|
inlineinherited |
Definition at line 564 of file Functions.h.
References bpp::InfinityFunctionWrapper::constraintMatch_, and bpp::FunctionWrapper::function_.
Referenced by bpp::InfinityDerivableFirstOrderWrapper::df().
|
inlinevirtualinherited |
Implements bpp::Parametrizable.
Definition at line 360 of file Functions.h.
References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getNamespace().
|
inlinevirtualinherited |
Get the number of parameters.
Implements bpp::Parametrizable.
Definition at line 350 of file Functions.h.
References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getNumberOfParameters().
|
inlinevirtualinherited |
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().
|
inlinevirtualinherited |
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().
|
inlinevirtualinherited |
Get all parameters available.
Implements bpp::Parametrizable.
Definition at line 301 of file Functions.h.
References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getParameters().
|
inlinevirtualinherited |
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().
|
inline |
Definition at line 598 of file Functions.h.
References bpp::InfinityFunctionWrapper::constraintMatch_, and bpp::FunctionWrapper::function_.
Referenced by d2f(), and getSecondOrderDerivative().
|
inline |
Definition at line 609 of file Functions.h.
References bpp::InfinityFunctionWrapper::constraintMatch_, bpp::FunctionWrapper::function_, and getSecondOrderDerivative().
|
inlinevirtualinherited |
Get the value of the function at the current point.
Exception | If no point is specified or if an error occured. |
Reimplemented from bpp::FunctionWrapper.
Definition at line 473 of file Functions.h.
References bpp::InfinityFunctionWrapper::constraintMatch_, bpp::FunctionWrapper::function_, and bpp::Function::getValue().
Referenced by bpp::InfinityFunctionWrapper::f().
|
inlinevirtualinherited |
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().
|
inlinevirtualinherited |
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 526 of file Functions.h.
References bpp::InfinityFunctionWrapper::constraintMatch_, bpp::FunctionWrapper::function_, and bpp::Parametrizable::matchParametersValues().
|
inlinevirtualinherited |
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 484 of file Functions.h.
References bpp::InfinityFunctionWrapper::constraintMatch_, bpp::FunctionWrapper::function_, and bpp::Parametrizable::setAllParametersValues().
|
inlinevirtualinherited |
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().
|
inlinevirtualinherited |
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 459 of file Functions.h.
References bpp::InfinityFunctionWrapper::constraintMatch_, bpp::FunctionWrapper::function_, and bpp::Function::setParameters().
Referenced by d2f(), bpp::InfinityDerivableFirstOrderWrapper::df(), and bpp::InfinityFunctionWrapper::f().
|
inlinevirtualinherited |
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 512 of file Functions.h.
References bpp::InfinityFunctionWrapper::constraintMatch_, bpp::FunctionWrapper::function_, and bpp::Parametrizable::setParametersValues().
|
inlinevirtualinherited |
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 498 of file Functions.h.
References bpp::InfinityFunctionWrapper::constraintMatch_, bpp::FunctionWrapper::function_, and bpp::Parametrizable::setParameterValue().
|
mutableprotectedinherited |
Definition at line 443 of file Functions.h.
Referenced by bpp::InfinityDerivableFirstOrderWrapper::getFirstOrderDerivative(), getSecondOrderDerivative(), bpp::InfinityFunctionWrapper::getValue(), bpp::InfinityFunctionWrapper::matchParametersValues(), bpp::InfinityFunctionWrapper::setAllParametersValues(), bpp::InfinityFunctionWrapper::setParameters(), bpp::InfinityFunctionWrapper::setParametersValues(), and bpp::InfinityFunctionWrapper::setParameterValue().
|
protectedinherited |
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(), getSecondOrderDerivative(), bpp::FunctionWrapper::getValue(), bpp::InfinityFunctionWrapper::getValue(), bpp::FunctionWrapper::hasParameter(), bpp::AbstractNumericalDerivative::matchParametersValues(), bpp::FunctionWrapper::matchParametersValues(), bpp::InfinityFunctionWrapper::matchParametersValues(), bpp::FunctionWrapper::operator=(), bpp::AbstractNumericalDerivative::setAllParametersValues(), bpp::FunctionWrapper::setAllParametersValues(), bpp::InfinityFunctionWrapper::setAllParametersValues(), bpp::FunctionWrapper::setNamespace(), bpp::AbstractNumericalDerivative::setParameters(), bpp::FunctionWrapper::setParameters(), bpp::InfinityFunctionWrapper::setParameters(), bpp::AbstractNumericalDerivative::setParametersValues(), bpp::FunctionWrapper::setParametersValues(), bpp::InfinityFunctionWrapper::setParametersValues(), bpp::AbstractNumericalDerivative::setParameterValue(), bpp::FunctionWrapper::setParameterValue(), and bpp::InfinityFunctionWrapper::setParameterValue().