shark::BoxConstraintHandler< Vector > Class Template Reference

#include <shark/ObjectiveFunctions/BoxConstraintHandler.h>

+ Inheritance diagram for shark::BoxConstraintHandler< Vector >:

Public Member Functions

 BoxConstraintHandler (Vector const &lower, Vector const &upper)
 
 BoxConstraintHandler (std::size_t dim, double lower, double upper)
 
 BoxConstraintHandler ()
 
std::size_t dimensions () const
 
bool isFeasible (Vector const &point) const
 Returns true if the point is in the feasible Region. More...
 
void closestFeasible (Vector &point) const
 
virtual void generateRandomPoint (random::rng_type &rng, Vector &startingPoint) const
 If supported, generates a random point inside the feasible region. More...
 
void setBounds (Vector const &lower, Vector const &upper)
 Sets lower and upper bounds of the box. More...
 
void setBounds (std::size_t dimension, double lower, double upper)
 Sets lower and upper bounds of the box. More...
 
Vector const & lower () const
 Returns the lower bound of the box. More...
 
Vector const & upper () const
 Returns the upper bound of the box. More...
 
- Public Member Functions inherited from shark::AbstractConstraintHandler< Vector >
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...
 

Additional Inherited Members

- Public Types inherited from shark::AbstractConstraintHandler< Vector >
enum  Feature
 
typedef TypedFlags< FeatureFeatures
 
typedef TypedFeatureNotAvailableException< FeatureFeatureNotAvailableException
 
- Protected Attributes inherited from shark::AbstractConstraintHandler< Vector >
Features m_features
 

Detailed Description

template<class Vector>
class shark::BoxConstraintHandler< Vector >

Definition at line 42 of file BoxConstraintHandler.h.

Constructor & Destructor Documentation

◆ BoxConstraintHandler() [1/3]

template<class Vector>
shark::BoxConstraintHandler< Vector >::BoxConstraintHandler ( Vector const &  lower,
Vector const &  upper 
)
inline

Definition at line 44 of file BoxConstraintHandler.h.

◆ BoxConstraintHandler() [2/3]

template<class Vector>
shark::BoxConstraintHandler< Vector >::BoxConstraintHandler ( std::size_t  dim,
double  lower,
double  upper 
)
inline

Definition at line 52 of file BoxConstraintHandler.h.

◆ BoxConstraintHandler() [3/3]

template<class Vector>
shark::BoxConstraintHandler< Vector >::BoxConstraintHandler ( )
inline

Definition at line 60 of file BoxConstraintHandler.h.

Member Function Documentation

◆ closestFeasible()

template<class Vector>
void shark::BoxConstraintHandler< Vector >::closestFeasible ( Vector &  point) const
inlinevirtual

Reimplemented from shark::AbstractConstraintHandler< Vector >.

Definition at line 79 of file BoxConstraintHandler.h.

◆ dimensions()

◆ generateRandomPoint()

template<class Vector>
virtual void shark::BoxConstraintHandler< Vector >::generateRandomPoint ( random::rng_type &  rng,
Vector &  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 from shark::AbstractConstraintHandler< Vector >.

Definition at line 87 of file BoxConstraintHandler.h.

◆ isFeasible()

template<class Vector>
bool shark::BoxConstraintHandler< Vector >::isFeasible ( Vector const &  ) const
inlinevirtual

Returns true if the point is in the feasible Region.

This function must be implemented by a ConstraintHandler

Implements shark::AbstractConstraintHandler< Vector >.

Definition at line 71 of file BoxConstraintHandler.h.

◆ lower()

template<class Vector>
Vector const& shark::BoxConstraintHandler< Vector >::lower ( ) const
inline

◆ setBounds() [1/2]

◆ setBounds() [2/2]

template<class Vector>
void shark::BoxConstraintHandler< Vector >::setBounds ( std::size_t  dimension,
double  lower,
double  upper 
)
inline

Sets lower and upper bounds of the box.

Definition at line 102 of file BoxConstraintHandler.h.

◆ upper()

template<class Vector>
Vector const& shark::BoxConstraintHandler< Vector >::upper ( ) const
inline

Returns the upper bound of the box.

Definition at line 111 of file BoxConstraintHandler.h.

Referenced by shark::BoxConstraintHandler< SearchPointType >::setBounds().


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