Interval

#include <pbbam/Interval.h>
template <typename T>
class PacBio::BAM::Interval

Represents a half-open (right-open) interval [start, stop)

Note
This class is agnostic whether the values are 0-based or 1-based. Client code should primarily work with GenomicInterval, which does enforce this distinction.

Constructors & Related Methods

Interval()

Creates an empty interval [0,0)

Interval(const T val)

Creates a ‘singleton’ interval [val,val+1)

Interval(const T start, const T stop)

brief Creates an interval from [start, stop) */

Interval(const Interval<T> &other)

Comparison Operators

bool operator==(const Interval<T> &other) const

Return
true if both intervals share the same endpoints

bool operator!=(const Interval<T> &other) const

Return
true if either interval’s endpoints differ

Attributes

T Start() const

Return
interval’s start coordinate

Interval<T> &Start(const T &start)

Sets this interval’s start coordinate.

Return
reference to this interval
Parameters
  • start:

T Stop() const

Return
interval’s stop coordinate

Interval<T> &Stop(const T &stop)

Sets this interval’s stop coordinate.

Return
reference to this interval
Parameters
  • stop:

Interval Operations

bool CoveredBy(const Interval<T> &other) const

Return
true if this interval is fully covered by (or contained in) other

bool Covers(const Interval<T> &other) const
bool Intersects(const Interval<T> &other) const

Return
true if intervals interset

bool IsValid() const

Return
true if interval is valid (e.g. start < stop)

size_t Length() const

Return
interval length

Public Types

template<>
using interval_type = boost::icl::discrete_interval<T>