MathGroup Archive 1992

[Date Index] [Thread Index] [Author Index]

Search the Archive

maybe better union of intervals

  • To: mathgroup at
  • Subject: maybe better union of intervals
  • From: fateman at (Richard Fateman)
  • Date: Fri, 5 Jun 92 16:59:22 -0700

(* Take a list of intervals of the form {{low1, high1} ...{lown,highn}}
   and return a list of maximal intervals, sorted by lower endpoints *)

 (*an empty list is a list of maximal intervals. *)


 (* a list of one interval is also *)


 (* given an interval a ={low,hi} and a list L of maximal intervals,
sorted, with  the lowest (first) element of L = {l,h}, and with
low <= l, then a new list L' of maximal intervals consists either of
appending a to L, or merging a with {l,h}, and appending that to the
rest of L. The merge is necessary exactly when hi >=l *)


mi1[new:{low_,hi_},old:{{l_,h_},___} ]:=
         If [hi>=l, 

  • Prev by Date: Re: Mie scattering
  • Next by Date: Re: Functional solution to union of intervals
  • Previous by thread: Quaternions etc.
  • Next by thread: Re: Polygons