bpp-core3  3.0.0
bpp::ConstraintInterface Class Referenceabstract

The constraint interface. More...

#include <Bpp/Numeric/Constraints.h>

+ Inheritance diagram for bpp::ConstraintInterface:
+ Collaboration diagram for bpp::ConstraintInterface:

Public Member Functions

 ConstraintInterface ()
 
virtual ~ConstraintInterface ()
 
ConstraintInterfaceclone () 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 ConstraintInterfaceoperator & (const ConstraintInterface &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 28 of file Constraints.h.

Constructor & Destructor Documentation

◆ ConstraintInterface()

bpp::ConstraintInterface::ConstraintInterface ( )
inline

Definition at line 32 of file Constraints.h.

◆ ~ConstraintInterface()

virtual bpp::ConstraintInterface::~ConstraintInterface ( )
inlinevirtual

Member Function Documentation

◆ clone()

ConstraintInterface* bpp::ConstraintInterface::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 ~ConstraintInterface().

◆ getAcceptedLimit()

virtual double bpp::ConstraintInterface::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 ~ConstraintInterface().

◆ getDescription()

virtual std::string bpp::ConstraintInterface::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 ~ConstraintInterface().

◆ getLimit()

virtual double bpp::ConstraintInterface::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.

Referenced by ~ConstraintInterface().

◆ includes()

virtual bool bpp::ConstraintInterface::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.

Referenced by ~ConstraintInterface().

◆ isCorrect()

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

Tell if a given value is correct.

Parameters
valueThe value to test.
Returns
True is the value is correct.

Implemented in bpp::IntervalConstraint.

Referenced by bpp::IntervalConstraint::getAcceptedLimit(), bpp::IntervalConstraint::getLimit(), bpp::InvariantMixedDiscreteDistribution::restrictToConstraint(), and ~ConstraintInterface().

◆ isEmpty()

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

Tells if this constraints defines an empty set.

Implemented in bpp::IntervalConstraint.

Referenced by ~ConstraintInterface().

◆ operator &()

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

Intersect this Constraint with another one.

Parameters
cthe intersected Constraint
Returns
the intersection

Implemented in bpp::IntervalConstraint.

Referenced by ~ConstraintInterface().


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