#ifndef stmap_H #define stmap_H /* Operations with intervals */ /* Last edited on 2005-02-04 02:56:09 by stolfi */ /* Should be merged with (or replaced by) {ia.h}. */ typedef struct interval_t { double end[2]; } interval_t; /* An {interval_t} is an interval of reals with {double} endpoints. */ #define lo(I) ((I).end[0]) #define hi(I) ((I).end[1]) /* Low and high bounds of an interval {I}. */ void interval_widen(interval_t *r, double margin); /* Widens {*r} by the specified {margin} on both sides */ void interval_adjust_ratio(interval_t *xr, interval_t *yr, double tx, double ty); /* Widens either {*xr} or {*yr}, as needed, to ensure that their dimensions are in the ratio {tx:ty}. */ #endif