bpp-core  2.2.0
bpp::Constraint Class Referenceabstract

The constraint interface. More...

#include <Bpp/Numeric/Constraints.h>

+ Inheritance diagram for bpp::Constraint:
+ Collaboration diagram for bpp::Constraint:

Public Member Functions

 Constraint ()
 
virtual ~Constraint ()
 
Constraintclone () const =0
 Create a copy of this object and send a pointer to it. More...
 
virtual bool isCorrect (double value) const =0
 Tell if a given value is correct. More...
 
virtual bool includes (double min, double max) const =0
 Tell if all the values in a given interval are correct. More...
 
virtual double getLimit (double value) const =0
 Give the nearest limit for a bad value. More...
 
virtual double getAcceptedLimit (double value) const =0
 Give the nearest accepted limit for a bad value. More...
 
virtual std::string getDescription () const =0
 Give a short description on the type of constraint. More...
 
virtual Constraintoperator & (const Constraint &c) const =0
 Intersect this Constraint with another one. More...
 
virtual bool isEmpty () const =0
 Tells if this constraints defines an empty set. More...
 

Detailed Description

The constraint interface.

It provides a method that tells if a given value is correct.

Definition at line 62 of file Constraints.h.

Constructor & Destructor Documentation

◆ Constraint()

bpp::Constraint::Constraint ( )
inline

Definition at line 65 of file Constraints.h.

◆ ~Constraint()

virtual bpp::Constraint::~Constraint ( )
inlinevirtual

Definition at line 66 of file Constraints.h.

Member Function Documentation

◆ clone()

Constraint* bpp::Constraint::clone ( ) const
pure virtual

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

Returns
A pointer toward the copy object.

Implements bpp::Clonable.

Implemented in bpp::IntervalConstraint.

Referenced by bpp::Parameter::operator=(), and bpp::Parameter::Parameter().

◆ getAcceptedLimit()

virtual double bpp::Constraint::getAcceptedLimit ( double  value) const
pure virtual

Give the nearest accepted limit for a bad value.

The difference with getLimit() is when the Constraint is open at the limit, in which case the retruned value is the limit +- 1e-12.

Parameters
valueThe bad value.
Returns
The nearer limit.

Implemented in bpp::IntervalConstraint.

Referenced by bpp::BfgsMultiDimensions::doInit().

◆ getDescription()

virtual std::string bpp::Constraint::getDescription ( ) const
pure virtual

Give a short description on the type of constraint.

Returns
A string which describes the constraint.

Implemented in bpp::IntervalConstraint.

Referenced by bpp::AbstractParameterAliasable::aliasParameters(), and bpp::ReparametrizationFunctionWrapper::init_().

◆ getLimit()

virtual double bpp::Constraint::getLimit ( double  value) const
pure virtual

Give the nearest limit for a bad value.

Parameters
valueThe bad value.
Returns
The nearer limit.

Implemented in bpp::IntervalConstraint.

◆ includes()

virtual bool bpp::Constraint::includes ( double  min,
double  max 
) const
pure virtual

Tell if all the values in a given interval are correct.

Parameters
min,maxThe bounds of the interval.
Returns
True is the value is correct.

Implemented in bpp::IntervalConstraint.

◆ isCorrect()

virtual bool bpp::Constraint::isCorrect ( double  value) const
pure virtual

◆ isEmpty()

virtual bool bpp::Constraint::isEmpty ( ) const
pure virtual

Tells if this constraints defines an empty set.

Implemented in bpp::IntervalConstraint.

◆ operator &()

virtual Constraint* bpp::Constraint::operator& ( const Constraint c) const
pure virtual

Intersect this Constraint with another one.

Parameters
cthe intersected Constraint
Returns
the intersection

Implemented in bpp::IntervalConstraint.


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