bpp-core
2.2.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 124 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 93 of file Range.h.
Referenced by bpp::RangeSet< T >::addRange(), and bpp::MultiRange< T >::addRange().
|
inline |
r | Range to compare with. |
Definition at line 153 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 126 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 164 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
|
inline |
r | Range to compare with. |
Definition at line 144 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
|
inline |
Definition at line 194 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
Referenced by bpp::RangeSet< T >::addRange().
|
inline |
Definition at line 128 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
|
inline |
Definition at line 101 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
|
inlinevirtual |
|
inlinevirtual |
Definition at line 107 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
|
inlinevirtual |
|
inlinevirtual |
Definition at line 115 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
|
inline |
Definition at line 104 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
|
inline |
Definition at line 87 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
|
inline |
Definition at line 98 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
|
inline |
r | Range to compare with. |
Definition at line 134 of file Range.h.
References bpp::Range< T >::begin_, and bpp::Range< T >::end_.
Referenced by 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 178 of file Range.h.
References bpp::Range< T >::begin_, bpp::Range< T >::end_, and bpp::Range< T >::overlap().
|
inline |
Definition at line 199 of file Range.h.
References bpp::Range< T >::begin_, bpp::Range< T >::end_, and bpp::TextTools::toString().
|
private |
Definition at line 64 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 >::isEmpty(), bpp::Range< T >::length(), bpp::Range< T >::operator!=(), bpp::Range< T >::operator+=(), bpp::Range< T >::operator-=(), bpp::Range< T >::operator<(), bpp::Range< T >::operator=(), bpp::Range< T >::operator==(), bpp::Range< T >::overlap(), bpp::Range< T >::sliceWith(), and bpp::Range< T >::toString().
|
private |
Definition at line 65 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 >::length(), bpp::Range< T >::operator!=(), bpp::Range< T >::operator+=(), bpp::Range< T >::operator-=(), bpp::Range< T >::operator<(), bpp::Range< T >::operator=(), bpp::Range< T >::operator==(), bpp::Range< T >::overlap(), bpp::Range< T >::sliceWith(), and bpp::Range< T >::toString().