shark::AbstractConstraintHandler< SearchPointType > Class Template Referenceabstract

Implements the base class for constraint handling. More...

#include <shark/ObjectiveFunctions/AbstractConstraintHandler.h>

+ Inheritance diagram for shark::AbstractConstraintHandler< SearchPointType >:

Public Types

enum  Feature { CAN_PROVIDE_CLOSEST_FEASIBLE = 1, IS_BOX_CONSTRAINED = 2, CAN_GENERATE_RANDOM_POINT = 4 }
 
typedef TypedFlags< FeatureFeatures
 
typedef TypedFeatureNotAvailableException< FeatureFeatureNotAvailableException
 

Public Member Functions

const Featuresfeatures () const
 
virtual void updateFeatures ()
 
virtual ~AbstractConstraintHandler ()
 
bool canProvideClosestFeasible () const
 Returns whether this function can calculate the closest feasible to an infeasible point. More...
 
bool isBoxConstrained () const
 Returns whether this function is an instance of BoxConstraintHandler. More...
 
bool canGenerateRandomPoint () const
 Returns whether this function is an instance of BoxConstraintHandler. More...
 
virtual void generateRandomPoint (random::rng_type &rng, SearchPointType &startingPoint) const
 If supported, generates a random point inside the feasible region. More...
 
virtual bool isFeasible (SearchPointType const &) const =0
 Returns true if the point is in the feasible Region. More...
 
virtual void closestFeasible (SearchPointType &) const
 

Protected Attributes

Features m_features
 

Detailed Description

template<class SearchPointType>
class shark::AbstractConstraintHandler< SearchPointType >

Implements the base class for constraint handling.

A constraint handler provides information about the feasible region of a constrained optimization problem. In the minimum it checks whether a point is feasible, or what the next fasible point would be.

Definition at line 48 of file AbstractConstraintHandler.h.

Member Typedef Documentation

◆ FeatureNotAvailableException

Definition at line 55 of file AbstractConstraintHandler.h.

◆ Features

template<class SearchPointType>
typedef TypedFlags<Feature> shark::AbstractConstraintHandler< SearchPointType >::Features

Definition at line 55 of file AbstractConstraintHandler.h.

Member Enumeration Documentation

◆ Feature

template<class SearchPointType>
enum shark::AbstractConstraintHandler::Feature
Enumerator
CAN_PROVIDE_CLOSEST_FEASIBLE 

The constraint handler can provide a close feasible point to an infeasible one.

IS_BOX_CONSTRAINED 

The constraint handler is an instance of BoxConstraintHandler.

CAN_GENERATE_RANDOM_POINT 

The ConstraintHandler can generate a random point inside the feasible region.

Definition at line 50 of file AbstractConstraintHandler.h.

Constructor & Destructor Documentation

◆ ~AbstractConstraintHandler()

template<class SearchPointType>
virtual shark::AbstractConstraintHandler< SearchPointType >::~AbstractConstraintHandler ( )
inlinevirtual

Definition at line 57 of file AbstractConstraintHandler.h.

Member Function Documentation

◆ canGenerateRandomPoint()

template<class SearchPointType>
bool shark::AbstractConstraintHandler< SearchPointType >::canGenerateRandomPoint ( ) const
inline

Returns whether this function is an instance of BoxConstraintHandler.

Definition at line 69 of file AbstractConstraintHandler.h.

Referenced by shark::AbstractObjectiveFunction< SearchSpaceType, ResultT >::announceConstraintHandler().

◆ canProvideClosestFeasible()

template<class SearchPointType>
bool shark::AbstractConstraintHandler< SearchPointType >::canProvideClosestFeasible ( ) const
inline

Returns whether this function can calculate the closest feasible to an infeasible point.

Definition at line 60 of file AbstractConstraintHandler.h.

Referenced by shark::AbstractObjectiveFunction< SearchSpaceType, ResultT >::announceConstraintHandler().

◆ closestFeasible()

template<class SearchPointType>
virtual void shark::AbstractConstraintHandler< SearchPointType >::closestFeasible ( SearchPointType &  ) const
inlinevirtual

◆ features()

template<class SearchPointType>
const Features& shark::AbstractConstraintHandler< SearchPointType >::features ( ) const
inline

Definition at line 55 of file AbstractConstraintHandler.h.

◆ generateRandomPoint()

template<class SearchPointType>
virtual void shark::AbstractConstraintHandler< SearchPointType >::generateRandomPoint ( random::rng_type &  rng,
SearchPointType &  startingPoint 
) const
inlinevirtual

If supported, generates a random point inside the feasible region.

Parameters
rngThe random number generator used for generating the point
startingPointThe proposed point

Reimplemented in shark::BoxConstraintHandler< Vector >, shark::BoxConstraintHandler< RealVector >, and shark::BoxConstraintHandler< SearchPointType >.

Definition at line 77 of file AbstractConstraintHandler.h.

◆ isBoxConstrained()

template<class SearchPointType>
bool shark::AbstractConstraintHandler< SearchPointType >::isBoxConstrained ( ) const
inline

Returns whether this function is an instance of BoxConstraintHandler.

Definition at line 65 of file AbstractConstraintHandler.h.

◆ isFeasible()

template<class SearchPointType>
virtual bool shark::AbstractConstraintHandler< SearchPointType >::isFeasible ( SearchPointType const &  ) const
pure virtual

Returns true if the point is in the feasible Region.

This function must be implemented by a ConstraintHandler

Implemented in shark::BoxConstraintHandler< Vector >, shark::BoxConstraintHandler< RealVector >, and shark::BoxConstraintHandler< SearchPointType >.

Referenced by shark::AbstractConstraintHandler< Vector >::generateRandomPoint().

◆ updateFeatures()

template<class SearchPointType>
virtual void shark::AbstractConstraintHandler< SearchPointType >::updateFeatures ( )
inlinevirtual

Definition at line 55 of file AbstractConstraintHandler.h.

Member Data Documentation

◆ m_features


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