bpp-core3
3.0.0
|
The Range class, defining an interval. More...
#include <Bpp/Numeric/Range.h>
Public Member Functions | |
Range (const T &a=0, const T &b=0) | |
Creates a new interval. More... | |
Range (const Range< T > &range) | |
Range< T > & | operator= (const Range< T > &range) |
Range< T > * | clone () const |
Create a copy of this object and send a pointer to it. More... | |
virtual | ~Range () |
bool | operator== (const Range< T > &r) const |
bool | operator!= (const Range< T > &r) const |
bool | operator< (const Range< T > &r) const |
virtual Range & | operator+= (const T &val) |
virtual Range | operator+ (const T &val) |
virtual Range & | operator-= (const T &val) |
virtual Range | operator- (const T &val) |
T | begin () const |
T | end () const |
T | length () const |
bool | overlap (const Range &r) const |
bool | isContiguous (const Range &r) const |
bool | contains (const Range &r) const |
void | expandWith (const Range &r) |
Expand the current interval with the given one. More... | |
void | sliceWith (const Range &r) |
Restrict the current interval to the intersection with the given one. More... | |
bool | isEmpty () const |
std::string | toString () const |
Private Attributes | |
T | begin_ |
T | end_ |
The Range class, defining an interval.
Methods are provided for extending the range, get union and intersection.
|
inline |
|
inline |
|
inlinevirtual |
|
inline |
Definition at line 98 of file Range.h.
References bpp::Range< T >::begin_.
|
inlinevirtual |
Create a copy of this object and send a pointer to it.
Implements bpp::Clonable.
Definition at line 60 of file Range.h.
Referenced by bpp::RangeSet< T >::addRange(), and bpp::MultiRange< T >::addRange().
|
inline |
r | Range to compare with. |
Definition at line 127 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
Referenced by bpp::RangeSet< T >::filterWithin(), and bpp::MultiRange< T >::filterWithin().
|
inline |
Definition at line 100 of file Range.h.
References bpp::Range< T >::end_.
|
inline |
Expand the current interval with the given one.
If the two intervals do not overlap, then the interval is not modified.
r | input interval. |
Definition at line 138 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
|
inline |
r | Range to compare with. |
Definition at line 118 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
|
inline |
Definition at line 171 of file Range.h.
References bpp::Range< T >::end_.
Referenced by bpp::RangeSet< T >::addRange(), and bpp::RangeCollection< T >::~RangeCollection().
|
inline |
Definition at line 102 of file Range.h.
References bpp::Range< T >::begin_.
|
inline |
Definition at line 69 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inlinevirtual |
|
inline |
|
inline |
Definition at line 53 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
|
inline |
Definition at line 65 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
|
inline |
r | Range to compare with. |
Definition at line 108 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
Referenced by bpp::MultiRange< T >::addRange(), and bpp::Range< T >::sliceWith().
|
inline |
Restrict the current interval to the intersection with the given one.
If the two intervals do not overlap, then the interval is set to empty.
r | input interval. |
Definition at line 152 of file Range.h.
References bpp::Range< T >::begin_, bpp::Range< T >::end_, and bpp::Range< T >::overlap().
|
inline |
Definition at line 176 of file Range.h.
References bpp::TextTools::toString().
Referenced by bpp::RangeCollection< T >::~RangeCollection().
|
private |
Definition at line 30 of file Range.h.
Referenced by bpp::Range< T >::begin(), bpp::Range< T >::contains(), bpp::Range< T >::expandWith(), bpp::Range< T >::isContiguous(), bpp::Range< T >::length(), bpp::Range< T >::operator!=(), bpp::Range< T >::operator=(), bpp::Range< T >::operator==(), bpp::Range< T >::overlap(), and bpp::Range< T >::sliceWith().
|
private |
Definition at line 31 of file Range.h.
Referenced by bpp::Range< T >::contains(), bpp::Range< T >::end(), bpp::Range< T >::expandWith(), bpp::Range< T >::isContiguous(), bpp::Range< T >::isEmpty(), bpp::Range< T >::operator!=(), bpp::Range< T >::operator=(), bpp::Range< T >::operator==(), bpp::Range< T >::overlap(), and bpp::Range< T >::sliceWith().