SegmentExpansionCategory(S, L)ΒΆ
seg.spad line 50 [edit on github]
S: OrderedRing
L: StreamAggregate S
This category provides an interface for expanding segments to a stream of elements.
- +: (%, S) -> %
from SegmentCategory S
- +: (S, %) -> %
from SegmentCategory S
- -: (%, S) -> %
from SegmentCategory S
- BY: (%, Integer) -> %
from SegmentCategory S
- coerce: % -> OutputForm
from CoercibleTo OutputForm
- convert: % -> InputForm if S has ConvertibleTo InputForm
from ConvertibleTo InputForm
- convert: S -> %
from SegmentCategory S
- expand: % -> L
expand(l..h by k)
creates value of typeL
with elementsl, l+k, ... lN
wherelN <= h < lN+k
. For example,expand(1..5 by 2) = [1, 3, 5]
.
- expand: List % -> L
expand(l)
creates a new value of typeL
in which each segmentl..h by k
is replaced withl, l+k, ... lN
, wherelN <= h < lN+k
. For example,expand [1..4, 7..9] = [1, 2, 3, 4, 7, 8, 9]
.
- high: % -> S
from SegmentCategory S
- incr: % -> Integer
from SegmentCategory S
- latex: % -> String
from SetCategory
- low: % -> S
from SegmentCategory S
- map: (S -> S, %) -> L
map(f, l..h by k)
produces a value of typeL
by applyingf
to each of the successive elements of the segment, that is,[f(l), f(l+k), ..., f(lN)]
, wherelN <= h < lN+k
.
- reverse: % -> %
from SegmentCategory S
- segment: (S, S) -> %
from SegmentCategory S
- SEGMENT: (S, S) -> %
from SegmentCategory S
ConvertibleTo InputForm if S has ConvertibleTo InputForm