EltableAggregate(Dom, Im)ΒΆ
aggcat.spad line 782 [edit on github]
An eltable aggregate is one which can be viewed as a function. For example, the list [1, 7, 4]
can be applied to 1, 2, and 3 respectively and will return the integers 1, 7, and 4; thus this list may be viewed as mapping 1 to 1, 2 to 7 and 3 to 4. In general, an aggregate can map members of a domain Dom to an image domain Im.
- elt: (%, Dom, Im) -> Im
elt(u, x, y)
appliesu
tox
ifx
is in the domain ofu
, and returnsy
otherwise.
- qelt: (%, Dom) -> Im
qelt(u, x)
appliesu
tox
without checking whetherx
is in the domain ofu
. Ifx
is not in the domain ofu
a memory-access violation may occur. If a check on whetherx
is in the domain ofu
is required, use the functionelt
.
- qsetelt!: (%, Dom, Im) -> Im if % has shallowlyMutable
qsetelt!(u, x, y)
sets the image ofx
to bey
underu
, without checking thatx
is in the domain ofu
. If such a check is required use the functionsetelt!
.
- setelt!: (%, Dom, Im) -> Im if % has shallowlyMutable
setelt!(u, x, y)
sets the image ofx
to bey
underu
, ifx
is in the domain ofu
. Error: ifx
is not in the domain ofu
.
Eltable(Dom, Im)