17#include <geos/export.h>
31 Interval(
double newMin,
double newMax) : imin(newMin), imax(newMax) {
35 double getMin()
const {
return imin; }
36 double getMax()
const {
return imax; }
37 double getWidth()
const {
return imax - imin; }
38 double getCentre()
const {
return (imin + imax) / 2; }
40 imax = std::max(imax, other->imax);
41 imin = std::min(imin, other->imin);
44 bool intersects(
const Interval* other)
const {
45 return !(other->imin > imax || other->imax < imin);
47 bool equals(
const Interval* other)
const {
48 return imin == other->imin && imax == other->imax;
A contiguous portion of 1D-space. Used internally by SIRtree.
Definition: strtree/Interval.h:29
Basic namespace for all GEOS functionalities.
Definition: geos.h:39