ocra-recipes
Doxygen documentation for the ocra-recipes repository
Public Member Functions | Protected Member Functions | List of all members
ocra::IFunctionProperties Class Reference

#include <IFunctionProperties.h>

Inheritance diagram for ocra::IFunctionProperties:
[legend]

Public Member Functions

bool hasSeparableTimeDependancy (void) const
 
eFunctionLinearity getType (void) const
 
eFunctionConvexity getConvexityProperty (void) const
 
int getContinuityProperty (void) const
 
const std::string & getProperty (int i) const
 
int getNumberOfProperties (void) const
 
bool hasProperty (const std::string &functionProperty) const
 
bool isExplicitlyTimeDependant (void) const
 

Protected Member Functions

 IFunctionProperties (eFunctionLinearity linearity=LINEARITY_UNDEFINED, eFunctionConvexity convexity=CONVEXITY_UNDEFINED, int continuity=CONTINUITY_UNKNOWN, bool explicitlyTimeDependant=false, bool separableTimeDependancy=true)
 IFunctionProperties Constructor. More...
 
void changeType (eFunctionLinearity newType)
 
void changeConvexityProperty (eFunctionConvexity newProperty)
 
void changeContinuityProperty (int newProperty)
 
void addProperty (const std::string &functionProperty)
 
void removeProperty (const std::string &functionProperty)
 
void changeExplicitTimeDependancy (bool b)
 
void changeSeparableTimeDependancy (bool b)
 

Detailed Description

This class groups the properties a function can have. The usual properties used by an optimization software are described by the use of the enumerations eFunctionContinuity, eFunctionLinearity and eFunctionContinuity. Furthermore two flags are used to indicate wether the function has an explicit time-dependancy and if it is the case if this time dependancy is separable from the variable dependancy: $ f(x,t) = g(x)+h(t)$ Additionnal properties can be added with the help of strings.

Definition at line 74 of file IFunctionProperties.h.

Constructor & Destructor Documentation

ocra::IFunctionProperties::IFunctionProperties ( eFunctionLinearity  linearity = LINEARITY_UNDEFINED,
eFunctionConvexity  convexity = CONVEXITY_UNDEFINED,
int  continuity = CONTINUITY_UNKNOWN,
bool  explicitlyTimeDependant = false,
bool  separableTimeDependancy = true 
)
protected

IFunctionProperties Constructor.

Parameters
[in]linearityLinearity property of the function.
[in]convexityConvexity property of the function.
[in]continuityContinuity property of the function.
Precondition
(continuity==CONTINUITY_UNKNOWN) || (continuity>0 && continuity<=CONTINUITY_CINF)

Definition at line 8 of file IFunctionProperties.cpp.

Member Function Documentation

void ocra::IFunctionProperties::addProperty ( const std::string &  functionProperty)
protected

add a property to the function If the property already exist for the function, it will not be added again

Definition at line 51 of file IFunctionProperties.cpp.

void ocra::IFunctionProperties::changeContinuityProperty ( int  newProperty)
protected

change the continuity property of the function to newProperty

Precondition
(newProperty==CONTINUITY_UNKNOWN) || (newProperty>0 && newProperty<=CONTINUITY_CINF)

Definition at line 45 of file IFunctionProperties.cpp.

void ocra::IFunctionProperties::changeConvexityProperty ( eFunctionConvexity  newProperty)
protected

change the convexity property of the function to newProperty

Definition at line 40 of file IFunctionProperties.cpp.

void ocra::IFunctionProperties::changeExplicitTimeDependancy ( bool  b)
protected

set the explicit time dependancy property to b

Definition at line 93 of file IFunctionProperties.cpp.

void ocra::IFunctionProperties::changeSeparableTimeDependancy ( bool  b)
protected

set the separable time dependancy property to b However, hasSeparableTimeDependancy will always return true, if there is no explicit time dependancy.

Definition at line 98 of file IFunctionProperties.cpp.

void ocra::IFunctionProperties::changeType ( eFunctionLinearity  newType)
protected

change the linearity property of the function to newType

Definition at line 35 of file IFunctionProperties.cpp.

int ocra::IFunctionProperties::getContinuityProperty ( void  ) const

Definition at line 30 of file IFunctionProperties.cpp.

eFunctionConvexity ocra::IFunctionProperties::getConvexityProperty ( void  ) const

Definition at line 25 of file IFunctionProperties.cpp.

int ocra::IFunctionProperties::getNumberOfProperties ( void  ) const

Definition at line 72 of file IFunctionProperties.cpp.

const std::string & ocra::IFunctionProperties::getProperty ( int  i) const

Definition at line 67 of file IFunctionProperties.cpp.

eFunctionLinearity ocra::IFunctionProperties::getType ( void  ) const

Accessors

Definition at line 20 of file IFunctionProperties.cpp.

bool ocra::IFunctionProperties::hasProperty ( const std::string &  functionProperty) const

Definition at line 77 of file IFunctionProperties.cpp.

bool ocra::IFunctionProperties::hasSeparableTimeDependancy ( void  ) const

Return true if f(x,t) can be written g(x)+h(t). It includes the case when there is no explicit time dependancy since in that case g(x) = f(x,t) and h(t)=0.

Definition at line 88 of file IFunctionProperties.cpp.

bool ocra::IFunctionProperties::isExplicitlyTimeDependant ( void  ) const

Definition at line 83 of file IFunctionProperties.cpp.

void ocra::IFunctionProperties::removeProperty ( const std::string &  functionProperty)
protected

remove a property from the function If the property doesn't exist for this function, nothing happens.

Postcondition
functionProperty doesn't appear anymore in the function properties

Definition at line 58 of file IFunctionProperties.cpp.


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