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 OrderedAbelianMonoid or R has OrderedMonoid and R has SemiRing or R has SemiRng and % has AbelianMonoid and R has OrderedSemiGroup
0 is interval(0,0).
- 1: % if R has OrderedMonoid and R has SemiRing
from MagmaWithUnit
- *: (%, %) -> % if R has OrderedMonoid and R has SemiRing or R has OrderedSemiGroup and R has SemiRng
x*y
creates an interval such that for any elementsu
andv
with contains?(x
,u
) and contains?(y
,v
) it holds contains?(x*y,u*v).
- *: (Integer, %) -> % if R has OrderedAbelianGroup or R has OrderedMonoid and R has SemiRing and % has AbelianGroup or R has SemiRng and R has OrderedSemiGroup and % has AbelianGroup
z*x
creates interval(z
* infx
,z
* supx
).- *: (NonNegativeInteger, %) -> % if R has OrderedAbelianMonoid or R has OrderedMonoid and R has SemiRing or R has SemiRng and % has AbelianMonoid and R has OrderedSemiGroup
from AbelianMonoid
- *: (PositiveInteger, %) -> %
z*x
creates the interval[z * inf x, z * sup x]
.
- *: (R, %) -> % if R has OrderedSemiGroup and R has SemiRng
r*x
creates the interval(r
* infx
,r
* supx
).
- +: (%, %) -> %
x+y
creates the interval[inf x + inf y, sup x + sup y]
. x+y creates an interval such that for anyu
andv
with contains?(x
,u
) and contains?(y
,v
) it holds contains?(x+y,u+v).
- +: (%, R) -> %
x+r
creates the interval[inf x + r, sup x + r]
.
- -: % -> % if R has OrderedAbelianGroup or R has OrderedMonoid and R has SemiRing and % has AbelianGroup or R has SemiRng and R has OrderedSemiGroup and % has AbelianGroup
-x
creates the interval[- sup x, - inf x]
.
- -: (%, %) -> % if R has OrderedAbelianGroup or R has OrderedMonoid and R has SemiRing and % has AbelianGroup or R has SemiRng and R has OrderedSemiGroup and % has AbelianGroup
x-y
creates the intervalx+(-y)
.
- /: (%, %) -> % if R has Field and R has OrderedRing
x/y
returns 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=y
returnstrue
iff inf(x
)=inf(y
) and sup(x
)=sup(y
).
- ^: (%, NonNegativeInteger) -> % if R has OrderedMonoid and R has SemiRing
x^n
returns interval(1,1) ifx
is not zero andn=0
. Otherwise it creates an interval such that for any elementsu
andv
with contains?(x
,u
) it holds contains?(x^n
,u^n).
- ^: (%, PositiveInteger) -> % if R has OrderedMonoid and R has SemiRing or R has OrderedSemiGroup and R has SemiRng
x^n
creates an interval such that for any elementsu
with contains?(x
,u
) it holds contains?(x^n
,u^n).
- abs: % -> % if R has OrderedAbelianGroup
abs(x)
returns the tightest interval such that for allr
with contains?(x
,r
) it holds contains?(abs(x
),abs(r
)).
- antiCommutator: (%, %) -> % if R has OrderedMonoid and R has SemiRing or R has OrderedSemiGroup and R has SemiRng
- coerce: % -> List R
coerce(x)
returns [inf(x
),sup(x
)].- coerce: % -> OutputForm
from CoercibleTo OutputForm
- contains?: (%, %) -> Boolean
contains?(x,y)
returnstrue
ifinf(x)<=inf(y)
andsup(y)<=sup(x)
andfalse
otherwise.
- contains?: (%, R) -> Boolean
contains?(x,r)
returnstrue
ifinf(x)<=r<=sup(x)
andfalse
otherwise.
- error?: % -> Boolean
error?(x)
returnstrue
if 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 infinum ofx
.
- interval: (R, R) -> %
interval(x,y)
creates a new interval[x,y]
, ifx<=y
and $[y,x]
, ify<x
.
- inv: % -> % if R has Field and R has OrderedRing
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 OrderedMonoid and R has SemiRing
from MagmaWithUnit
- leftPower: (%, PositiveInteger) -> % if R has OrderedMonoid and R has SemiRing or R has OrderedSemiGroup and R has SemiRng
from Magma
- leftRecip: % -> Union(%, failed) if R has OrderedMonoid and R has SemiRing
from MagmaWithUnit
- negative?: % -> Boolean if R has OrderedAbelianMonoid
negative?(u)
returnstrue
iffu<0
for every element ofu
ofx
, i.e. sup(x
)<0
.
- one?: % -> Boolean if R has OrderedMonoid and R has SemiRing
from MagmaWithUnit
- opposite?: (%, %) -> Boolean if R has OrderedAbelianMonoid or R has OrderedMonoid and R has SemiRing or R has SemiRng and % has AbelianMonoid and R has OrderedSemiGroup
from AbelianMonoid
- positive?: % -> Boolean if R has OrderedAbelianMonoid
positive?(x)
returnstrue
iffu>0
for every element ofu
ofx
, 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 OrderedMonoid and R has SemiRing
from MagmaWithUnit
- rightPower: (%, NonNegativeInteger) -> % if R has OrderedMonoid and R has SemiRing
from MagmaWithUnit
- rightPower: (%, PositiveInteger) -> % if R has OrderedMonoid and R has SemiRing or R has OrderedSemiGroup and R has SemiRng
from Magma
- rightRecip: % -> Union(%, failed) if R has OrderedMonoid and R has SemiRing
from MagmaWithUnit
- sample: % if R has OrderedAbelianMonoid or R has OrderedMonoid and R has SemiRing or R has SemiRng and % has AbelianMonoid and R has OrderedSemiGroup
from AbelianMonoid
- subtractIfCan: (%, %) -> Union(%, failed) if R has OrderedMonoid and R has SemiRing and % has AbelianGroup or R has SemiRng and R has OrderedSemiGroup and % has AbelianGroup
- sup: % -> R
sup(x)
returns the supremum ofx
.
- unit?: % -> Boolean if R has Field and R has OrderedRing
unit?(x)
returnstrue
if every element inx
can be inverted, i.e. if not contains?(x
,0).
- width: % -> R if R has OrderedAbelianGroup
width(x)
returnssup(x) - inf(x)
.
- zero?: % -> Boolean if R has OrderedAbelianMonoid or R has OrderedMonoid and R has SemiRing or R has SemiRng and % has AbelianMonoid and R has OrderedSemiGroup
zero?(x)
returnstrue
if x=interval(0,0).
AbelianMonoid if R has OrderedMonoid and R has SemiRing or R has OrderedAbelianMonoid
BiModule(%, %) if R has OrderedMonoid and R has SemiRing or R has OrderedSemiGroup and R has SemiRng
CancellationAbelianMonoid if R has OrderedMonoid and R has SemiRing and % has AbelianGroup or R has SemiRng and R has OrderedSemiGroup and % has AbelianGroup
LeftModule % if R has OrderedMonoid and R has SemiRing or R has OrderedSemiGroup and R has SemiRng
Magma if R has OrderedMonoid and R has SemiRing or R has OrderedSemiGroup and R has SemiRng
MagmaWithUnit if R has OrderedMonoid and R has SemiRing
Monoid if R has OrderedMonoid and R has SemiRing
NonAssociativeSemiRing if R has OrderedMonoid and R has SemiRing
NonAssociativeSemiRng if R has OrderedMonoid and R has SemiRing or R has OrderedSemiGroup and R has SemiRng
RightModule % if R has OrderedMonoid and R has SemiRing or R has OrderedSemiGroup and R has SemiRng
SemiGroup if R has OrderedMonoid and R has SemiRing or R has OrderedSemiGroup and R has SemiRng
SemiRing if R has OrderedMonoid and R has SemiRing
SemiRng if R has OrderedMonoid and R has SemiRing or R has OrderedSemiGroup and R has SemiRng