bpp::ExcludingPositiveReal Class Reference

Excluding positive real constraint. More...

#include <Bpp/Numeric/Constraints.h>

Inheritance diagram for bpp::ExcludingPositiveReal:
Inheritance graph
[legend]
Collaboration diagram for bpp::ExcludingPositiveReal:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ExcludingPositiveReal (double lowerBound, double precision=NumConstants::TINY)
ExcludingPositiveRealclone () const
 Create a copy of this object and send a pointer to it.
bool isCorrect (double value) const
 Tell if a given value is correct.
void setLowerBound (double lowerBound, bool strict)
void setUpperBound (double upperBound, bool strict)
double getLowerBound () const
double getUpperBound () const
bool strictLowerBound () const
bool strictUpperBound () const
bool includes (double min, double max) const
 Tell if all the values in a given interval are correct.
bool operator< (double value) const
bool operator> (double value) const
bool operator<= (double value) const
bool operator<= (const Interval &i) const
 Tells if this interval is included or equal in another one.
bool operator>= (double value) const
double getLimit (double value) const
 Give the nearest limit for a bad value.
double getAcceptedLimit (double value) const
 Give the nearest accepted limit for a bad value.
double getPrecision () const
std::string getDescription () const
 Give a short description on the type of constraint.
Constraintoperator& (const Constraint &c) const
 Intersect this Interval with another one.
Intervaloperator&= (const Constraint &c)
 Intersect this Interval with another one.
bool operator== (const Interval &i) const
 Tells if this interval equals another one.
bool operator!= (const Interval &i) const
 Tells if this interval is different from another one.

Protected Attributes

double lowerBound_
 The boundaries of the interval.
double upperBound_
bool inclLowerBound_
 Boolean flags are true if the boundaries are included.
bool inclUpperBound_
double precision_
 the accepted precision on the boundary (default: 1e-12)

Detailed Description

Excluding positive real constraint.

Definition at line 377 of file Constraints.h.


Constructor & Destructor Documentation

bpp::ExcludingPositiveReal::ExcludingPositiveReal ( double  lowerBound,
double  precision = NumConstants::TINY 
) [inline]

Definition at line 380 of file Constraints.h.

Referenced by clone().


Member Function Documentation

ExcludingPositiveReal* bpp::ExcludingPositiveReal::clone (  )  const [inline, virtual]

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

Returns:
A pointer toward the copy object.

Reimplemented from bpp::Interval.

Definition at line 383 of file Constraints.h.

References ExcludingPositiveReal().

double bpp::Interval::getAcceptedLimit ( double  value  )  const [inline, virtual, inherited]

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:
value The bad value.
Returns:
The nearer limit.

Implements bpp::Constraint.

Definition at line 211 of file Constraints.h.

References bpp::Interval::isCorrect(), bpp::Interval::lowerBound_, bpp::Interval::precision_, bpp::Interval::strictLowerBound(), bpp::Interval::strictUpperBound(), and bpp::Interval::upperBound_.

std::string bpp::Interval::getDescription (  )  const [inline, virtual, inherited]

Give a short description on the type of constraint.

Returns:
A string which describes the constraint.

Implements bpp::Constraint.

Definition at line 224 of file Constraints.h.

References bpp::Interval::inclLowerBound_, bpp::Interval::inclUpperBound_, bpp::Interval::lowerBound_, bpp::TextTools::toString(), bpp::Interval::upperBound_, and bpp::NumConstants::VERY_BIG.

double bpp::Interval::getLimit ( double  value  )  const [inline, virtual, inherited]

Give the nearest limit for a bad value.

Parameters:
value The bad value.
Returns:
The nearer limit.

Implements bpp::Constraint.

Definition at line 205 of file Constraints.h.

References bpp::Interval::isCorrect(), bpp::Interval::lowerBound_, and bpp::Interval::upperBound_.

double bpp::Interval::getLowerBound (  )  const [inline, inherited]
double bpp::Interval::getPrecision (  )  const [inline, inherited]

Definition at line 219 of file Constraints.h.

References bpp::Interval::precision_.

Referenced by bpp::Interval::operator&(), and bpp::Interval::operator&=().

double bpp::Interval::getUpperBound (  )  const [inline, inherited]
bool bpp::Interval::includes ( double  min,
double  max 
) const [inline, virtual, inherited]

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

Parameters:
min,max The bounds of the interval.
Returns:
True is the value is correct.

Implements bpp::Constraint.

Definition at line 173 of file Constraints.h.

