chickadee » srfi-179 » interval-projections

interval-projections interval right-dimensionprocedure

Conceptually, interval-projections takes a $d$-dimensional interval $[l_0,u_0)\times [l_1,u_1)\times\cdots\times[l_{d-1},u_{d-1})$ and splits it into two parts

$[l_0,u_0)\times\cdots\times[l_{d-\text{right-dimension}-1},u_{d-\text{right-dimension}-1})$

and

$[l_{d-\text{right-dimension}},u_{d-\text{right-dimension}})\times\cdots\times[l_{d-1},u_{d-1})$

This function, the inverse of Cartesian products or cross products of intervals, is used to keep track of the domains of curried arrays.

More precisely, if interval is an interval and right-dimension is an exact integer that satisfies 0 < right-dimension < d then interval-projections returns two intervals:

(values
 (make-interval
  (vector (interval-lower-bound interval 0)
          ...
          (interval-lower-bound interval
                                (- d right-dimension 1)))
  (vector (interval-upper-bound interval 0)
          ...
          (interval-upper-bound interval
                                (- d right-dimension 1))))
 (make-interval
  (vector (interval-lower-bound interval
                                (- d right-dimension))
          ...
          (interval-lower-bound interval
                                (- d 1)))
  (vector (interval-upper-bound interval
                                (- d right-dimension))
          ...
          (interval-upper-bound interval
                                (- d 1)))))

It is an error to call interval-projections if its arguments do not satisfy these conditions.