bpp-core3
3.0.0
|
Wrapper class for optimization under constraints. More...
#include <Bpp/Numeric/Function/Functions.h>
Public Member Functions | |
InfinityDerivableFirstOrderWrapper (DerivableFirstOrder *function) | |
virtual | ~InfinityDerivableFirstOrderWrapper () |
InfinityDerivableFirstOrderWrapper * | clone () const |
Create a copy of this object and send a pointer to it. More... | |
double | getFirstOrderDerivative (const std::string &variable) const |
double | df (const std::string &variable, const ParameterList ¶meters) |
void | setParameters (const ParameterList ¶meters) |
Set the point where the function must be computed. More... | |
double | getValue () const |
Get the value of the function at the current point. More... | |
double | f (const ParameterList ¶meters) |
Get the value of the function according to a given set of parameters. More... | |
void | setAllParametersValues (const ParameterList ¶meters) |
Set the parameters values to be equals to those of parameters. More... | |
void | setParameterValue (const std::string &name, double value) |
Set the value of parameter with name name to be equal to value. More... | |
void | setParametersValues (const ParameterList ¶meters) |
Update the parameters from parameters. More... | |
bool | matchParametersValues (const ParameterList ¶meters) |
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 |
Get all parameters available. More... | |
const Parameter & | getParameter (const std::string &name) const |
Get the parameter with specified name. More... | |
double | getParameterValue (const std::string &name) const |
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 Member Functions | |
ParameterList & | getParameters_ () |
Get all parameters available. More... | |
Protected Attributes | |
bool | constraintMatch_ |
Function * | function_ |
Wrapper class for optimization under constraints.
Catch any ConstraintException thrown and send +inf.
Definition at line 532 of file Functions.h.
|
inline |
Definition at line 536 of file Functions.h.
Referenced by clone().
|
inlinevirtual |
Definition at line 537 of file Functions.h.
|
inlinevirtual |
Create a copy of this object and send a pointer to it.
Reimplemented from bpp::InfinityFunctionWrapper.
Reimplemented in bpp::InfinityDerivableSecondOrderWrapper.
Definition at line 539 of file Functions.h.
References InfinityDerivableFirstOrderWrapper().
|
inline |
Definition at line 547 of file Functions.h.
References 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 466 of file Functions.h.
References bpp::InfinityFunctionWrapper::getValue(), and bpp::InfinityFunctionWrapper::setParameters().
|
inline |
Definition at line 542 of file Functions.h.
References bpp::InfinityFunctionWrapper::constraintMatch_, and bpp::FunctionWrapper::function_.
Referenced by df().
|
inlinevirtualinherited |
Implements bpp::Parametrizable.
Definition at line 347 of file Functions.h.
References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getNamespace().
|
inlinevirtualinherited |
Get the number of parameters.
Implements bpp::Parametrizable.
Definition at line 337 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 297 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 352 of file Functions.h.
References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getParameterNameWithoutNamespace().
|
inlinevirtualinherited |
Get all parameters available.
Implements bpp::Parametrizable.
Definition at line 292 of file Functions.h.
References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getParameters().
|
inlineprotectedvirtualinherited |
Get all parameters available.
Implements bpp::Parametrizable.
Definition at line 358 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 312 of file Functions.h.
References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getParameterValue().
|
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 461 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 282 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 511 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 472 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 342 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 448 of file Functions.h.
References bpp::InfinityFunctionWrapper::constraintMatch_, bpp::FunctionWrapper::function_, and bpp::Function::setParameters().
Referenced by bpp::InfinityDerivableSecondOrderWrapper::d2f(), 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 498 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 485 of file Functions.h.
References bpp::InfinityFunctionWrapper::constraintMatch_, bpp::FunctionWrapper::function_, and bpp::Parametrizable::setParameterValue().
|
mutableprotectedinherited |
Definition at line 437 of file Functions.h.
Referenced by getFirstOrderDerivative(), bpp::InfinityDerivableSecondOrderWrapper::getSecondOrderDerivative(), bpp::InfinityFunctionWrapper::getValue(), bpp::InfinityFunctionWrapper::matchParametersValues(), bpp::InfinityFunctionWrapper::setAllParametersValues(), bpp::InfinityFunctionWrapper::setParameters(), bpp::InfinityFunctionWrapper::setParametersValues(), and bpp::InfinityFunctionWrapper::setParameterValue().
|
protectedinherited |
Definition at line 270 of file Functions.h.
Referenced by bpp::DerivableFirstOrderWrapper::enableFirstOrderDerivatives(), bpp::DerivableSecondOrderWrapper::enableSecondOrderDerivatives(), bpp::FunctionWrapper::f(), bpp::DerivableFirstOrderWrapper::getFirstOrderDerivative(), getFirstOrderDerivative(), bpp::FunctionWrapper::getNamespace(), bpp::FunctionWrapper::getNumberOfParameters(), bpp::FunctionWrapper::getParameter(), bpp::FunctionWrapper::getParameterNameWithoutNamespace(), bpp::FunctionWrapper::getParameters(), bpp::FunctionWrapper::getParameters_(), bpp::FunctionWrapper::getParameterValue(), bpp::DerivableSecondOrderWrapper::getSecondOrderDerivative(), bpp::InfinityDerivableSecondOrderWrapper::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().