diff options
Diffstat (limited to 'flower/interval.cc')
-rw-r--r-- | flower/interval.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/flower/interval.cc b/flower/interval.cc new file mode 100644 index 0000000000..b307f4c634 --- /dev/null +++ b/flower/interval.cc @@ -0,0 +1,18 @@ +#include <assert.h> +#include "interval.hh" +#include <math.h> + +const Real INFTY = HUGE; + +void +Interval::set_empty() { + min = INFTY; + max = -INFTY; +} + +Real +Interval::length() const { + assert(max >= min); + return max-min; +} + |