Common Lisp Package: CL-NUM-UTILS.INTERVAL

README:

FUNCTION

Public

GRID-IN (INTERVAL SIZE &OPTIONAL (SEQUENCE-TYPE NIL SEQUENCE-TYPE?))

Return an arithmetic sequence of the given size (length) between the endpoints of the interval. The endpoints of the sequence coincide with the respective endpoint of the interval iff it is closed. RESULT-TYPE determines the result type (eg list), if not given it is a simple-array (of rank 1), narrowing to the appropriate float type or fixnum if possible.

IN-INTERVAL? (INTERVAL NUMBER)

Test if NUMBER is in INTERVAL (which can be NIL, designating the empty set).

INTERVAL (LEFT RIGHT &KEY OPEN-LEFT? OPEN-RIGHT?)

Create an INTERVAL.

INTERVAL-HULL (OBJECT)

Return the smallest connected interval that contains (elements in) OBJECT.

INTERVAL-LENGTH (INTERVAL)

Difference between left and right.

INTERVAL-MIDPOINT (INTERVAL &OPTIONAL (ALPHA 1/2))

Convex combination of left and right, with alpha (defaults to 0.5) weight on right.

PLUSMINUS-INTERVAL (CENTER HALF-WIDTH &KEY OPEN-LEFT? (OPEN-RIGHT? OPEN-LEFT?))

A symmetric interval around CENTER.

SHRINK-INTERVAL (INTERVAL LEFT &OPTIONAL (RIGHT LEFT) (CHECK-FLIP? T))

Shrink interval by given magnitudes (which may be REAL or RELATIVE). When check-flip?, the result is checked for endpoints being in a different order than the original. Negative LEFT and RIGHT extend the interval.

SPLIT-INTERVAL (INTERVAL DIVISIONS)

Return a vector of subintervals (same length as DIVISIONS), splitting the interval using the sequence DIVISIONS, which can be nonnegative real numbers (or RELATIVE specifications) and SPACERs which divide the leftover proportionally. If there are no spacers and the divisions don't fill up the interval, and error is signalled.

Undocumented

RELATIVE (FRACTION)

SPACER (&OPTIONAL (WEIGHT 1))

Private

RELATIVE-FRACTION (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

SPACER-WEIGHT (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

Undocumented

COPY-RELATIVE (INSTANCE)

COPY-SPACER (INSTANCE)

RELATIVE-P (OBJECT)

SPACER-P (OBJECT)

MACRO

Public

&INTERVAL (&WHOLE WHOLE1 LEFT RIGHT)

LET+ expansion for interval endpoints. If given a list of two values, the second value is an indicator for whether the endpoint is open.

EXTENDF-INTERVAL (PLACE OBJECT &ENVIRONMENT ENVIRONMENT)

Apply EXTEND-INTERVAL on PLACE using OBJECT.

GENERIC-FUNCTION

Public

EXTEND-INTERVAL (INTERVAL OBJECT)

Return an interval that includes INTERVAL and OBJECT. NIL stands for the empty set.

Undocumented

SHIFT-INTERVAL (INTERVAL OFFSET)

Private

Undocumented

SLOT-ACCESSOR

Public

LEFT (INTERVAL)

The Left endpoint of interval.

OPEN-LEFT? (INTERVAL)

The True iff the left endpoint of the interval is open.

OPEN-RIGHT? (INTERVAL)

The True iff the right endpoint of the interval is open.

CLASS

Public

FINITE-INTERVAL

Interval with finite endpoints.

INTERVAL (LEFT RIGHT &KEY OPEN-LEFT? OPEN-RIGHT?)

Abstract superclass for all intervals.

MINUSINF-INTERVAL

Interval from -∞ to RIGHT.

PLUSINF-INTERVAL

Interval from LEFT to ∞.

REAL-LINE

Representing the real line (-∞,∞).

RELATIVE (FRACTION)

Relative sizes are in terms of width.

SPACER (&OPTIONAL (WEIGHT 1))

Spacers divide the leftover portion of an interval.

Private

INTERVAL/FINITE-LEFT

Interval with left endpoint.

INTERVAL/FINITE-RIGHT

Interval with right endpoint.

INTERVAL/INFINITE-LEFT

Left endpoint is -∞.

INTERVAL/INFINITE-RIGHT

Right endpoint is ∞.