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