SegmentCategory SΒΆ
seg.spad line 1 [edit on github]
S: Type
This category provides operations on ranges, or segments as they are called.
- +: (%, S) -> % if S has AbelianSemiGroup
(l..h)+i
returns segmentl+i .. h+i
.
- +: (S, %) -> % if S has AbelianSemiGroup
i+(l..h)
returns segmenti+l .. i+h
.
- -: (%, S) -> % if S has AbelianGroup
(l..h)-i
returns segmentl-i .. h-i
.
- =: (%, %) -> Boolean if S has SetCategory
from BasicType
- ~=: (%, %) -> Boolean if S has SetCategory
from BasicType
- BY: (%, Integer) -> %
s by n
creates a new segment in which only everyn
-
th element is used.
- coerce: % -> OutputForm if S has SetCategory
from CoercibleTo OutputForm
- convert: % -> InputForm if S has ConvertibleTo InputForm
from ConvertibleTo InputForm
- convert: S -> %
convert(i)
creates the segmenti..i
.
- high: % -> S
high(s)
returns the second endpoint ofs
. Note:high(l..h) = h
.
- incr: % -> Integer
incr(s)
returnsn
, wheres
is a segment in which everyn
-
th element is used. Note:incr(l..h by n) = n
.
- latex: % -> String if S has SetCategory
from SetCategory
- low: % -> S
low(s)
returns the first endpoint ofs
. Note:low(l..h) = l
.
- reverse: % -> % if S has OrderedRing
reverse(s)
returns segments
in reverse order.
- segment: (S, S) -> %
segment(i, j)
is an alternate way to create the segmenti..j
.
- SEGMENT: (S, S) -> %
l..h
creates a segment withl
andh
as the endpoints.
BasicType if S has SetCategory
CoercibleTo OutputForm if S has SetCategory
ConvertibleTo InputForm if S has ConvertibleTo InputForm
SetCategory if S has SetCategory