AIntervalCategory RΒΆ
ainterval.spad line 74 [edit on github]
- R: OrderedRing 
AIntervalCategory(R) exports operations that can be done with intervals. Although these operations should be similar to the arithmetic operations of a Ring, we do not export Ring, since the ring axioms are not fulfilled.
- 0: %
- 0 is interval(0,0). 
- 1: %
- 1 is interval(1,1). 
- *: (%, %) -> %
- x*ycreates an interval such that for any- uand- vwith contains?(- x,- u) and contains?(- y,- v) it holds contains?(x*y,u*v).
- *: (Integer, %) -> %
- z*xcreates the interval- [z * inf x, z * sup x].
- *: (PositiveInteger, %) -> %
- z*xcreates the interval- [z * inf x, z * sup x].
- *: (R, %) -> %
- r*xcreates the interval- [r * inf x, r * sup x].
- +: (%, %) -> %
- x+ycreates the interval- [inf x + inf y, sup x + sup y]. x+y creates an interval such that for any- uand- vwith contains?(- x,- u) and contains?(- y,- v) it holds contains?(x+y,u+v).
- +: (%, R) -> %
- x+rcreates the interval- [inf x + r, sup x + x].
- -: % -> %
- -xcreates the interval- [- sup x, - inf x].
- -: (%, %) -> %
- x-ycreates the interval- x+(-y).
- /: (%, %) -> % if R has Field
- x/yreturns x*inv(- y). If positive?(- x) and positive?(- y), then this is equal to interval(inf(- x)/sup(- y),sup(- x)/inf(- y)).
- =: (%, %) -> %
- x=yreturns- trueiff inf(- x)=inf(- y) and sup(- x)=sup(- y).
- =: (%, %) -> Boolean
- from BasicType 
- ^: (%, NonNegativeInteger) -> %
- x^nreturns interval(1,1) if- xis not zero and- n=0. Otherwise it creates an interval such that for any- uand- vwith contains?(- x,- u) it holds contains?(- x^n,u^n).
- ^: (%, PositiveInteger) -> %
- x^ncreates an interval such that for any- uand- vwith contains?(- x,- u) it holds contains?(- x^n,u^n).
- abs: % -> %
- abs(x)returns the tightest interval such that for all- rwith contains?(- x,- r) it holds contains?(abs(- x),abs(- r)).
- coerce: % -> List R
- coerce(x)returns [inf(- x),sup(- x)].
- coerce: % -> OutputForm
- from CoercibleTo OutputForm 
- contains?: (%, %) -> Boolean
- contains?(x,y)returns- trueif- inf(x)<=inf(y)and- sup(y)<=sup(x)and- falseotherwise.
- contains?: (%, R) -> Boolean
- contains?(x,r)returns- trueif- inf(x)<=r<=sup(x)and- falseotherwise.
- error?: % -> Boolean
- error?(x)returns- trueif the lower bound is bigger than the upper bound. That can happen it such an interval is created by the qinterval function.
- inf: % -> R
- inf(x)returns the infinum of- x.
- interval: (R, R) -> %
- interval(x,y)creates a new interval- [x,y], if- x<=yand $- [y,x], if- y<x.
- inv: % -> % if R has Field
- inv(x)returns interval(1/sup(- x),1/inf(- x)) if not contains?(- x,0). It is an error, if the interval contains 0.
- latex: % -> String
- from SetCategory 
- negative?: % -> Boolean
- negative?(u)returns- trueif every element of- uis negative,- falseotherwise.
- one?: % -> Boolean
- one?(x)returns- trueif x=interval(1,1).
- positive?: % -> Boolean
- positive?(x)returns- trueif every element of- uis positive,- falseotherwise.
- qinterval: (R, R) -> %
- qinterval(inf,sup)creates a new interval without checking the ordering on the elements.
- sup: % -> R
- sup(x)returns the supremum of- x.
- unit?: % -> Boolean if R has Field
- unit?(x)returns- trueif every element in- xcan be inverted, i.e. if not contains?(- x,0).
- width: % -> R
- width(x)returns- sup(x) - inf(x).
- zero?: % -> Boolean
- zero?(x)returns- trueif x=interval(0,0).