AIntervalCategory R¶
ainterval.spad line 8 [edit on github]
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: % if R has SetWithZero
from SetWithZero
- 1: % if R has Monoid and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R hasn’t OrderedMagma and R has OrderedMagmaWithZero and R has MagmaWithUnit or R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has Monoid and R has OrderedMagma or R has SemiRing and R has OrderedMagma or R has OrderedMagma and R has MagmaWithUnit
from MagmaWithUnit
- *: (%, %) -> % if R has OrderedMagmaWithZero or R has OrderedMagma
x*ycreates an interval such that for any elementsuandvwith contains?(x,u) and contains?(y,v) it holds contains?(x*y,u*v).
- *: (Integer, %) -> % if R hasn’t OrderedMagma and R has SemiRng and R has OrderedMagmaWithZero and % has AbelianGroup or R has SemiRng and R has OrderedMagma and % has AbelianGroup or R has SemiRing and R hasn’t OrderedMagma and R has OrderedMagmaWithZero and % has AbelianGroup or R has SemiRing and R has OrderedMagma and % has AbelianGroup or R has AbelianGroup
z*xcreates interval(z* infx,z* supx).- *: (NonNegativeInteger, %) -> % if R has AbelianMonoid or % has AbelianMonoid and R has SemiRng and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or % has AbelianMonoid and R has SemiRng and R has OrderedMagma
from AbelianMonoid
- *: (PositiveInteger, %) -> %
z*xcreates the interval[z * inf x, z * sup x].
- *: (R, %) -> % if R has OrderedMagmaWithZero or R has OrderedMagma
r*xcreates the interval(r* infx,r* supx).
- +: (%, %) -> %
x+ycreates the interval[inf x + inf y, sup x + sup y]. x+y creates an interval such that for anyuandvwith contains?(x,u) and contains?(y,v) it holds contains?(x+y,u+v).
- +: (%, R) -> %
x+rcreates the interval[inf x + r, sup x + r].
- -: % -> % if R hasn’t OrderedMagma and R has SemiRng and R has OrderedMagmaWithZero and % has AbelianGroup or R has SemiRng and R has OrderedMagma and % has AbelianGroup or R has SemiRing and R hasn’t OrderedMagma and R has OrderedMagmaWithZero and % has AbelianGroup or R has SemiRing and R has OrderedMagma and % has AbelianGroup or R has AbelianGroup
-xcreates the interval[- sup x, - inf x].
- -: (%, %) -> % if R hasn’t OrderedMagma and R has SemiRng and R has OrderedMagmaWithZero and % has AbelianGroup or R has SemiRng and R has OrderedMagma and % has AbelianGroup or R has SemiRing and R hasn’t OrderedMagma and R has OrderedMagmaWithZero and % has AbelianGroup or R has SemiRing and R has OrderedMagma and % has AbelianGroup or R has AbelianGroup
x-ycreates the intervalx+(-y).
- /: (%, %) -> % if R has OrderedRing and 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)).
- =: (%, %) -> Boolean
x=yreturnstrueiff inf(x)=inf(y) and sup(x)=sup(y).
- ^: (%, NonNegativeInteger) -> % if R has Monoid and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R hasn’t OrderedMagma and R has OrderedMagmaWithZero and R has MagmaWithUnit or R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has Monoid and R has OrderedMagma or R has SemiRing and R has OrderedMagma or R has OrderedMagma and R has MagmaWithUnit
x^nreturns interval(1,1) ifn=0. Otherwise it creates an interval such that for any elementsuandvwith contains?(x,u) it holds contains?(x^n,u^n).
- ^: (%, PositiveInteger) -> % if R has OrderedMagmaWithZero or R has OrderedMagma
x^ncreates an interval such that for any elementsuwith contains?(x,u) it holds contains?(x^n,u^n).
- abs: % -> % if R has AbelianGroup
abs(x)returns the tightest interval such that for allrwith contains?(x,r) it holds contains?(abs(x),abs(r)).
- antiCommutator: (%, %) -> % if R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiRng and R has OrderedMagma or R has SemiRng and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiRing and R has OrderedMagma
- coerce: % -> List R
coerce(x)returns [inf(x),sup(x)].- coerce: % -> OutputForm
from CoercibleTo OutputForm
- contains?: (%, %) -> Boolean
contains?(x,y)returnstrueifinf(x)<=inf(y)andsup(y)<=sup(x)andfalseotherwise.
- contains?: (%, R) -> Boolean
contains?(x,r)returnstrueifinf(x)<=r<=sup(x)andfalseotherwise.
- error?: % -> Boolean
error?(x)returnstrueif the lower bound is bigger than the upper bound. That can happen if such an interval is created by the qinterval function.
- inf: % -> R
inf(x)returns the infimum ofx.
- interval: (R, R) -> %
interval(x,y)creates a new interval[x,y], ifx<=yand[y,x], ify<x.
- inv: % -> % if R has OrderedRing and 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
- leftPower: (%, NonNegativeInteger) -> % if R has Monoid and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R hasn’t OrderedMagma and R has OrderedMagmaWithZero and R has MagmaWithUnit or R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has Monoid and R has OrderedMagma or R has SemiRing and R has OrderedMagma or R has OrderedMagma and R has MagmaWithUnit
from MagmaWithUnit
- leftPower: (%, PositiveInteger) -> % if R has OrderedMagmaWithZero or R has OrderedMagma
from Magma
- leftRecip: % -> Union(%, failed) if R has Monoid and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R hasn’t OrderedMagma and R has OrderedMagmaWithZero and R has MagmaWithUnit or R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has Monoid and R has OrderedMagma or R has SemiRing and R has OrderedMagma or R has OrderedMagma and R has MagmaWithUnit
from MagmaWithUnit
- negative?: % -> Boolean if R has SetWithZero
negative?(x)returnstrueiffu<0for every elementuofx, i.e. sup(x)<0.
- one?: % -> Boolean if R has Monoid and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R hasn’t OrderedMagma and R has OrderedMagmaWithZero and R has MagmaWithUnit or R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has Monoid and R has OrderedMagma or R has SemiRing and R has OrderedMagma or R has OrderedMagma and R has MagmaWithUnit
from MagmaWithUnit
- opposite?: (%, %) -> Boolean if R has AbelianMonoid or % has AbelianMonoid and R has SemiRng and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or % has AbelianMonoid and R has SemiRng and R has OrderedMagma
from AbelianMonoid
- positive?: % -> Boolean if R has SetWithZero
positive?(x)returnstrueiffu>0for every elementuofx, i.e. 0<inf(x).
- qinterval: (R, R) -> %
qinterval(inf,sup)creates a new interval without checking the ordering on the elements.
- recip: % -> Union(%, failed) if R has Monoid and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R hasn’t OrderedMagma and R has OrderedMagmaWithZero and R has MagmaWithUnit or R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has Monoid and R has OrderedMagma or R has SemiRing and R has OrderedMagma or R has OrderedMagma and R has MagmaWithUnit
from MagmaWithUnit
- rightPower: (%, NonNegativeInteger) -> % if R has Monoid and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R hasn’t OrderedMagma and R has OrderedMagmaWithZero and R has MagmaWithUnit or R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has Monoid and R has OrderedMagma or R has SemiRing and R has OrderedMagma or R has OrderedMagma and R has MagmaWithUnit
from MagmaWithUnit
- rightPower: (%, PositiveInteger) -> % if R has OrderedMagmaWithZero or R has OrderedMagma
from Magma
- rightRecip: % -> Union(%, failed) if R has Monoid and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R hasn’t OrderedMagma and R has OrderedMagmaWithZero and R has MagmaWithUnit or R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has Monoid and R has OrderedMagma or R has SemiRing and R has OrderedMagma or R has OrderedMagma and R has MagmaWithUnit
from MagmaWithUnit
- sample: % if R has SetWithZero or R has Monoid and R has OrderedMagma or R has OrderedMagma and R has MagmaWithUnit
from SetWithZero
- subtractIfCan: (%, %) -> Union(%, failed) if R has SemiRing and R hasn’t OrderedMagma and R has OrderedMagmaWithZero and % has AbelianGroup or R has SemiRng and R has OrderedMagma and % has AbelianGroup or R hasn’t OrderedMagma and R has SemiRng and R has OrderedMagmaWithZero and % has AbelianGroup or R has SemiRing and R has OrderedMagma and % has AbelianGroup
- sup: % -> R
sup(x)returns the supremum ofx.
- unit?: % -> Boolean if R has OrderedRing and R has Field
unit?(x)returnstrueif every element inxcan be inverted, i.e. if not contains?(x,0).
- width: % -> R if R has AbelianGroup
width(x)returnssup(x) - inf(x).
- zero?: % -> Boolean if R has SetWithZero
from SetWithZero
AbelianMonoid if R has AbelianMonoid
BiModule(%, %) if R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiRng and R has OrderedMagma or R has SemiRng and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiRing and R has OrderedMagma
CancellationAbelianMonoid if R has SemiRing and R hasn’t OrderedMagma and R has OrderedMagmaWithZero and % has AbelianGroup or R has SemiRng and R has OrderedMagma and % has AbelianGroup or R hasn’t OrderedMagma and R has SemiRng and R has OrderedMagmaWithZero and % has AbelianGroup or R has SemiRing and R has OrderedMagma and % has AbelianGroup
LeftModule % if R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiRng and R has OrderedMagma or R has SemiRng and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiRing and R has OrderedMagma
Magma if R has OrderedMagmaWithZero or R has OrderedMagma
MagmaWithUnit if R has Monoid and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R hasn’t OrderedMagma and R has OrderedMagmaWithZero and R has MagmaWithUnit or R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has Monoid and R has OrderedMagma or R has SemiRing and R has OrderedMagma or R has OrderedMagma and R has MagmaWithUnit
MagmaWithZero if R has MagmaWithZero and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has MagmaWithZero and R has OrderedMagma
Monoid if R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has Monoid and R has OrderedMagma or R has Monoid and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiRing and R has OrderedMagma
NonAssociativeSemiRing if R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiRing and R has OrderedMagma
NonAssociativeSemiRng if R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiRng and R has OrderedMagma or R has SemiRng and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiRing and R has OrderedMagma
RightModule % if R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiRng and R has OrderedMagma or R has SemiRng and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiRing and R has OrderedMagma
SemiGroup if R has SemiRing and R has OrderedMagma or R has SemiGroup and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiRng and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiRng and R has OrderedMagma or R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has Monoid and R has OrderedMagma or R has Monoid and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiGroup and R has OrderedMagma
SemiRing if R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiRing and R has OrderedMagma
SemiRng if R has SemiRing and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiRng and R has OrderedMagma or R has SemiRng and R has OrderedMagmaWithZero and R hasn’t OrderedMagma or R has SemiRing and R has OrderedMagma
SetWithZero if R has SetWithZero