bpp-core3  3.0.0
bpp::InfinityDerivableSecondOrderWrapper Class Reference

Wrapper class for optimization under constraints. More...

#include <Bpp/Numeric/Function/Functions.h>

+ Inheritance diagram for bpp::InfinityDerivableSecondOrderWrapper:
+ Collaboration diagram for bpp::InfinityDerivableSecondOrderWrapper:

Public Member Functions

 InfinityDerivableSecondOrderWrapper (DerivableFirstOrder *function)
 
virtual ~InfinityDerivableSecondOrderWrapper ()
 
InfinityDerivableSecondOrderWrapperclone () const
 Create a copy of this object and send a pointer to it. More...
 
double getSecondOrderDerivative (const std::string &variable) const
 
double d2f (const std::string &variable, const ParameterList &parameters)
 
double getSecondOrderDerivative (const std::string &variable1, const std::string &variable2) const
 
double d2f (const std::string &variable1, const std::string &variable2, const ParameterList &parameters)
 
double getFirstOrderDerivative (const std::string &variable) const
 
double df (const std::string &variable, const ParameterList &parameters)
 
void setParameters (const ParameterList &parameters)
 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 &parameters)
 Get the value of the function according to a given set of parameters. More...
 
void setAllParametersValues (const ParameterList &parameters)
 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 &parameters)
 Update the parameters from parameters. More...
 
bool matchParametersValues (const ParameterList &parameters)
 Update the parameters from parameters. More...
 
bool hasParameter (const std::string &name) const
 Tell if there is a parameter with specified name. More...
 
const ParameterListgetParameters () const
 Get all parameters available. More...
 