References bpp::Interval::getLowerBound(), bpp::Interval::getUpperBound(), bpp::Interval::inclLowerBound_, and bpp::Interval::inclUpperBound_.

bool bpp::ExcludingPositiveReal::isCorrect ( double  value  )  const [inline, virtual]

Tell if a given value is correct.

Parameters:
value The value to test.
Returns:
True is the value is correct.

Reimplemented from bpp::Interval.

Definition at line 385 of file Constraints.h.

References bpp::Interval::getLowerBound(), and bpp::NumConstants::VERY_BIG.

bool bpp::Interval::operator!= ( const Interval i  )  const [inline, inherited]

Tells if this interval is different from another one.

Parameters:
i the compared Interval

Definition at line 336 of file Constraints.h.

References bpp::Interval::inclLowerBound_, bpp::Interval::inclUpperBound_, bpp::Interval::lowerBound_, and bpp::Interval::upperBound_.

Constraint* bpp::Interval::operator& ( const Constraint c  )  const [inline, virtual, inherited]

Intersect this Interval with another one.

Parameters:
c the intersected Interval
Returns:
the intersection, or NULL if c is not an Interval. The resulting precision is the maximum of both precisions.

Implements bpp::Constraint.

Definition at line 240 of file Constraints.h.

References bpp::Interval::getPrecision(), bpp::Interval::inclLowerBound_, bpp::Interval::inclUpperBound_, bpp::Interval::Interval(), bpp::Interval::lowerBound_, bpp::Interval::precision_, and bpp::Interval::upperBound_.

Interval& bpp::Interval::operator&= ( const Constraint c  )  [inline, inherited]

Intersect this Interval with another one.

Parameters:
c the intersected Interval
Returns:
this Interval modified, or not modified if c is not an Interval. The precision is set to the maximum of bith precisions.

Definition at line 284 of file Constraints.h.

References bpp::Interval::getPrecision(), bpp::Interval::inclLowerBound_, bpp::Interval::inclUpperBound_, bpp::Interval::lowerBound_, bpp::Interval::precision_, and bpp::Interval::upperBound_.

bool bpp::Interval::operator< ( double  value  )  const [inline, inherited]

Definition at line 185 of file Constraints.h.

References bpp::Interval::inclUpperBound_, and bpp::Interval::upperBound_.

bool bpp::Interval::operator<= ( const Interval i  )  const [inline, inherited]

Tells if this interval is included or equal in another one.

Parameters:
i the compared Interval

Definition at line 349 of file Constraints.h.

References bpp::Interval::lowerBound_, and bpp::Interval::upperBound_.

bool bpp::Interval::operator<= ( double  value  )  const [inline, inherited]

Definition at line 195 of file Constraints.h.

References bpp::Interval::upperBound_.

bool bpp::Interval::operator== ( const Interval i  )  const [inline, inherited]

Tells if this interval equals another one.

Parameters:
i the compared Interval

Definition at line 323 of file Constraints.h.

References bpp::Interval::inclLowerBound_, bpp::Interval::inclUpperBound_, bpp::Interval::lowerBound_, and bpp::Interval::upperBound_.

bool bpp::Interval::operator> ( double  value  )  const [inline, inherited]

Definition at line 190 of file Constraints.h.

References bpp::Interval::inclLowerBound_, and bpp::Interval::lowerBound_.

bool bpp::Interval::operator>= ( double  value  )  const [inline, inherited]

Definition at line 200 of file Constraints.h.

References bpp::Interval::lowerBound_.

void bpp::Interval::setLowerBound ( double  lowerBound,
bool  strict 
) [inline, inherited]
void bpp::Interval::setUpperBound ( double  upperBound,
bool  strict 
) [inline, inherited]
bool bpp::Interval::strictLowerBound (  )  const [inline, inherited]
bool bpp::Interval::strictUpperBound (  )  const [inline, inherited]

Member Data Documentation

bool bpp::Interval::inclLowerBound_ [protected, inherited]
bool bpp::Interval::inclUpperBound_ [protected, inherited]
double bpp::Interval::lowerBound_ [protected, inherited]
double bpp::Interval::precision_ [protected, inherited]

the accepted precision on the boundary (default: 1e-12)

Definition at line 142 of file Constraints.h.

Referenced by bpp::Interval::getAcceptedLimit(), bpp::Interval::getPrecision(), bpp::Interval::operator&(), and bpp::Interval::operator&=().

double bpp::Interval::upperBound_ [protected, inherited]

The documentation for this class was generated from the following file:
Generated on Wed Feb 29 14:48:24 2012 for bpp-core by  doxygen 1.6.3