const ParametergetParameter (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

ParameterListgetParameters_ ()
 Get all parameters available. More...
 

Protected Attributes

bool constraintMatch_
 
Functionfunction_
 

Detailed Description

Wrapper class for optimization under constraints.

Catch any ConstraintException thrown and send +inf.

Definition at line 559 of file Functions.h.

Constructor & Destructor Documentation

◆ InfinityDerivableSecondOrderWrapper()

bpp::InfinityDerivableSecondOrderWrapper::InfinityDerivableSecondOrderWrapper ( DerivableFirstOrder function)
inline

Definition at line 563 of file Functions.h.

Referenced by clone().

◆ ~InfinityDerivableSecondOrderWrapper()

virtual bpp::InfinityDerivableSecondOrderWrapper::~InfinityDerivableSecondOrderWrapper ( )
inlinevirtual

Definition at line 566 of file Functions.h.

Member Function Documentation

◆ clone()

InfinityDerivableSecondOrderWrapper* bpp::InfinityDerivableSecondOrderWrapper::clone ( ) const
inlinevirtual

Create a copy of this object and send a pointer to it.

Returns
A pointer toward the copy object.

Reimplemented from bpp::InfinityDerivableFirstOrderWrapper.

Definition at line 568 of file Functions.h.

References InfinityDerivableSecondOrderWrapper().

◆ d2f() [1/2]

double bpp::InfinityDerivableSecondOrderWrapper::d2f ( const std::string &  variable,
const ParameterList parameters 
)
inline

◆ d2f() [2/2]

double bpp::InfinityDerivableSecondOrderWrapper::d2f ( const std::string &  variable1,
const std::string &  variable2,
const ParameterList parameters 
)
inline

◆ df()

double bpp::InfinityDerivableFirstOrderWrapper::df ( const std::string &  variable,
const ParameterList parameters 
)
inlineinherited

◆ f()

double bpp::InfinityFunctionWrapper::f ( const ParameterList parameters)
inlinevirtualinherited

Get the value of the function according to a given set of parameters.

Parameters
parametersThe parameter set to pass to the function.
Returns
The value of the function with the given parameter set.
Exceptions
ExceptionIf an error occured.

Reimplemented from bpp::FunctionWrapper.

Definition at line 466 of file Functions.h.

References bpp::InfinityFunctionWrapper::getValue(), and bpp::InfinityFunctionWrapper::setParameters().

◆ getFirstOrderDerivative()

double bpp::InfinityDerivableFirstOrderWrapper::getFirstOrderDerivative ( const std::string &  variable) const
inlineinherited

◆ getNamespace()

std::string bpp::FunctionWrapper::getNamespace ( ) const
inlinevirtualinherited
Returns
The current namespace used. This is an empty string if no namespace is currently defined.

Implements bpp::Parametrizable.

Definition at line 347 of file Functions.h.

References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getNamespace().

◆ getNumberOfParameters()

size_t bpp::FunctionWrapper::getNumberOfParameters ( ) const
inlinevirtualinherited

Get the number of parameters.

See also
getNumberOfIndependentParameters If some parameters are aliased.
Returns
The number of parameters.

Implements bpp::Parametrizable.

Definition at line 337 of file Functions.h.

References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getNumberOfParameters().

◆ getParameter()

const Parameter& bpp::FunctionWrapper::getParameter ( const std::string &  name) const
inlinevirtualinherited

Get the parameter with specified name.

Parameters
nameThe name of the parameter to look for.
Returns
The parameter with given name.
Exceptions
ParameterNotFoundExceptionif 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().

◆ getParameterNameWithoutNamespace()

std::string bpp::FunctionWrapper::getParameterNameWithoutNamespace ( const std::string &  name) const
inlinevirtualinherited

Resolves a parameter name according to the current namespace.

Returns
The parameter name without the namespace prefix, if any.

Implements bpp::Parametrizable.

Definition at line 352 of file Functions.h.

References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getParameterNameWithoutNamespace().

◆ getParameters()

const ParameterList& bpp::FunctionWrapper::getParameters ( ) const
inlinevirtualinherited

Get all parameters available.

See also
getIndependentParameters if some parameters are aliased.
Returns
A list with all parameters available.

Implements bpp::Parametrizable.

Definition at line 292 of file Functions.h.

References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getParameters().

◆ getParameters_()

ParameterList& bpp::FunctionWrapper::getParameters_ ( )
inlineprotectedvirtualinherited

Get all parameters available.

See also
getIndependentParameters if some parameters are aliased.
Returns
A list with all parameters available.

Implements bpp::Parametrizable.

Definition at line 358 of file Functions.h.

References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getParameters_().

◆ getParameterValue()

double bpp::FunctionWrapper::getParameterValue ( const std::string &  name) const
inlinevirtualinherited

Get the value for parameter of name 'name'.

Parameters
nameThe name of the parameter.
Returns
the value of parameter name.

Implements bpp::Parametrizable.

Definition at line 312 of file Functions.h.

References bpp::FunctionWrapper::function_, and bpp::Parametrizable::getParameterValue().

◆ getSecondOrderDerivative() [1/2]

double bpp::InfinityDerivableSecondOrderWrapper::getSecondOrderDerivative ( const std::string &  variable) const
inline

◆ getSecondOrderDerivative() [2/2]

double bpp::InfinityDerivableSecondOrderWrapper::getSecondOrderDerivative ( const std::string &  variable1,
const std::string &  variable2 
) const
inline

◆ getValue()

double bpp::InfinityFunctionWrapper::getValue ( ) const
inlinevirtualinherited

Get the value of the function at the current point.

Returns
The value of the function.
Exceptions
ExceptionIf 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().

◆ hasParameter()

bool bpp::FunctionWrapper::hasParameter ( const std::string &  name) const
inlinevirtualinherited

Tell if there is a parameter with specified name.

Parameters
nameThe name of the parameter to look for.
Returns
y/n.

Implements bpp::Parametrizable.

Definition at line 282 of file Functions.h.

References bpp::FunctionWrapper::function_, and bpp::Parametrizable::hasParameter().

◆ matchParametersValues()

bool bpp::InfinityFunctionWrapper::matchParametersValues ( const ParameterList parameters)
inlinevirtualinherited

Update the parameters from parameters.

Only common parameters with parameters will be updated.

Parameters
parametersA list of parameters.
Returns
True if at least one parameter value has been changed.
Exceptions
ConstraintExceptionIf 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().

◆ setAllParametersValues()

void bpp::InfinityFunctionWrapper::setAllParametersValues ( const ParameterList parameters)
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
parametersA list with all parameters.
Exceptions
ParameterNotFoundExceptionIf a some parameter in the list is not in params.
ConstraintExceptionIf 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().

◆ setNamespace()

void bpp::FunctionWrapper::setNamespace ( const std::string &  prefix)
inlinevirtualinherited

Set the namespace for the parameter names.

Parameters
prefixThe '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().

◆ setParameters()

void bpp::InfinityFunctionWrapper::setParameters ( const ParameterList parameters)
inlinevirtualinherited

Set the point where the function must be computed.

Parameters
parametersThe 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 d2f(), bpp::InfinityDerivableFirstOrderWrapper::df(), and bpp::InfinityFunctionWrapper::f().

◆ setParametersValues()

void bpp::InfinityFunctionWrapper::setParametersValues ( const ParameterList parameters)
inlinevirtualinherited

Update the parameters from parameters.

parameters must be a subset of all parameters available.

Parameters
parametersA list containing all parameters to update.
Exceptions
ParameterNotFoundExceptionIf a some parameter in params is not in the list.
ConstraintExceptionIf 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().

◆ setParameterValue()

void bpp::InfinityFunctionWrapper::setParameterValue ( const std::string &  name,
double  value 
)
inlinevirtualinherited

Set the value of parameter with name name to be equal to value.

Parameters
namethe name of the parameter to set.
valueThe value of the parameter.
Exceptions
ParameterNotFoundExceptionIf no parameter in the list has the name name.
ConstraintExceptionIf 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().

Member Data Documentation

◆ constraintMatch_

◆ function_

Function* bpp::FunctionWrapper::function_
protectedinherited

Definition at line 270 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::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().


The documentation for this class was generated from the following file: